public void CreateUserField(TableField[] UserFieldDef, bool hasKeyFields, CrudAPI api, string pkPromptHeaderKey)
 {
     if (hasKeyFields)
     {
         UserFieldControl.CreateKeyFieldsGroupOnPage2(layoutItems, pkPromptHeaderKey, true);
     }
     if (UserFieldDef != null)
     {
         UserFieldControl.CreateUserFieldOnPage2(layoutItems, UserFieldDef, (RowIndexConverter)this.Resources["RowIndexConverter"], api, this, true);
     }
 }
Beispiel #2
0
        void CreateUserField()
        {
            if (tableheadermaster._HasPrimaryKey)
            {
                UserFieldControl.CreateKeyFieldsGroupOnPage2(layoutItems, tableheadermaster._PKprompt);
            }
            if (tableheadermaster._TableType == TableBaseType.Transaction)
            {
                UserFieldControl.CreateDateFieldGroupOnPage2(layoutItems);
            }
            var UserFieldDef = editrow.UserFieldDef();

            if (UserFieldDef != null)
            {
                UserFieldControl.CreateUserFieldOnPage2(layoutItems, UserFieldDef, (RowIndexConverter)this.Resources["RowIndexConverter"], this.api, this);
            }

            if (tableheadermaster._MasterTable != null)
            {
                int _tableId = editrow.MasterTableId;
                var RefType  = editrow.MasterType;
                if (RefType == null && _tableId != 0)
                {
                    RefType = typeof(Uniconta.DataModel.TableDataWithKey);
                    liMasterKey.FieldName  = Uniconta.ClientTools.Localization.lookup(tableheadermaster._MasterTable);
                    liMasterName.FieldName = Uniconta.ClientTools.Localization.lookup("Name");
                }
                lookupMasterKey.api = this.api;
                lookupMasterKey.SetForeignKeyRef(RefType, _tableId);
            }
            else
            {
                lookupMasterKey.IsEnabled = false;
                grpMaster.Visibility      = System.Windows.Visibility.Collapsed;
            }
        }