private void ContinueBuildDetailsOrganizerPage() { IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore; FieldControl fieldControl = configStore.FieldControlByNameFromGroup("Details", this.ExpandConfig.FieldGroupName); this.TilesName = fieldControl.ValueForAttribute("tiles"); bool hasCopyFields = false; foreach (FieldControlTab tab in fieldControl.Tabs) { if (tab.Fields != null) { if (tab.Fields.Any(field => !string.IsNullOrEmpty(field.Function) && field.Function != "=")) { hasCopyFields = true; } } if (hasCopyFields) { break; } } if (!hasCopyFields) { this.ContinueWithCopyFieldsLoaded(null); } else { this.CopyFields = new UPCopyFields(fieldControl); this.CopyFields.CopyFieldValuesForRecordIdentification(this.RecordIdentification, false, this); } }
/// <inheritDocs/> public void Configure(ref FieldControl backendControl, IFormFieldController <IFormFieldModel> formFieldController) { var checkboxesFieldModel = (ICheckboxesFieldModel)formFieldController.Model; if (checkboxesFieldModel.HasOtherChoice) { backendControl = new FormTextBox(); backendControl.ValidatorDefinition = checkboxesFieldModel.ValidatorDefinition; backendControl.Title = checkboxesFieldModel.MetaField.Title; ((IFormFieldControl)backendControl).MetaField = checkboxesFieldModel.MetaField; } else { var choices = checkboxesFieldModel.DeserializeChoices(); var checkboxesControl = (FormCheckboxes)backendControl; checkboxesControl.Choices.Clear(); foreach (var choice in choices) { checkboxesControl.Choices.Add(new Web.UI.Fields.ChoiceItem() { Text = choice, Value = choice }); } } }
protected void rptDetail_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { ProductFieldInfo productFieldInfo = e.Item.DataItem as ProductFieldInfo; FieldControl fieldControl = e.Item.FindControl("field") as FieldControl; if (fieldControl != null) { fieldControl.ControlType = (FieldType)productFieldInfo.FieldType; fieldControl.ControlPath = "~/Platform/h5/FieldControls/"; fieldControl.LoadControlId = ((FieldType)productFieldInfo.FieldType).ToString(); fieldControl.FieldName = productFieldInfo.FieldName; fieldControl.FieldAlias = productFieldInfo.Alias; fieldControl.FieldId = productFieldInfo.AutoID; fieldControl.Settings = XmlSerializerUtils.Deserialize <SinGooCMS.Control.FieldSetting>(productFieldInfo.Setting); fieldControl.DataLength = productFieldInfo.DataLength; fieldControl.EnableNull = productFieldInfo.EnableNull; if (!string.IsNullOrEmpty(productFieldInfo.Value)) { fieldControl.Value = productFieldInfo.Value; } else { fieldControl.Value = (productFieldInfo.DefaultValue ?? string.Empty); } } } }
protected override void InitContainer() { foreach (We7Control control in PanelContext.Panel.ConditionInfo.Controls) { HtmlTableCell cell = new HtmlTableCell(); cell.Visible = control.Visible; cell.InnerHtml = control.Label + ":"; cell.Attributes["class"] = "formTitle"; trQuery.Cells.Insert(trQuery.Cells.Count - 1, cell); cell = new HtmlTableCell(); cell.Visible = control.Visible; FieldControl fc = UIHelper.GetControl(control); cell.Attributes["class"] = "formValue"; cell.Controls.Add(fc); trQuery.Cells.Insert(trQuery.Cells.Count - 1, cell); } if (PanelContext.Panel.ConditionInfo.Controls.Count == 0) { bttnQuery.Visible = false; } InitQueryParamHandler(delegate(PanelContext ctx) { if (State != 99) { ctx.QueryFields["State"] = State; ctx.QueryFields.IndexOf("State").Operator = OperationType.EQUER; } }); }
/// <summary> /// Loads the specified request option. /// </summary> /// <param name="requestOption">The request option.</param> /// <param name="currencyDelegate">The currency delegate.</param> /// <returns></returns> public bool Load(UPRequestOption requestOption, ICurrencyConversionDelegate currencyDelegate) { if (this.CurrencyDelegate != null) { return(false); } this.CurrencyDelegate = currencyDelegate; IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore; SearchAndList searchAndList = configStore.SearchAndListByName(this.SearchAndListConfigName); UPConfigFilter filter = null; if (searchAndList != null) { filter = configStore.FilterByName(searchAndList.FilterName); } this.fieldControl = configStore.FieldControlByNameFromGroup("List", searchAndList.FieldGroupName); if (this.fieldControl != null) { this.crmQuery = new UPContainerMetaInfo(this.fieldControl, filter, null); } if (this.crmQuery == null) { this.CurrencyDelegate = null; this.crmQuery = null; currencyDelegate.CurrencyConversionDidFailWithError(this, new Exception($"invalid searchAndList configuration {this.SearchAndListConfigName}")); return(true); } this.crmQuery.Find(requestOption, this); return(true); }
public ViewEditItem(DataStructure dataStructure, DataItem dataItem, string label, bool enableExport) { originalDataItem = dataItem; copiedDataItem = ObjectCopier.Clone <DataItem>(dataItem); InitializeComponent(); ItemName.Content = label; ExportButton.Visibility = enableExport ? Visibility.Visible : Visibility.Collapsed; Dictionary <string, List <Field> > tabsDict = dataStructure.GetTabs(false); foreach (string tabName in tabsDict.Keys) { TabItem tabItem = new TabItem(); tabItem.Header = tabName; tabs.Items.Add(tabItem); ScrollViewer scroll = new ScrollViewer(); StackPanel sp = new StackPanel(); scroll.Content = sp; sp.Orientation = System.Windows.Controls.Orientation.Vertical; foreach (Field tabField in tabsDict[tabName]) { FieldControl userControl = tabField is ExternalDataStructureList?originalDataItem.GetField(tabField.Id).GenerateUIElement(true) : copiedDataItem.GetField(tabField.Id).GenerateUIElement(true); userControl.SetEditable(false); allUserControls.Add(userControl); sp.Children.Add(userControl); } tabItem.Content = scroll; } }
private void InitializeComponent() { Mtgdb.Controls.SearchOptions searchOptions1 = new Mtgdb.Controls.SearchOptions(); Mtgdb.Controls.ButtonOptions buttonOptions1 = new Mtgdb.Controls.ButtonOptions(); this._fieldImage = new Mtgdb.Controls.FieldControl(); this.SuspendLayout(); // // _fieldImage // this._fieldImage.DataText = ""; this._fieldImage.Dock = System.Windows.Forms.DockStyle.Fill; this._fieldImage.Location = new System.Drawing.Point(0, 0); this._fieldImage.Margin = new System.Windows.Forms.Padding(0); this._fieldImage.Name = "_fieldImage"; searchOptions1.Button = buttonOptions1; this._fieldImage.SearchOptions = searchOptions1; this._fieldImage.Size = new System.Drawing.Size(223, 311); this._fieldImage.TabIndex = 0; // // DeckLayout // this.Controls.Add(this._fieldImage); this.Name = "DeckLayout"; this.Size = new System.Drawing.Size(223, 311); this.ResumeLayout(false); }
/// <summary> /// Loads this instance. /// </summary> /// <returns></returns> public bool Load() { IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore; SearchAndList searchAndList = configStore.SearchAndListByName(this.SearchAndListConfigName); UPConfigFilter filter = null; if (searchAndList != null) { filter = configStore.FilterByName(searchAndList.FilterName); } if (searchAndList == null) { return(false); } this.fieldControl = configStore.FieldControlByNameFromGroup("List", searchAndList.FieldGroupName); if (this.fieldControl != null) { this.crmQuery = new UPContainerMetaInfo(this.fieldControl, filter, null); } if (this.crmQuery == null) { return(false); } var result = this.crmQuery.Find(); this.HandleResult(result); return(true); }
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { ContFieldInfo contFieldInfo = e.Item.DataItem as ContFieldInfo; FieldControl fieldControl = e.Item.FindControl("field") as FieldControl; if (fieldControl != null) { fieldControl.ControlType = (FieldType)contFieldInfo.FieldType; fieldControl.ControlPath = "~/Platform/h5/FieldControls/"; fieldControl.LoadControlId = ((FieldType)contFieldInfo.FieldType).ToString(); fieldControl.FieldName = contFieldInfo.FieldName; fieldControl.FieldAlias = contFieldInfo.Alias; fieldControl.Tips = contFieldInfo.Tip; fieldControl.FieldId = contFieldInfo.AutoID; fieldControl.Settings = XmlSerializerUtils.Deserialize <SinGooCMS.Control.FieldSetting>(contFieldInfo.Setting); fieldControl.DataLength = contFieldInfo.DataLength; fieldControl.EnableNull = contFieldInfo.EnableNull; if (!string.IsNullOrEmpty(contFieldInfo.Value)) { fieldControl.Value = contFieldInfo.Value; } else { fieldControl.Value = (contFieldInfo.DefaultValue ?? string.Empty); } if (!base.IsEdit && fieldControl.FieldName == "Sort") { fieldControl.Value = (SinGooCMS.BLL.Content.MaxSort + 1).ToString(); } } } }
/// <summary> /// Initializes a new instance of the <see cref="UPCharacteristicsGroupModelController"/> class. /// </summary> /// <param name="fieldControl">The field control.</param> /// <param name="tabIndex">Index of the tab.</param> /// <param name="theDelegate">The delegate.</param> public UPCharacteristicsGroupModelController(FieldControl fieldControl, int tabIndex, IGroupModelControllerDelegate theDelegate) : base(fieldControl, tabIndex, theDelegate) { var typeParts = this.TabConfig.Type.Split('_'); if (typeParts.Length > 1) { if (typeParts[0] == "CHARACTERISTICS") { this.CharacteristicsSearchAndListName = typeParts[1]; } else if (typeParts[0] == "CHARACTERISTICSCONTEXT") { this.CharacteristicsContext = typeParts[1]; } } else if (this.TabConfig.Fields.Count > 0) { this.CharacteristicsFieldControl = fieldControl.FieldControlWithSingleTab(tabIndex, this.TabConfig.Fields[0].InfoAreaId); } else { this.CharacteristicsSearchAndListName = "IT"; } }
private FieldControl getFieldDisplayControl(Field f) { FieldControl fc = getFieldControl(f, true); //fc.Mode = "Display"; return(fc); }
/// <summary> /// Initializes a new instance of the <see cref="UPSerialEntryParentInfoPanel"/> class. /// </summary> /// <param name="fieldControl">The field control.</param> /// <param name="resultRow">The result row.</param> public UPSerialEntryParentInfoPanel(FieldControl fieldControl, UPCRMResultRow resultRow) { int tabs = fieldControl.NumberOfTabs; List <UPSerialEntryParentInfoPanelCell> cells = new List <UPSerialEntryParentInfoPanelCell>(); for (int index = 0; index < tabs; index++) { FieldControlTab tabControl = fieldControl.TabAtIndex(index); if (tabControl.NumberOfFields > 0 && string.IsNullOrEmpty(tabControl.Type)) { UPSerialEntryParentInfoPanelCell cell = new UPSerialEntryParentInfoPanelCell(tabControl, resultRow); string ownImageName = fieldControl.ValueForAttribute($"ParentInfoImage{index}") ?? tabControl.ValueForAttribute("ParentInfoImage"); if (!string.IsNullOrEmpty(ownImageName)) { cell.ImageName = ownImageName; } int minFields = !string.IsNullOrEmpty(tabControl.Label) ? 1 : 0; if (cell.FieldValues.Count > minFields) { cells.Add(cell); } } } this.Cells = cells; }
private int DetermineFieldIdDocumentUploadViewReference(int fieldId, ViewReference documentUploadViewReference) { string configValue = documentUploadViewReference.ContextValueForKey("DocumentFieldFieldGroupName"); if (!string.IsNullOrEmpty(configValue)) { FieldControl fieldControl = ConfigurationUnitStore.DefaultStore.FieldControlByNameFromGroup("Edit", configValue); if (fieldControl.NumberOfFields > 0) { UPConfigFieldControlField field = fieldControl.FieldAtIndex(0); if (field != null) { fieldId = field.FieldId; } } } if (fieldId == -1) { configValue = documentUploadViewReference.ContextValueForKey("DocumentFieldId"); if (!string.IsNullOrEmpty(configValue)) { fieldId = Convert.ToInt32(configValue); } } return(fieldId); }
public static void Go(Field field, LearnManager lm, List <Agent> agents) { Console.WriteLine("START"); var ctrl = new FieldControl((IFieldWithCells)field); var form = new Form(); form.Controls.Add(ctrl); ctrl.Location = new System.Drawing.Point(10, 10); form.Size = new System.Drawing.Size(ctrl.Width + 40, ctrl.Height + 60); form.KeyPreview = true; form.KeyUp += (s, e) => { if (e.KeyCode == Keys.Right) { compute_fps = Math.Max(0, compute_fps - 10); } else if (e.KeyCode == Keys.Left) { compute_fps = Math.Min(300, compute_fps + 10); } else if (e.KeyCode == Keys.Space) { computePause = !computePause; } form.Text = $"{nameof(compute_fps)} = {1000 / Math.Max(double.Epsilon, compute_fps)}"; }; form.Text = $"{nameof(compute_fps)} = {1000 / Math.Max(double.Epsilon, compute_fps)}"; engine(agents, form, lm); Application.Run(form); }
/// <summary> /// Initializes a new instance of the <see cref="UPFieldControlBasedGroupModelController"/> class. /// </summary> /// <param name="fieldControl">The field control.</param> /// <param name="tabIndex">Index of the tab.</param> /// <param name="theDelegate">The delegate.</param> public UPFieldControlBasedGroupModelController(FieldControl fieldControl, int tabIndex, IGroupModelControllerDelegate theDelegate) : base(theDelegate) { this.FieldControlConfig = fieldControl; this.TabIndex = tabIndex; this.TabConfig = this.FieldControlConfig.TabAtIndex(tabIndex); }
protected void RepContentForm_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { FieldControl control = (FieldControl)e.Item.FindControl("Field"); FieldInfo dataItem = (FieldInfo)e.Item.DataItem; FieldType controlType = control.ControlType; if (controlType == FieldType.NodeType) { control.Value = this.m_NodeId.ToString(); } if (((control.FieldLevel == 0) && (dataItem.Id != "title")) && (dataItem.FieldType != FieldType.SpecialType)) { control.FindControl("EasyOne2007").Visible = false; } if (controlType == FieldType.ContentType) { ((ContentType)control.FindControl("EasyOne2007")).IsUpload = true; } if (control.Visible) { this.m_FieldInput = true; } } }
/// <summary> /// Builds the page. /// </summary> protected override void BuildPage() { base.BuildPage(); this.ConfigName = this.ViewReference.ContextValueForKey("RootNodeConfigName"); UPMCircleOfInfluencePage page = this.CreatePageInstance(); string rootNodeFieldGroup = null; IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore; if (!string.IsNullOrEmpty(this.ConfigName)) { SearchAndList searchAndList = configStore.SearchAndListByName(this.ConfigName); rootNodeFieldGroup = searchAndList.FieldGroupName; } if (string.IsNullOrEmpty(rootNodeFieldGroup)) { rootNodeFieldGroup = this.ViewReference.ContextValueForKey("RootNodeFieldGroup"); } FieldControl details = configStore.FieldControlByNameFromGroup("Details", rootNodeFieldGroup); FieldControl miniDetails = configStore.FieldControlByNameFromGroup("MiniDetails", rootNodeFieldGroup); this.rootNodeFieldControl = new FieldControl(new List <FieldControl> { details, miniDetails }); this.ApplyViewConfigOnPage(page); this.ApplyLoadingStatusOnPage(page); page.Invalid = true; this.TopLevelElement = page; }
/// <summary> /// Files the name for document. /// </summary> /// <param name="urlCache"> /// The URL cache. /// </param> /// <returns> /// file name /// </returns> public string FileNameForDocument(UPSyncDocumentDownloadUrlCache urlCache) { UPCRMResultRow row; if (urlCache != null) { var fieldGroupCache = urlCache.FieldGroupUrlCacheForFieldGroup(this.FieldGroupName); row = fieldGroupCache.RowForRecordIdentification(this.RecordIdentification); } else { FieldControl fieldControl = ConfigurationUnitStore.DefaultStore.FieldControlByNameFromGroup("List", this.FieldGroupName); if (fieldControl == null) { return(null); } var crmQuery = new UPContainerMetaInfo(fieldControl); var result = crmQuery.ReadRecord(this.RecordIdentification); if (result.RowCount == 0) { return(null); } row = (UPCRMResultRow)result.ResultRowAtIndex(0); } // FUNCTION NAME "Title" return(row.ValueAtIndex(1)); }
/// <summary> /// Builds the page. /// </summary> protected virtual void BuildPage() { this.RecordIdentification = this.ViewReference.ContextValueForKey("RecordId"); string linkIdStr = this.ViewReference.ContextValueForKey("LinkId"); if (!string.IsNullOrEmpty(linkIdStr)) { this.LinkId = Convert.ToInt32(linkIdStr); } else { this.LinkId = -1; } this.AppearanceJScriptString = this.ViewReference.ContextValueForKey("AppearanceJScript"); this.DisappearanceJScriptString = this.ViewReference.ContextValueForKey("DisappearanceJScript"); FieldControl copySourceFieldControl = null; string copySourceFieldGroupName = this.ViewReference.ContextValueForKey("CopySourceFieldGroupName"); if (!string.IsNullOrEmpty(copySourceFieldGroupName)) { copySourceFieldControl = ConfigurationUnitStore.DefaultStore.FieldControlByNameFromGroup("List", copySourceFieldGroupName); } if (copySourceFieldControl != null) { this.copyFields = new UPCopyFields(copySourceFieldControl); this.copyFields.CopyFieldValuesForRecordIdentification(this.RecordIdentification, false, this); } else { this.ContinueBuildPageWithParameters(null); } }
/// <summary> /// Initializes a new instance of the <see cref="ContactTimesGroupModelController"/> class. /// </summary> /// <param name="fieldControl">Field Control</param> /// <param name="tabIndex">Tab Index</param> /// <param name="controllerDelegate">Controller Delegate</param> public ContactTimesGroupModelController(FieldControl fieldControl, int tabIndex, IGroupModelControllerDelegate controllerDelegate) : base(fieldControl, tabIndex, controllerDelegate) { var typeParts = this.TabConfig.Type.Split('_'); this.linkId = -1; if (typeParts?.Length > 1) { this.searchAndListConfigurationName = typeParts[1]; } if (this.searchAndListConfigurationName.Length == 0) { this.searchAndListConfigurationName = "U001"; } var configStore = ConfigurationUnitStore.DefaultStore; this.searchAndList = configStore.SearchAndListByName(this.searchAndListConfigurationName); if (this.searchAndList != null) { this.infoAreaid = this.searchAndList.InfoAreaId; this.fieldControl = configStore.FieldControlByNameFromGroup("List", this.searchAndList.FieldGroupName); } else { this.fieldControl = configStore.FieldControlByNameFromGroup("List", this.searchAndListConfigurationName); } }
protected override void InitModelData() { PanelContext.Row.Clear(); foreach (Group group in PanelContext.Panel.EditInfo.Groups) { foreach (We7Control ctr in group.Controls) { FieldControl fc = UIHelper.GetControl(ctr.ID, this) as FieldControl; if (fc != null) { object o = fc.GetValue(); if (o is IDictionary <string, object> ) { IDictionary <string, object> dic = o as IDictionary <string, object>; foreach (string key in dic.Keys) { PanelContext.Row[key] = dic[key]; } } else { PanelContext.Row[ctr.Name] = o; } } else { PanelContext.Row[ctr.Name] = null; } } ProcessAllDataColumns(PanelContext); } InitDataKeyValus(); }
public void TestNewFieldControlItem() { FieldControl fc = new FieldControl(); FieldControlItem item = fc.NewFieldControlItem("text"); Assert.IsInstanceOf(typeof(FieldControlTextItem), item); item = fc.NewFieldControlItem("datetime"); Assert.IsInstanceOf(typeof(FieldControlDateItem), item); item = fc.NewFieldControlItem("choice"); Assert.IsInstanceOf(typeof(FieldControlChoiceItem), item); item = fc.NewFieldControlItem("multichoice"); Assert.IsInstanceOf(typeof(FieldControlMultiChoiceItem), item); item = fc.NewFieldControlItem("note"); Assert.IsInstanceOf(typeof(FieldControlNoteItem), item); item = fc.NewFieldControlItem("user"); Assert.IsInstanceOf(typeof(FieldControlUserItem), item); item = fc.NewFieldControlItem("currency"); Assert.IsInstanceOfType(typeof(FieldControlCurrencyItem), item); item = fc.NewFieldControlItem("number"); Assert.IsInstanceOfType(typeof(FieldControlNumberItem), item); }
/// <summary> /// 创建行控件 /// </summary> /// <param name="field">字段信息</param> /// <returns>行控件</returns> protected Control CreateItem(We7Control control) { HtmlTableRow row = new HtmlTableRow(); HtmlTableCell c = new HtmlTableCell(); c.InnerHtml = control.Label + ":"; c.Attributes["class"] = "formTitle"; row.Cells.Add(c); c = new HtmlTableCell(); c.Attributes["class"] = "formValue"; FieldControl fc = UIHelper.GetControl(control); fc.IsEdit = IsEdit; c.Controls.Add(fc); Literal ltlMsg = new Literal(); ltlMsg.Text = control.Desc; c.Controls.Add(ltlMsg); row.Cells.Add(c); row.Style.Add("display", control.Visible ? "" : "none"); return(row); }
/// <summary> /// Initializes a new instance of the <see cref="IPAddressControl" /> class. /// </summary> public IPAddressControl() { for (int i = 0; i < _fieldCount; i++) { _fieldControls[i] = new FieldControl(i); _fieldControls[i].CreateControl(); Controls.Add(_fieldControls[i]); _fieldControls[i].CedeFocus += OnCedeFocus; _fieldControls[i].TextChanged += (s, e) => OnTextChanged(e); if (i < _fieldCount - 1) { _dotControls[i] = new DotControl(); _dotControls[i].CreateControl(); Controls.Add(_dotControls[i]); } } SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.ContainerControl, true); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.UserPaint, true); BackColor = SystemColors.Window; Cursor = Cursors.IBeam; Size = MinimumSize; _referenceTextBox.AutoSize = true; }
/// <summary> /// Initializes a new instance of the <see cref="DocumentInfoAreaManager"/> class. /// Creates a new instance of <see cref="DocumentInfoAreaManager"/> /// </summary> /// <param name="infoAreaId"> /// InfoArea Id /// </param> /// <param name="fieldControl"> /// Field Control object /// </param> /// <param name="recordIndex"> /// Index of record /// </param> /// <param name="documentManager"> /// Document manager /// </param> public DocumentInfoAreaManager( string infoAreaId, FieldControl fieldControl, int recordIndex, DocumentManager documentManager) { this.InfoAreaId = infoAreaId; this.DocumentManager = documentManager; this.FieldControl = fieldControl; var functionForFields = this.FieldControl.FunctionNames(); this.ResultIndexOfDate = this.ResultPositionOfField(functionForFields.ValueOrDefault("Date"), 3, fieldControl); this.ResultIndexOfLength = this.ResultPositionOfField(functionForFields.ValueOrDefault("Length"), 2, fieldControl); this.ResultIndexOfMimeType = this.ResultPositionOfField(functionForFields.ValueOrDefault("MIMEType"), 0, fieldControl); this.ResultIndexOfTitle = this.ResultPositionOfField(functionForFields.ValueOrDefault("Title"), 1, fieldControl); this.ResultIndexOfDisplayText = this.ResultPositionOfField( functionForFields.ValueOrDefault("DisplayText"), -1, fieldControl); this.ResultIndexOfDisplayDate = this.ResultPositionOfField( functionForFields.ValueOrDefault("DisplayDate"), -1, fieldControl); this.ResultIndexOfUpdDate = this.ResultPositionOfField(functionForFields.ValueOrDefault("UpdDate"), 5, fieldControl); this.ResultIndexOfUpdTime = this.ResultPositionOfField(functionForFields.ValueOrDefault("UpdTime"), 6, fieldControl); this.RecordIndex = recordIndex; }
/// <summary> /// 取得同一界面中的关联值 /// </summary> /// <param name="ctrID"></param> /// <returns></returns> protected object GetRelationValue(string ctrID) { UIHelper UIHelper = new UIHelper(this.Page); FieldControl ctr = UIHelper.GetControl(ctrID, Page) as FieldControl; return(ctr != null?ctr.GetValue() : null); }
private void LoadConfigFieldControlForFieldGroup(string fieldGroup) { IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore; SearchAndList searchAndListConfig = configStore.SearchAndListByName(fieldGroup); FieldControl configFieldControl; UPConfigFilter configFilter = null; if (searchAndListConfig != null) { configFieldControl = configStore.FieldControlByNameFromGroup("List", fieldGroup); if (!string.IsNullOrEmpty(searchAndListConfig.FilterName)) { configFilter = configStore.FilterByName(searchAndListConfig.FilterName); } } else { configFieldControl = configStore.FieldControlByNameFromGroup("List", fieldGroup); } if (configFieldControl != null) { this.fieldControl = configFieldControl; } if (configFilter != null) { this.filter = configFilter; } }
/// <summary> /// Initializes a new instance of the <see cref="DocumentInfoAreaManager"/> class. /// Creates a new instance of <see cref="DocumentInfoAreaManager"/> /// </summary> /// <param name="infoAreaId"> /// InfoArea Id /// </param> /// <param name="fieldControl"> /// Field Control object /// </param> /// <param name="documentManager"> /// Document manager /// </param> public DocumentInfoAreaManager( string infoAreaId, FieldControl fieldControl, DocumentManager documentManager) : this(infoAreaId, fieldControl, 0, documentManager) { }
void Start() { herdController = GameObject.Find("HerdController").GetComponent <HerdController>(); fieldControl = GameObject.Find("FieldController").GetComponent <FieldControl>(); field = null; eat = false; }
protected void btnSave_Click(object sender, EventArgs e) { DataRow row = null; if (!IsEdit) { row = Data.NewRow(); Data.Rows.Add(row); } else { DataRow[] drs = Data.Select("ID='" + hfID.Value + "'"); row = drs[0]; } foreach (We7Control ctr in EditorContext.Panel.EditInfo.Controls) { if (IsEdit && ctr.ID == "ID") { continue; } FieldControl fc = FindControl(ctr.Name); if (fc != null) { row[ctr.Name] = fc.GetValue(); } } }
/// <summary> /// 创建行控件 /// </summary> /// <param name="field">字段信息</param> /// <returns>行控件</returns> protected Control CreateItem(We7Control control) { HtmlTableRow row = new HtmlTableRow(); HtmlTableCell c = new HtmlTableCell("TH"); HtmlGenericControl lable = new HtmlGenericControl("strong"); lable.InnerHtml = control.Label + ":"; c.Controls.Add(lable); row.Cells.Add(c); c = new HtmlTableCell(); We7Control ctr = control.Clone() as We7Control; if (!EnableControls.Contains(ctr.Type)) { ctr.Type = "Text"; } FieldControl fc = UIHelper.GetControl(ctr); fc.IsEdit = IsEdit; c.Controls.Add(fc); row.Cells.Add(c); row.Style.Add("display", control.Visible ? "" : "none"); return(row); }
/// <inheritDocs/> public void Configure(FieldControl backendControl, IFormFieldController<IFormFieldModel> formFieldController) { var checkboxesFieldModel = (ICheckboxesFieldModel)formFieldController.Model; var choices = checkboxesFieldModel.DeserializeChoices(); var checkboxesControl = (FormCheckboxes)backendControl; checkboxesControl.Choices.Clear(); foreach (var choice in choices) { checkboxesControl.Choices.Add(new Web.UI.Fields.ChoiceItem() { Text = choice, Value = choice }); } }
/// <inheritDocs/> public void Configure(ref FieldControl backendControl, IFormFieldController<IFormFieldModel> formFieldController) { var dropdownListFieldModel = formFieldController.Model as IDropdownListFieldModel; var choices = dropdownListFieldModel.DeserializeChoices(); var dropDownList = (FormDropDownList)backendControl; dropDownList.Choices.Clear(); foreach (var choice in choices) { dropDownList.Choices.Add(new Web.UI.Fields.ChoiceItem() { Text = choice, Value = choice }); } }
/// <summary> /// 增加 /// </summary> /// <param name="FieldControl">FieldControl实体对象</param> /// <returns>int值,返回自增ID</returns> public int addReturnId(FieldControl model) { SqlParameter[] param = new SqlParameter[] { new SqlParameter ("@Menu_Id",model.Menu_Id), new SqlParameter ("@FieldControl_Name",model.FieldControl_Name), new SqlParameter ("@FieldControl_DataPKValue",model.FieldControl_DataPKValue), new SqlParameter ("@FieldControl_Onclick",model.FieldControl_Onclick), new SqlParameter ("@FieldControl_Order",model.FieldControl_Order), new SqlParameter ("@FieldControl_Css",model.FieldControl_Css) }; return Convert.ToInt32(Helper.ExecuteScalar ("FieldControl_AddReturnId",param)); }
/// <summary> /// 增加 /// </summary> /// <param name="FieldControl">FieldControl实体对象</param> /// <returns>bool值,判断是否操作成功</returns> public bool add(FieldControl model) { SqlParameter[] param = new SqlParameter[] { new SqlParameter ("@Menu_Id",model.Menu_Id), new SqlParameter ("@FieldControl_Name",model.FieldControl_Name), new SqlParameter ("@FieldControl_DataPKValue",model.FieldControl_DataPKValue), new SqlParameter ("@FieldControl_Onclick",model.FieldControl_Onclick), new SqlParameter ("@FieldControl_Order",model.FieldControl_Order), new SqlParameter ("@FieldControl_Css",model.FieldControl_Css) }; return Helper.ExecuteNonQuery("FieldControl_Add",param); }
/// <inheritDocs/> public void Configure(ref FieldControl backendControl, IFormFieldController<IFormFieldModel> formFieldController) { var multipleChoiceFieldModel = (IMultipleChoiceFieldModel)formFieldController.Model; var choices = multipleChoiceFieldModel.DeserializeChoices(); var choiceFieldControl = (FormMultipleChoice)backendControl; choiceFieldControl.Choices.Clear(); foreach (var choice in choices) { choiceFieldControl.Choices.Add(new Web.UI.Fields.ChoiceItem() { Text = choice, Value = choice }); } choiceFieldControl.EnableAddOther = multipleChoiceFieldModel.HasOtherChoice; }
/// <inheritDocs/> public void Configure(ref FieldControl backendControl, IFormFieldController<IFormFieldModel> formFieldController) { var checkboxesFieldModel = (ICheckboxesFieldModel)formFieldController.Model; if (checkboxesFieldModel.HasOtherChoice) { backendControl = new FormTextBox(); backendControl.ValidatorDefinition = checkboxesFieldModel.ValidatorDefinition; backendControl.Title = checkboxesFieldModel.MetaField.Title; ((IFormFieldControl)backendControl).MetaField = checkboxesFieldModel.MetaField; } else { var choices = checkboxesFieldModel.DeserializeChoices(); var checkboxesControl = (FormCheckboxes)backendControl; checkboxesControl.Choices.Clear(); foreach (var choice in choices) { checkboxesControl.Choices.Add(new Web.UI.Fields.ChoiceItem() { Text = choice, Value = choice }); } } }
/// <summary> /// 通过条件查询 /// </summary> /// <param name="WhereString">查询条件</param> /// <returns>FieldControl实体类对象</returns> public List<FieldControl> selectByWhere(string WhereString) { SqlParameter[] param = new SqlParameter[] { new SqlParameter ("@where",WhereString) }; List<FieldControl> list = new List<FieldControl>(); FieldControl model = null; using (SqlDataReader dr = Helper.ExecuteReader("FieldControl_SelectByWhere", param)) { while (dr.Read()) { model = new FieldControl(); model.FieldControl_ID = dr["FieldControl_ID"].ToString(); if (DBNull.Value!=dr["Menu_Id"]) model.Menu_Id = dr["Menu_Id"].ToString(); if (DBNull.Value!=dr["FieldControl_Name"]) model.FieldControl_Name = dr["FieldControl_Name"].ToString(); if (DBNull.Value!=dr["FieldControl_DataPKValue"]) model.FieldControl_DataPKValue = dr["FieldControl_DataPKValue"].ToString(); if (DBNull.Value!=dr["FieldControl_Onclick"]) model.FieldControl_Onclick = dr["FieldControl_Onclick"].ToString(); if (DBNull.Value!=dr["FieldControl_Order"]) model.FieldControl_Order = dr["FieldControl_Order"].ToString(); if (DBNull.Value!=dr["FieldControl_Css"]) model.FieldControl_Css = dr["FieldControl_Css"].ToString(); list.Add(model); } } return list; }
/// <summary> /// 查看全部 /// </summary> /// <returns>list集合</returns> public List<FieldControl> selectAll() { List<FieldControl> list = new List<FieldControl>(); FieldControl model = null; using (SqlDataReader dr = Helper.ExecuteReader("FieldControl_SelectAll", null)) { while (dr.Read()) { model = new FieldControl(); model.FieldControl_ID = dr["FieldControl_ID"].ToString(); if (DBNull.Value!=dr["Menu_Id"]) model.Menu_Id = dr["Menu_Id"].ToString(); if (DBNull.Value!=dr["FieldControl_Name"]) model.FieldControl_Name = dr["FieldControl_Name"].ToString(); if (DBNull.Value!=dr["FieldControl_DataPKValue"]) model.FieldControl_DataPKValue = dr["FieldControl_DataPKValue"].ToString(); if (DBNull.Value!=dr["FieldControl_Onclick"]) model.FieldControl_Onclick = dr["FieldControl_Onclick"].ToString(); if (DBNull.Value!=dr["FieldControl_Order"]) model.FieldControl_Order = dr["FieldControl_Order"].ToString(); if (DBNull.Value!=dr["FieldControl_Css"]) model.FieldControl_Css = dr["FieldControl_Css"].ToString(); list.Add(model); } } return list; }
/// <inheritDocs/> public void Configure(ref FieldControl backendControl, IFormFieldController<IFormFieldModel> formFieldController) { backendControl.GetType().GetProperty("FormId").SetValue(backendControl, this.FormId); backendControl.GetType().GetProperty("FormsProviderName").SetValue(backendControl, FormsManager.GetDefaultProviderName()); backendControl.GetType().GetProperty("AllowMultipleAttachments").SetValue(backendControl, ((IFileFieldModel)formFieldController.Model).AllowMultipleFiles); }
/// <summary> /// 通过Id查询 /// </summary> /// <param name="Id">主键Id</param> /// <returns>FieldControl实体类对象</returns> public FieldControl selectById(int Id) { SqlParameter[] param = new SqlParameter[] { new SqlParameter ("@FieldControl_ID",Id) }; FieldControl model = new FieldControl(); using (SqlDataReader dr = Helper.ExecuteReader("FieldControl_SelectById", param)) { if (dr.Read()) { model.FieldControl_ID = dr["FieldControl_ID"].ToString(); if (DBNull.Value!=dr["Menu_Id"]) model.Menu_Id = dr["Menu_Id"].ToString(); if (DBNull.Value!=dr["FieldControl_Name"]) model.FieldControl_Name = dr["FieldControl_Name"].ToString(); if (DBNull.Value!=dr["FieldControl_DataPKValue"]) model.FieldControl_DataPKValue = dr["FieldControl_DataPKValue"].ToString(); if (DBNull.Value!=dr["FieldControl_Onclick"]) model.FieldControl_Onclick = dr["FieldControl_Onclick"].ToString(); if (DBNull.Value!=dr["FieldControl_Order"]) model.FieldControl_Order = dr["FieldControl_Order"].ToString(); if (DBNull.Value!=dr["FieldControl_Css"]) model.FieldControl_Css = dr["FieldControl_Css"].ToString(); } } return model; }