Exemple #1
0
        public static List <PmsField> InitialFieldList(string _strTableName)
        {
            List <PmsField> _pmsFieldList = new List <PmsField>();

            try
            {
                System.Data.DataTable table = PMSDBStructure.GetTableFieldInfo(_strTableName);

                if (table == null || table.Rows.Count == 0)
                {
                    return(_pmsFieldList);
                }

                foreach (DataRow row in table.Rows)
                {
                    PmsField field = new PmsField();
                    try
                    {
                        field.fieldName = row["FieldName"].ToString();
                        string strType = row["FieldType"].ToString();
                        strType = strType.ToLower();
                        int length = 20;
                        length = Convert.ToInt32((row["FieldLength"]));
                        field.fieldDescription = row["FieldDescription"].ToString();
                        field.fieldType        = PmsField.ToPMSDataType(strType, length);
                        field.fieldKey         = (bool)row["FieldPrimaryKey"];
                        field.fieldNull        = (bool)row["FieldNullAble"];
                        field.fieldDefault     = row["FieldDefault"];
                    }
                    catch
                    {
                    }
                    string propEx = PMSDBStructure.GetTableColumnPropertie(_strTableName, field.fieldName, "ColumnType");

                    //存在加密
                    if (propEx == PMS.Libraries.ToolControls.PMSPublicInfo.ColumnType.Encrypted)
                    {
                        field.fieldEncryptType = PMSDBStructure.GetTableColumnPropertie(_strTableName, field.fieldName, "EncryptType");
                    }


                    _pmsFieldList.Add(field);
                }
            }
            catch (Exception ex)
            {
                PMS.Libraries.ToolControls.PMSPublicInfo.PublicFunctionClass.EnhancedStackTrace(ex);
            }
            return(_pmsFieldList);
        }
 void TextBoxEx_KeyPress(object sender, KeyPressEventArgs e)
 {
     //用户表密码字段输入不超过12
     if (TableName != null && TableName.Equals("s_UserInfo", StringComparison.CurrentCultureIgnoreCase) &&
         _rField.Equals("Pass", StringComparison.CurrentCultureIgnoreCase))
     {
         if (this.SelectionLength == 0)//没有选择的时候,输入
         {
             if (this.Text.Length >= 12)
             {
                 e.Handled = true;
             }
         }
     }
     if (PmsField.textBoxKeyPress(this.Text, RType, this, e.KeyChar))
     {
         e.Handled = true;
     }
 }