Exemple #1
0
        /// <summary>
        /// Normalizes entered string according to supplied format and culture. Normalization is done by
        ///  adding characters so data looks more standard, i.e. adding dashes and hyphens to phone numbers etc.
        /// May throw exception if normalization is not possible i.e. normalize "uiug" as currency
        /// </summary>
        public static string NormalizeEnteredString(string value, DataEntryFormat format, CultureInfo culture)
        {
            //so far this is only for US culture, add logic in future to support different cultures supplied in "culture" parameter
            switch (format)
            {
            case DataEntryFormat.Phone:
            {
                return(DataEntryUtils.NormalizeUSPhone(value));
            }



            default:
                return(value);
            }//switch
        }
Exemple #2
0
 /// <summary>
 /// Normalizes entered string according to supplied format and culture. Normalization is done by
 ///  adding characters so data looks more standard, i.e. adding dashes and hyphens to phone numbers etc.
 /// May throw exception if normalization is not possible i.e. normalize "uiug" as currency 
 /// </summary>
 public static string NormalizeEnteredString(string value, DataEntryFormat format, CultureInfo culture)
 {
   //so far this is only for US culture, add logic in future to support different cultures supplied in "culture" parameter
   switch (format)
   {
      case DataEntryFormat.Phone:
      {
         return DataEntryUtils.NormalizeUSPhone(value);
      }
   
   
   
      default:   
        return value;
   
   }//switch
 }