Пример #1
0
 public static int? ToNullableInteger(this string value)
 {
     int temp = 0;
     if (int.TryParse(value.CleanText(), out temp))
         return temp;
     else
         return (int?)null;
 }
Пример #2
0
 public static long? ToNullableLong(this string value)
 {
     long temp = 0;
     if (long.TryParse(value.CleanText(), out temp))
         return temp;
     else
         return (long?)null;
 }
Пример #3
0
 public static decimal? ToNullableDecimal(this string value)
 {
     decimal temp = 0;
     if (decimal.TryParse(value.CleanText(), out temp))
         return temp;
     else
         return (decimal?)null;
 }
Пример #4
0
 public static double? ToNullableDouble(this string value)
 {
     double temp = 0;
     if (double.TryParse(value.CleanText(), out temp))
         return temp;
     else
         return (double?)null;
 }
Пример #5
0
 public static int ToInteger(this string value)
 {
     int temp = 0;
     int.TryParse(value.CleanText(), out temp);
     return temp;
 }
Пример #6
0
 public static long ToLong(this string value)
 {
     long temp = 0;
     long.TryParse(value.CleanText(), out temp);
     return temp;
 }
Пример #7
0
 public static decimal ToDecimal(this string value)
 {
     decimal temp = 0;
     decimal.TryParse(value.CleanText(), out temp);
     return temp;
 }
Пример #8
0
 public static double ToDouble(this string value)
 {
     double temp = 0;
     double.TryParse(value.CleanText(), out temp);
     return temp;
 }
Пример #9
0
 public static bool IsLong(this string value)
 {
     long temp;
     return long.TryParse(value.CleanText(), out temp);
 }
Пример #10
0
 public static bool IsInteger(this string value)
 {
     int temp;
     return int.TryParse(value.CleanText(), out temp);
 }
Пример #11
0
 public static bool IsDouble(this string value)
 {
     double temp;
     return double.TryParse(value.CleanText(), out temp);
 }
Пример #12
0
 public static bool IsDecimal(this string value)
 {
     decimal temp;
     return decimal.TryParse(value.CleanText(), out temp);
 }
Пример #13
0
 public static bool HasText(this TextBox textBox)
 {
     return !string.IsNullOrWhiteSpace(textBox.CleanText());
 }