示例#1
0
 private bool IsTypeOK(ref string info, ExtDefKeyValue aKeyValue, ExtDefItem item)
 {
     bool flag = true;
     if (item.Type.Equals("True/False"))
     {
         bool flag2;
         flag = DataValidate.IsBoolean(ref info, item.Legend, aKeyValue.Value, out flag2);
         aKeyValue.Value = ProcessTrueFalseText(flag2.ToString());
         return flag;
     }
     if (item.Type.Equals("Double"))
     {
         double num;
         flag = DataValidate.IsDouble(ref info, item.Legend, aKeyValue.Value, out num);
         aKeyValue.Value = num.ToString();
         return flag;
     }
     if (item.Type.Equals("Integer"))
     {
         int num2;
         flag = DataValidate.IsInt(ref info, item.Legend, aKeyValue.Value, out num2);
         aKeyValue.Value = num2.ToString();
     }
     return flag;
 }
示例#2
0
 public FieldDefineFrm()
 {
     this.components = null;
     this.m_ExtItem = null;
     this.InitializeComponent();
     this.m_ExtItem = new ExtDefItem();
 }
示例#3
0
 private bool IsInChoiceList(ref string info, ExtDefKeyValue aKeyValue, ExtDefItem item)
 {
     bool flag = true;
     if (!((item.ChoiceList.Count <= 0) || item.ChoiceList.Contains(aKeyValue.Value)))
     {
         info = NEResource.NE_INVALID_FIELD + item.Legend;
         flag = false;
     }
     return flag;
 }
示例#4
0
 private bool IsLengthOK(ref string info, ExtDefKeyValue aKeyValue, ExtDefItem item)
 {
     bool flag = true;
     if (item.Type.Equals("Text") && (aKeyValue.Value.Length > item.Size))
     {
         string str = "Property '" + item.Legend + "'";
         info = string.Format(NEResource.NE_VALIDATE_LENGTHLIMIT, str, item.Size);
         flag = false;
     }
     return flag;
 }
示例#5
0
 public FieldDefineFrm(ExtDefItem extItem)
 {
     this.components = null;
     this.m_ExtItem = null;
     this.InitializeComponent();
     this.m_ExtItem = extItem;
     this.m_Name.Text = this.m_ExtItem.Name;
     this.m_Group.Text = this.m_ExtItem.Group;
     this.m_Legend.Text = this.m_ExtItem.Legend;
     this.m_Type.Text = this.m_ExtItem.Type;
     if (this.m_Type.Text == "Text")
     {
         this.m_Size.Text = this.m_ExtItem.Size.ToString();
     }
     else
     {
         this.m_Size.Text = string.Empty;
     }
     this.m_Default.Text = this.m_ExtItem.Default;
     this.m_ChoiceList.Lines = this.m_ExtItem.ChoiceList.ToArray();
     this.m_Name.Enabled = false;
     this.m_Type.Enabled = false;
     this.m_Size.Enabled = false;
 }
示例#6
0
 private bool IsValidateTEXTType(ref string info, string name, string value, ExtDefItem item, string colType)
 {
     bool flag = true;
     bool flag2 = colType.Equals("Text") && !value.Equals("");
     if (flag2)
     {
         string str;
         flag = DataValidate.NotEmptyString(ref info, name, value, out str);
         if (flag2 && (value.ToString().Length > item.Size))
         {
             flag = false;
             object obj2 = info;
             info = string.Concat(new object[] { obj2, "The length of \"", value.ToString(), "\" exceed the limited length ", item.Size, "!\r\n" });
         }
     }
     return flag;
 }
示例#7
0
 private bool IsValidateCellValue(ref string info, DataRow dr, ExtDefItem item, ref ExtDefKeyValue extkeyValue)
 {
     bool flag = true;
     string name = item.Name;
     string legend = item.Legend;
     string type = item.Type;
     bool flag2 = type.Equals("Integer") && !dr[name].ToString().Equals("");
     if (flag2)
     {
         int num;
         flag &= DataValidate.IsInt(ref info, legend, dr[name], -2147483648, 0x7fffffff, out num);
         extkeyValue.Value = num.ToString();
     }
     flag2 = type.Equals("Text") && !dr[name].ToString().Equals((string) null);
     if (flag2)
     {
         if (flag2 && (dr[name].ToString().Length > item.Size))
         {
             flag = false;
             info = string.Concat(new object[] { "The length of \"", dr[name].ToString(), "\" exceed the limited length ", item.Size, "!\r\n" });
         }
         extkeyValue.Value = dr[name].ToString();
     }
     flag2 = type.Equals("Double") && !dr[name].ToString().Equals("");
     if (flag2)
     {
         double num2;
         flag &= DataValidate.IsDouble(ref info, legend, dr[name], double.MinValue, double.MaxValue, out num2);
         extkeyValue.Value = num2.ToString();
     }
     flag2 = type.Equals("True/False") && !dr[name].ToString().Equals("");
     if (flag2)
     {
         bool flag3;
         flag &= DataValidate.IsBoolean(ref info, legend, dr[name], out flag3);
         extkeyValue.Value = UserDefineDesc.ProcessTrueFalseText(flag3.ToString());
         dr[name] = extkeyValue.Value;
     }
     return flag;
 }
示例#8
0
 private static bool IsDoubleOrINTType(ExtDefItem item)
 {
     return (item.Type.Equals("Double") || item.Type.Equals("Integer"));
 }