using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
|
namespace CSFrameworkV5.Core.Common
|
{
|
internal static class ConvertEx
|
{
|
public static string ToString(object obj)
|
{
|
if (obj == null) return string.Empty;
|
return obj.ToStringEx().Trim();
|
}
|
|
public static int ToInt(object obj)
|
{
|
if (obj == null) return 0;
|
int i;
|
if (int.TryParse(obj.ToStringEx(), out i))
|
return i;
|
else
|
return 0;
|
}
|
}
|
}
|