/// <summary> /// Binds the values. /// </summary> private void BindValues() { FormLabel lbl = null; foreach (FormLabel temp in FormItemData.Labels) { if (temp.Code.ToLower().Equals(Thread.CurrentThread.CurrentUICulture.Name.ToLower())) { lbl = temp; } } if (lbl != null) { if (lbl.Title == "[MC_DefaultLabel]" || !FormItemData.ShowLabel) { MetaClass temp = MetaDataWrapper.GetMetaClassByName(FormDocumentData.MetaClassName); if (!temp.Fields.Contains(FormItemData.Control.Source)) { temp = temp.CardOwner; } txtTitle.Text = CHelper.GetResFileString(temp.Fields[FormItemData.Control.Source].FriendlyName) + ":"; } else { txtTitle.Text = lbl.Title; } if (lbl.Title == "[MC_DefaultLabel]") { rbDefault.Checked = true; } } if (!rbDefault.Checked) { if (FormItemData.ShowLabel) { rbCustom.Checked = true; } else { rbNone.Checked = true; } } this.Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString("N"), String.Format("ModifyTxt({0});", rbCustom.Checked ? "1" : "0"), true); txtLabelWidth.Text = Unit.Parse(FormItemData.LabelWidth).Value.ToString(); ddRows.SelectedValue = FormItemData.RowSpan.ToString(); switch (FormItemData.ColSpan) { case 1: rb1.Checked = true; break; case 2: rb2.Checked = true; break; default: rb1.Disabled = true; rb2.Disabled = true; rb1.Checked = false; break; } FormController fc = new FormController(FormDocumentData); if (!fc.CanChangeColspan(FormItemData)) { rb1.Disabled = true; rb2.Disabled = true; } lblControl.Text = String.Format("<{0}>", GetGlobalResourceObject("MetaForm", "NoControl").ToString()); if (FormItemData.Control != null && !String.IsNullOrEmpty(FormItemData.Control.Type)) { lblControl.Text = CHelper.GetResFileString(String.Format("{{MetaForm:{0}}}", FormItemData.Control.Type)); } BindPropertiesControl(FormItemData.Control == null ? "" : FormItemData.Control.Type); }
private void BindValues() { FormLabel lbl = null; foreach (FormLabel temp in FormItemData.Labels) { if (temp.Code.ToLower().Equals(Thread.CurrentThread.CurrentUICulture.Name.ToLower())) { lbl = temp; } } if (lbl != null) { if (lbl.Title == "[MC_DefaultLabel]" || !FormItemData.ShowLabel) { #region Define Classes & Fields string ownName = FormItemData.Control.Source; string aggrName = String.Empty; MetaField fieldOwn = null; MetaClass classOwn = MetaDataWrapper.GetMetaClassByName(FormDocumentData.MetaClassName); MetaField fieldAggr = null; MetaClass classAggr = null; if (ownName.Contains(".")) //aggregation { string[] mas = ownName.Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries); ownName = mas[0]; aggrName = mas[1]; if (!classOwn.Fields.Contains(ownName)) { classOwn = classOwn.CardOwner; } fieldOwn = classOwn.Fields[ownName]; if (fieldOwn.IsAggregation) { string aggrClassName = fieldOwn.Attributes[McDataTypeAttribute.AggregationMetaClassName].ToString(); classAggr = MetaDataWrapper.GetMetaClassByName(aggrClassName); if (!classAggr.Fields.Contains(aggrName)) { classAggr = classAggr.CardOwner; } fieldAggr = classAggr.Fields[aggrName]; } } else { if (!classOwn.Fields.Contains(ownName)) { classOwn = classOwn.CardOwner; } fieldOwn = classOwn.Fields[ownName]; } #endregion string text = String.Empty; if (fieldAggr != null) { text = String.Format("{0} - {1}", CHelper.GetResFileString(fieldOwn.FriendlyName), CHelper.GetResFileString(fieldAggr.FriendlyName) ); } else { text = CHelper.GetResFileString(fieldOwn.FriendlyName); } txtTitle.Text = CHelper.GetResFileString(text) + ":"; } else { txtTitle.Text = lbl.Title; } if (lbl.Title == "[MC_DefaultLabel]") { rbDefault.Checked = true; } } if (!rbDefault.Checked) { if (FormItemData.ShowLabel) { rbCustom.Checked = true; } else { rbNone.Checked = true; } } this.Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString("N"), String.Format("ModifyTxt({0});", rbCustom.Checked ? "1" : "0"), true); txtLabelWidth.Text = Unit.Parse(FormItemData.LabelWidth).Value.ToString(); TabIndexText.Text = FormItemData.TabIndex.ToString(); ddRows.SelectedValue = FormItemData.RowSpan.ToString(); switch (FormItemData.ColSpan) { case 1: rb1.Checked = true; break; case 2: rb2.Checked = true; break; default: rb1.Disabled = true; rb2.Disabled = true; rb1.Checked = false; break; } FormController fc = new FormController(FormDocumentData); if (!fc.CanChangeColspan(FormItemData)) { rb1.Disabled = true; rb2.Disabled = true; } lblControl.Text = String.Format("<{0}>", GetGlobalResourceObject("IbnFramework.MetaForm", "NoControl").ToString()); if (FormItemData.Control != null && !String.IsNullOrEmpty(FormItemData.Control.Type)) { lblControl.Text = CHelper.GetResFileString(String.Format("{{IbnFramework.MetaForm:{0}}}", FormItemData.Control.Type)); } BindPropertiesControl(FormItemData.Control == null ? "" : FormItemData.Control.Type); }
private void BindValues() { FormLabel lbl = null; foreach (FormLabel temp in FormItemData.Labels) if (temp.Code.ToLower().Equals(Thread.CurrentThread.CurrentUICulture.Name.ToLower())) lbl = temp; if (lbl != null) { if (lbl.Title == "[MC_DefaultLabel]" || !FormItemData.ShowLabel) { #region Define Classes & Fields string ownName = FormItemData.Control.Source; string aggrName = String.Empty; MetaField fieldOwn = null; MetaClass classOwn = MetaDataWrapper.GetMetaClassByName(FormDocumentData.MetaClassName); MetaField fieldAggr = null; MetaClass classAggr = null; if (ownName.Contains(".")) //aggregation { string[] mas = ownName.Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries); ownName = mas[0]; aggrName = mas[1]; if (!classOwn.Fields.Contains(ownName)) classOwn = classOwn.CardOwner; fieldOwn = classOwn.Fields[ownName]; if (fieldOwn.IsAggregation) { string aggrClassName = fieldOwn.Attributes[McDataTypeAttribute.AggregationMetaClassName].ToString(); classAggr = MetaDataWrapper.GetMetaClassByName(aggrClassName); if (!classAggr.Fields.Contains(aggrName)) classAggr = classAggr.CardOwner; fieldAggr = classAggr.Fields[aggrName]; } } else { if (!classOwn.Fields.Contains(ownName)) classOwn = classOwn.CardOwner; fieldOwn = classOwn.Fields[ownName]; } #endregion string text = String.Empty; if (fieldAggr != null) text = String.Format("{0} - {1}", CHelper.GetResFileString(fieldOwn.FriendlyName), CHelper.GetResFileString(fieldAggr.FriendlyName) ); else text = CHelper.GetResFileString(fieldOwn.FriendlyName); txtTitle.Text = CHelper.GetResFileString(text) + ":"; } else txtTitle.Text = lbl.Title; if (lbl.Title == "[MC_DefaultLabel]") rbDefault.Checked = true; } if (!rbDefault.Checked) { if (FormItemData.ShowLabel) rbCustom.Checked = true; else rbNone.Checked = true; } this.Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString("N"), String.Format("ModifyTxt({0});", rbCustom.Checked ? "1" : "0"), true); txtLabelWidth.Text = Unit.Parse(FormItemData.LabelWidth).Value.ToString(); TabIndexText.Text = FormItemData.TabIndex.ToString(); ddRows.SelectedValue = FormItemData.RowSpan.ToString(); switch (FormItemData.ColSpan) { case 1: rb1.Checked = true; break; case 2: rb2.Checked = true; break; default: rb1.Disabled = true; rb2.Disabled = true; rb1.Checked = false; break; } FormController fc = new FormController(FormDocumentData); if (!fc.CanChangeColspan(FormItemData)) { rb1.Disabled = true; rb2.Disabled = true; } lblControl.Text = String.Format("<{0}>", GetGlobalResourceObject("IbnFramework.MetaForm", "NoControl").ToString()); if (FormItemData.Control != null && !String.IsNullOrEmpty(FormItemData.Control.Type)) lblControl.Text = CHelper.GetResFileString(String.Format("{{IbnFramework.MetaForm:{0}}}", FormItemData.Control.Type)); BindPropertiesControl(FormItemData.Control == null ? "" : FormItemData.Control.Type); }