Esempio n. 1
0
 private static string GetFormatedText(PosTenderType target, string [] textField, string textFormatString)
 {
     for (int i = 0; i < textField.Length; i++)
     {
         PropertyInfo pi = target.GetType().GetProperty(textField[i]);
         textFormatString = textFormatString.Replace("{" + i.ToString() + "}", pi != null ? pi.GetValue(target, null).ToString() : string.Empty);
     }
     return(textFormatString);
 }
Esempio n. 2
0
        private static bool IgnorThis(PosTenderType target, string parentFilter)
        {
            bool result = true;

            parentFilter = parentFilter.Replace(" ", "");                       // remove spaces
            parentFilter = parentFilter.Replace("'", "");                       // remove '
            string [] parsed = parentFilter.Split('=');                         // parse

            PropertyInfo pi          = target.GetType().GetProperty(parsed[0]);
            string       filterField = (string)pi.GetValue(target, null);

            if (filterField.ToLower() == parsed[1].ToLower())
            {
                result = false;
            }
            return(result);
        }