
namespace System
{
    public static class MyString
    {

        public static int ToInt32(this object D)
        {
            int p = 0;
            if (D == null)
                return 0;
            int.TryParse(D.ToString(), out p);
            return p;
        }

        public static string ToMyString(this object D)
        {
            if (D == null)
                return "";
            return D.ToString();
        }

        public static DateTime ToDateTime(this object D)
        {
            DateTime dt = DateTime.Now;
            if (D == null)
                return dt;
            DateTime.TryParse(D.ToString(),out dt);
            return dt;
        }

    }
}
