Esempio n. 1
0
 public void Initialize(ABCView view, ABCBindingInfo bindingInfo)
 {
     this.DataSource = bindingInfo.BusName;
     this.DataMember = bindingInfo.FieldName;
     this.TableName  = bindingInfo.TableName;
     this.Text       = ABCPresentHelper.GetLabelCaption(view, this.DataSource, this.DataMember);
 }
Esempio n. 2
0
        public void PopulateControls(ABCView view, String BusName, String strTableName)
        {
            ViewOwner  = view;
            DataSource = BusName;
            TableName  = strTableName;
            int iCount = 0;

            foreach (DataConfigProvider.FieldConfig fieldConfig in DataConfigProvider.TableConfigList[strTableName].FieldConfigList.Values)
            {
                //if ( fieldConfig.IsDefault )
                //{
                String strDiplay = DataConfigProvider.GetFieldCaption(strTableName, fieldConfig.FieldName);
                if (strDiplay == fieldConfig.FieldName)
                {
                    continue;
                }

                ABCBindingBaseEdit ctrl;

                if (view.Mode == ViewMode.Design)
                {
                    ctrl = (ABCBindingBaseEdit)view.Surface.DesignerHost.CreateComponent(typeof(ABCBindingBaseEdit));
                }
                else
                {
                    ctrl = (ABCBindingBaseEdit)ABCDynamicInvoker.CreateInstanceObject(typeof(ABCBindingBaseEdit));
                }

                ABCBindingInfo bindInfo = new ABCBindingInfo();
                bindInfo.BusName   = BusName;
                bindInfo.TableName = TableName;
                bindInfo.FieldName = fieldConfig.FieldName;
                List <Type> lstType = ABCControls.ABCPresentHelper.GetControlTypes(TableName, fieldConfig.FieldName);
                if (lstType.Count <= 0)
                {
                    continue;
                }
                foreach (Type type in lstType)
                {
                    if (type != typeof(ABCSearchControl))
                    {
                        bindInfo.ControlType = lstType[0];
                        break;
                    }
                }
                ctrl.Initialize(view, bindInfo);
                ctrl.Parent = this;
                iCount++;
                //}
            }
            if (iCount % 2 != 0)
            {
                iCount++;
            }
            iCount    = iCount / 2;
            this.Size = new Size(229 * 2 + 4 * 3, 20 * iCount + (iCount + 1) * 5);
        }
Esempio n. 3
0
 public void Initialize(ABCView view, ABCBindingInfo bindingInfo)
 {
     try
     {
         OwnerView       = view;
         this.DataSource = bindingInfo.BusName;
         this.DataMember = bindingInfo.FieldName;
         this.TableName  = bindingInfo.TableName;
         if (bindingInfo.ControlType == null || String.IsNullOrWhiteSpace(bindingInfo.ControlType.FullName))
         {
             this.UIControlType = typeof(ABCTextEdit).FullName;
         }
         else
         {
             this.UIControlType = bindingInfo.ControlType.FullName;
         }
     }
     catch (Exception ex)
     {
         ABCHelper.ABCMessageBox.Show("Binding cancel");
     }
 }
Esempio n. 4
0
 public void Initialize(ABCBindingInfo bindingInfo)
 {
     this.DataSource = bindingInfo.BusName;
     this.DataMember = bindingInfo.FieldName;
     this.TableName  = bindingInfo.TableName;
 }
Esempio n. 5
0
 public void Initialize(ABCView view, ABCBindingInfo bindingInfo)
 {
     this.DataSource = bindingInfo.BusName;
     this.DataMember = bindingInfo.FieldName;
     //      this.Caption=ABCPresentUtils.GetLabelCaption( view , this.DataSource , this.DataMember );
 }