Пример #1
0
        public ControlElement GetControlElementByInfo(string tbName, string fieldName)
        {
            int conLen = this.controls.Count;

            for (int i = 0; i < conLen; i++)
            {
                if (this.controls[i].Field.FieldName == fieldName && this.controls[i].Field.FieldTable == tbName)
                {
                    return(this.controls[i]);
                }
            }
            int          len   = tabs.Count;
            FieldElement field = null;

            for (int i = 0; i < len; i++)
            {
                if (tabs[i].tableName == tbName)
                {
                    field = tabs[i].GetFieldElement(fieldName);
                }
            }
            if (field != null)
            {
                if (field._Type == ControlType.Text)
                {
                    charText _charText = new charText(field);
                    return(_charText);
                }
                else if (field._Type == ControlType.ComboBox)
                {
                    comboBox _box = new comboBox(field);
                    return(_box);
                }
                else if (field._Type == ControlType.TimeBox)
                {
                    timeBox _timebox = new timeBox(field);
                    return(_timebox);
                }
                else if (field._Type == ControlType.NumericEdit)
                {
                    NumericEdit _NumericEdit = new NumericEdit(field);
                    return(_NumericEdit);
                }
            }
            return(null);
        }
Пример #2
0
 public ControlElement GetControlElementByInfo(string tbName, string fieldName)
 {
     int conLen = this.controls.Count;
     for (int i = 0; i < conLen; i++)
     {
         if (this.controls[i].Field.FieldName == fieldName && this.controls[i].Field.FieldTable == tbName)
         {
             return this.controls[i];
         }
     }
     int len = tabs.Count;
     FieldElement field = null;
     for (int i = 0; i < len; i++)
     {
         if (tabs[i].tableName == tbName)
         {
             field = tabs[i].GetFieldElement(fieldName);
         }
     }
     if (field != null)
     {
         if (field._Type == ControlType.Text)
         {
             charText _charText = new charText(field);
             return _charText;
         }
         else if (field._Type == ControlType.ComboBox)
         {
             comboBox _box = new comboBox(field);
             return _box;
         }
         else if (field._Type == ControlType.TimeBox)
         {
             timeBox _timebox = new timeBox(field);
             return _timebox;
         }
         else if (field._Type == ControlType.NumericEdit)
         {
             NumericEdit _NumericEdit = new NumericEdit(field);
             return _NumericEdit;
         }
     }
     return null;
 }