private void CreateControls() { this.lblPaymentType = new FormLabel(0, "lblPaymentType", false, "lbl_payment_type"); this.lblPaymentAmount = new FormLabel(1, "lblPaymentAmount", false, "lbl_payment_amount"); this.tlpMain.Controls.Add(this.lblPaymentType, 0, 0); this.tlpMain.Controls.Add(this.lblPaymentAmount, 0, 1); }
private void CreateControls() { this.lblTourType = new FormLabel(0, "lblTourType", false, "lbl_tour_type"); this.lblBasePrice = new FormLabel(1, "lblBasePrice", false, "lbl_price"); this.tlpMain.Controls.Add(this.lblTourType, 0, 0); this.tlpMain.Controls.Add(this.lblBasePrice, 0, 1); }
public virtual void Visit(FormLabel formLabel, HtmlContainer htmlContainer) { HtmlDiv htmlDiv = verbose ? new HtmlDiv(formLabel.Path) : new HtmlDiv(); htmlDiv.Class.Add("formLabel"); if (!string.IsNullOrWhiteSpace(formLabel.CssClass)) { htmlDiv.Class.AddRange(formLabel.CssClass.Split(' ').Where(s => s != string.Empty)); } if (!string.IsNullOrWhiteSpace(formLabel.Path)) { htmlDiv.Class.Add(string.Format("{0}{1}", "formId", formLabel.Path)); } htmlDiv.Hidden.Value = formLabel.IsHidden; htmlContainer.Add(htmlDiv); HtmlLabel htmlLabel = new HtmlLabel(verbose ? formLabel.Path : ""); htmlDiv.Add(htmlLabel); htmlLabel.Add(new HtmlText(formLabel.Content)); }
private void CreateControls() { this.lblRoleName = new FormLabel(0, "lblRoleName", true, "role_name"); this.lblLanguage = new FormLabel(1, "lblLanguage", true, "language"); this.lblName = new FormLabel(2, "lblName", true, "name"); this.lblIsEnabled = new FormLabel(3, "lblIsEnabled", true, "select_user"); this.lblUsers = new ToolbarLabel(4, "lblUsers", "users"); this.lblDetails = new ToolbarLabel(5, "lblDetails", "details"); this.btnAddUser = new FlatButton(6, "btnAdd", "add", "add"); this.btnEditUser = new FlatButton(7, "btnEdit", "pencil", "edit"); this.btnDeleteUser = new FlatButton(8, "btnDelete", "delete", "delete"); this.btnEnableUser = new FlatButton(9, "disable", "closed_lock", "disable"); this.tlpButtons.Controls.Add(this.btnAddUser, 1, 0); this.tlpButtons.Controls.Add(this.btnEditUser, 2, 0); this.tlpButtons.Controls.Add(this.btnDeleteUser, 3, 0); this.tlpButtons.Controls.Add(this.btnEnableUser, 4, 0); this.tlpDetails.Controls.Add(this.lblRoleName, 0, 3); this.tlpDetails.Controls.Add(this.lblLanguage, 0, 2); this.tlpDetails.Controls.Add(this.lblName, 0, 1); this.tlpDetails.Controls.Add(this.lblIsEnabled, 0, 0); this.tlpButtons.Controls.Add(this.lblUsers, 0, 0); this.tlpMain.Controls.Add(this.lblDetails, 1, 0); this.lblIsEnabled.ForeColor = Color.Red; }
private void BindValues() { FormLabel lbl = null; foreach (FormLabel temp in FormSectionData.Labels) { if (temp.Code.ToLower().Equals(Thread.CurrentThread.CurrentUICulture.Name.ToLower())) { lbl = temp; } } if (lbl != null) { txtTitle.Text = lbl.Title; } cbShowBorder.Checked = (FormSectionData.BorderType > 0); cbShowTitle.Checked = FormSectionData.ShowLabel; lblControl.Text = String.Format("<{0}>", GetGlobalResourceObject("IbnFramework.MetaForm", "NoControl").ToString()); if (FormSectionData.Control != null && !String.IsNullOrEmpty(FormSectionData.Control.Type)) { lblControl.Text = CHelper.GetResFileString(String.Format("{{IbnFramework.MetaForm:{0}}}", FormSectionData.Control.Type)); } BindPropertiesControl(FormSectionData.Control == null ? "" : FormSectionData.Control.Type); }
private void CreateControls() { // // lblAppName // this.lblAppName = new System.Windows.Forms.Label(); this.lblAppName.AutoSize = true; this.lblAppName.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblAppName.Location = new System.Drawing.Point(3, 216); this.lblAppName.Name = "lblAppName"; this.lblAppName.Size = new System.Drawing.Size(194, 39); this.lblAppName.TabIndex = 4; this.lblAppName.Text = "Settlement"; // this.lblRegistrationCaption = new FormLabel(1, "lblRegistrationCaption", true, ""); this.lblCopyright = new FormLabel(2, "lblCopyright", true, ""); this.lblSupportCaption = new FormLabel(3, "lblSupportCaption", true, ""); this.lblUpdateStateCaption = new FormLabel(4, "lblUpdateStateCaption", true, ""); this.lblVersionCaption = new FormLabel(5, "lblVersionCaption", true, ""); this.lblLastUpdateCheckCaption = new FormLabel(6, "lblLastUpdateCheckCaption", true, ""); this.tlpUpdates.Controls.Add(this.lblVersionCaption, 0, 1); this.tlpUpdates.Controls.Add(this.lblLastUpdateCheckCaption, 0, 3); this.tlpControls.Controls.Add(this.lblAppName, 0, 0); this.tlpUpdates.Controls.Add(this.lblUpdateStateCaption, 0, 4); this.tableLayoutPanel1.Controls.Add(this.lblSupportCaption, 0, 1); this.tableLayoutPanel1.Controls.Add(this.lblRegistrationCaption, 0, 0); this.tableLayoutPanel1.Controls.Add(this.lblCopyright, 2, 1); this.tlpMain.BackColor = System.Drawing.Color.White; }
public FrmUserEditor(Entities.User user = null) { InitializeComponent(); this.lblName = new FormLabel(0, "lblName", true, "username"); this.lblLanguage = new FormLabel(2, "lblLanguage", true, "language"); this.lblPassword = new FormLabel(4, "lblPassword", true, "password"); this.lblRole = new FormLabel(6, "lblRole", true, "role_name"); this.tlpMain.Controls.Add(this.lblName, 0, 2); this.tlpMain.Controls.Add(this.lblPassword, 0, 3); this.tlpMain.Controls.Add(this.lblLanguage, 0, 4); this.tlpMain.Controls.Add(this.lblRole, 0, 5); this.tlpMain.BackColor = System.Drawing.Color.White; if (user == null) { this.user = new Entities.User(); } else { this.editUser = user; this.user = user.Clone(); } this.Load += new EventHandler(FrmUserEditor_Load); }
private void CreateControls() { this.lblLanguage = new FormLabel(0, "lblLanguage", false, "language"); this.lblPassword = new FormLabel(1, "lblPassword", false, "password"); this.tlpGeneral.Controls.Add(this.lblLanguage, 0, 0); this.tlpGeneral.Controls.Add(this.lblPassword, 0, 1); }
private void CreateControls() { this.lblServiceType = new FormLabel(0, "lblServiceType", false, "lbl_tour_type"); this.lblServiceName = new FormLabel(1, "lblServiceName", false, "lbl_service_name"); this.lblServicePrice = new FormLabel(2, "lblServicePrice", false, "lbl_price"); this.cbxServiceTypes = new ComboBox(); this.tbxServiceName = new TextBox(); this.mpkBasePrice = new MoneyPicker(); }
private void CreateControls() { this.lblUpdateSeconds = new FormLabel(0, "lblUpdateSeconds", true, "lbl_upd_sseconds"); this.lblUpdateEvery = new FormLabel(1, "lblUpdateEvery", true, "lbl_upd_interval"); this.lblUpdateUrl = new FormLabel(2, "lblUpdateUrl", true, "lbl_upd_url"); this.tlpMain.Controls.Add(this.lblUpdateEvery, 0, 2); this.tlpMain.Controls.Add(this.lblUpdateSeconds, 2, 2); this.tlpMain.Controls.Add(this.lblUpdateUrl, 0, 1); }
public void Add() { FormGroup g = new FormGroup(""); FormLabel l = new FormLabel(""); g.Add(l); Assert.AreSame(l.Container, g); Assert.IsTrue(g.Contents.Any(c => ReferenceEquals(c, l))); Assert.AreEqual(g.Contents.Count, 1); }
public void Remove() { FormGroup g = new FormGroup(""); FormLabel l = new FormLabel(""); g.Add(l); g.Remove(l); Assert.IsNull(l.Container); Assert.IsFalse(g.Contents.Any(c => ReferenceEquals(c, l))); Assert.AreEqual(g.Contents.Count, 0); }
private void CreateControls() { this.lblDatabaseServerName = new FormLabel(0, "lblDatabaseServerName", true, "lbl_db_server"); this.lblDatabaseTcpPort = new FormLabel(1, "lblDatabaseTcpPort", true, "lbl_db_port"); this.lblDatabaseUserId = new FormLabel(2, "lblDatabaseUserId", true, "lbl_db_srv_user"); this.lblDatabasePassword = new FormLabel(3, "lblDatabasePassword", true, "lbl_db_password"); this.lblDatabaseCatalog = new FormLabel(4, "lblDatabaseCatalog", true, "lbl_db_name"); this.tlpMain.Controls.Add(this.lblDatabaseServerName, 0, 1); this.tlpMain.Controls.Add(this.lblDatabaseTcpPort, 0, 2); this.tlpMain.Controls.Add(this.lblDatabaseUserId, 0, 3); this.tlpMain.Controls.Add(this.lblDatabasePassword, 0, 4); this.tlpMain.Controls.Add(this.lblDatabaseCatalog, 0, 5); }
public void AddContained() { FormGroup g1 = new FormGroup(""); FormGroup g2 = new FormGroup(""); FormLabel l = new FormLabel(""); g1.Add(l); g2.Add(l); Assert.AreSame(l.Container, g2); Assert.IsFalse(g1.Contents.Any(c => ReferenceEquals(c, l))); Assert.IsTrue(g2.Contents.Any(c => ReferenceEquals(c, l))); }
private async Task <Template> ToObject(TemplateModel templateModel) { var template = new Template { UserId = templateModel.UserId, FormTemplates = new List <FormTemplate>() }; // Create form templates. foreach (var formTemplateModel in templateModel.FormTemplates) { var formTemplate = new FormTemplate { Type = formTemplateModel.Type, Title = formTemplateModel.Title, FormPosition = new FormPosition { OffsetTop = formTemplateModel.OffsetTop, OffsetLeft = formTemplateModel.OffsetLeft, XPos = formTemplateModel.XPos, YPos = formTemplateModel.YPos, Width = formTemplateModel.Width, Height = formTemplateModel.Height }, FormLabels = new List <FormLabel>() }; // Create form labels. for (int i = 0; i < formTemplateModel.Labels.Count(); i++) { var formLabel = new FormLabel { Index = i, Value = formTemplateModel.Labels.ElementAt(i) }; formTemplate.FormLabels.Add(formLabel); } template.FormTemplates.Add(formTemplate); } return(await Task.FromResult(template)); }
private void CreateControls() { this.lblRuleName = new FormLabel(0, "lblRuleName", false, "lbl_rule_name"); this.lblFormula = new FormLabel(1, "lblFormula", false, "lbl_formula"); this.lblConstraints = new ToolbarLabel(2, "lblConstraints", "lbl_constraints"); this.btnConstraintsEdit = new FlatButton(3, "edit", "pencil", "edit"); this.btnConstraintsAdd = new FlatButton(4, "add", "add", "add"); this.btnConstraintsDelete = new FlatButton(5, "delete", "delete", "delete"); this.tlpConstraintButtons.Controls.Add(this.btnConstraintsAdd, 1, 0); this.tlpConstraintButtons.Controls.Add(this.btnConstraintsEdit, 2, 0); this.tlpConstraintButtons.Controls.Add(this.btnConstraintsDelete, 3, 0); this.tlpConstraintButtons.Controls.Add(this.lblConstraints, 0, 0); this.tlpMain.Controls.Add(this.lblRuleName, 0, 0); this.tlpMain.Controls.Add(this.lblFormula, 0, 1); }
private void CreateControls() { this.lblDate = new FormLabel(0, "lblDate", false, "date"); this.lblTours = new ToolbarLabel(6, "lblTours", "lbl_tours"); this.btnAddTour = new FlatButton(7, "btnAdd", "add", "add"); this.btnEditTour = new FlatButton(8, "btnEdit", "pencil", "edit"); this.btnDeleteTour = new FlatButton(9, "btnDelete", "delete", "delete"); this.btnAddTour.Click += new EventHandler(btnAddTour_Click); this.btnDeleteTour.Click += new EventHandler(btnDeleteTour_Click); this.tlpButtons.Controls.Add(this.btnAddTour, 0, 0); this.tlpButtons.Controls.Add(this.btnEditTour, 1, 0); this.tlpButtons.Controls.Add(this.btnDeleteTour, 2, 0); this.tlpToursToolbar.Controls.Add(this.lblTours, 0, 0); this.tlpDate.Controls.Add(this.lblDate, 0, 0); }
private void CreateControls() { this.lblComment = new FormLabel(0, "lblComment", false, "select_role"); this.lblRoles = new ToolbarLabel(1, "lblRoles", "lbl_roles"); this.lblTasks = new ToolbarLabel(2, "lblTasks", "lbl_tasks"); this.btnAddRole = new FlatButton(3, "add", "add", "add"); this.btnEditRole = new FlatButton(4, "edit", "pencil", "edit"); this.btnDeleteRole = new FlatButton(5, "delete", "delete", "delete"); this.tlpButtons.Controls.Add(this.btnAddRole, 1, 0); this.tlpButtons.Controls.Add(this.btnEditRole, 2, 0); this.tlpButtons.Controls.Add(this.btnDeleteRole, 3, 0); this.tlpMain.Controls.Add(this.lblTasks, 1, 0); this.tlpButtons.Controls.Add(this.lblRoles, 0, 0); this.panelTasks.Controls.Add(this.lblComment); }
private void CreateControls() { this.lblTitle = new FormLabel(0, "lblTitle", false, "lbl_title"); this.lblFirstName = new FormLabel(2, "lblFirstName", false, "lbl_first_name"); this.lblLastName = new FormLabel(4, "lblLastName", false, "lbl_last_name"); this.lblContacts = new ToolbarLabel(6, "lblContacts", "lbl_contacts"); this.btnAddContact = new FlatButton(8, "btnAdd", "add", "add"); this.btnRemoveContact = new FlatButton(9, "btnDelete", "delete", "delete"); this.tlpContacts.Controls.Add(this.btnAddContact, 1, 0); this.tlpContacts.Controls.Add(this.btnRemoveContact, 2, 0); this.tlpMain.Controls.Add(this.lblTitle, 0, 1); this.tlpMain.Controls.Add(this.lblFirstName, 0, 2); this.tlpMain.Controls.Add(this.lblLastName, 0, 3); this.tlpContacts.Controls.Add(this.lblContacts, 0, 0); this.btnAddContact.Click += new EventHandler(btnAddContact_Click); this.btnRemoveContact.Click += new EventHandler(btnRemoveContact_Click); }
private void CreateControls() { this.lblDate = new FormLabel(0, "lblDate", false, "lbl_date"); this.lblTime = new FormLabel(2, "lblTime", false, "lbl_time"); //this.lblComments = new FormLabel(4, "lblComments", false, "lbl_comments"); this.dtpDate = new DateTimePicker(); this.dtpDate.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right))); this.dtpDate.Format = DateTimePickerFormat.Short; this.dtpDate.Name = "dtpDate"; this.dtpDate.TabIndex = 1; this.dtpTime = new DateTimePicker(); this.dtpTime.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right))); this.dtpTime.CustomFormat = "HH:mm"; this.dtpTime.Format = DateTimePickerFormat.Custom; this.dtpTime.Name = "dtpTime"; this.dtpTime.ShowUpDown = true; this.dtpTime.TabIndex = 3; //this.rtbComments = new RichTextBox(); //this.rtbComments.BorderStyle = BorderStyle.FixedSingle; //this.rtbComments.Dock = System.Windows.Forms.DockStyle.Fill; //this.rtbComments.Name = "rtbComments"; //this.rtbComments.TabIndex = 5; //this.rtbComments.Text = ""; this.tlpMain.Controls.Add(this.lblDate, 0, 1); this.tlpMain.Controls.Add(this.dtpDate, 1, 1); this.tlpMain.Controls.Add(this.lblTime, 0, 2); this.tlpMain.Controls.Add(this.dtpTime, 1, 2); //this.tlpMain.Controls.Add(this.lblComments, 0, 3); //this.tlpMain.Controls.Add(this.rtbComments, 1, 3); }
private void SetupControls() { this.lblUserName = new FormLabel(0, "lblUserName", true, "username"); this.lblPassword = new FormLabel(1, "lblPassword", true, "password"); this.lblLogonProcess = new FormLabel(2, "lblLogonProcess", true, "logon_process"); this.lblLogonProcess.Anchor |= AnchorStyles.Right; this.pbxAppIcon = new System.Windows.Forms.PictureBox(); this.lblAppName = new System.Windows.Forms.Label(); this.cbxUserName = new System.Windows.Forms.ComboBox(); this.tbxPassword = new System.Windows.Forms.TextBox(); this.btnExit = new FlatButton(1, "exit", "", "exit"); this.btnLogin = new FlatButton(2, "login", "", "login"); this.pbxAppIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.lblAppName.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tbxPassword.UseSystemPasswordChar = true; this.lblAppName.AutoSize = true; this.tbxPassword.Anchor |= AnchorStyles.Right; this.cbxUserName.Anchor |= AnchorStyles.Right; this.lblLogonProcess.Margin = new Padding(0, 20, 0, 20); this.cbxUserName.FormattingEnabled = true; this.AcceptButton = this.btnLogin; this.btnExit.Click += new System.EventHandler(this.btnExit_Click); this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click); this.tlpMain = new HLayoutPanel("tlpMain", 6, 3, 0); this.tlpButtons = new HLayoutPanel("tlpButtons", 1, 3, 1); this.tlpMain.ColumnStyles[this.tlpMain.ColumnCount - 1] = new ColumnStyle(SizeType.Percent, 100F); this.tlpMain.RowStyles[1] = new RowStyle(SizeType.Percent, 100F); this.tlpMain.Controls.Add(this.pbxAppIcon, 0, 0); this.tlpMain.Controls.Add(this.lblAppName, 1, 0); this.tlpMain.Controls.Add(this.lblLogonProcess, 1, 2); this.tlpMain.Controls.Add(this.lblUserName, 1, 3); this.tlpMain.Controls.Add(this.cbxUserName, 2, 3); this.tlpMain.Controls.Add(this.lblPassword, 1, 4); this.tlpMain.Controls.Add(this.tbxPassword, 2, 4); this.tlpMain.Controls.Add(this.tlpButtons, 0, 5); this.tlpMain.SetColumnSpan(this.lblAppName, 2); this.tlpMain.SetColumnSpan(this.lblLogonProcess, 2); this.tlpMain.SetColumnSpan(this.tlpButtons, 3); this.tlpMain.SetRowSpan(this.pbxAppIcon, 5); this.tlpButtons.Controls.Add(this.btnLogin, 1, 0); this.tlpButtons.Controls.Add(this.btnExit, 2, 0); this.tlpButtons.ColumnStyles[0] = new ColumnStyle(SizeType.Percent, 100F); this.tlpButtons.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom; this.tlpButtons.AutoSize = true; this.Controls.Add(this.tlpMain); this.BackColor = System.Drawing.Color.White; this.tlpMain.BackColor = this.BackColor; this.tlpButtons.BackColor = Presentation.View.Theme.GroupPanelBackColor; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = Resources.Texts.logon; this.lblAppName.Text = Resources.Texts.app_name; this.pbxAppIcon.Image = DomainModel.Application.ResourceManager.GetImage("lock_big"); }
protected void btnSave_ServerClick(object sender, EventArgs e) { Page.Validate(); if (!Page.IsValid) { return; } FormController fc = new FormController(FormDocumentData); if (!_add && FormItemData != null) //edit { FormItemData = fc.GetSTLItemByUid(new Guid(itemUid)); FormItemData.ShowLabel = !rbNone.Checked; FormLabel lbl = null; foreach (FormLabel temp in FormItemData.Labels) { if (temp.Code.ToLower().Equals(Thread.CurrentThread.CurrentUICulture.Name.ToLower())) { lbl = temp; } } if (lbl == null) { lbl = new FormLabel(); lbl.Code = Thread.CurrentThread.CurrentUICulture.Name.ToLower(); FormItemData.Labels.Add(lbl); } if (rbDefault.Checked) { lbl.Title = FormController.DefaultLabelValue; } else { lbl.Title = txtTitle.Text; } if (!String.IsNullOrEmpty(txtLabelWidth.Text)) { FormItemData.LabelWidth = Unit.Pixel(int.Parse(txtLabelWidth.Text)).ToString(); } short tabIndex = 0; if (!String.IsNullOrEmpty(TabIndexText.Text.Trim())) { tabIndex = short.Parse(TabIndexText.Text.Trim()); } FormItemData.TabIndex = tabIndex; FormItemData.RowSpan = int.Parse(ddRows.SelectedValue); if (!rb1.Disabled && rb1.Checked) { FormItemData.ColSpan = 1; } if (!rb2.Disabled && rb2.Checked) { FormItemData.ColSpan = 2; } foreach (Control c in phProperties.Controls) { if (c is SmartTableLayoutItemProperties) { SmartTableLayoutItemProperties sp = (SmartTableLayoutItemProperties)c; //FormItemData.Control.Source = sp.Source; FormItemData.Control.ReadOnly = sp.ReadOnly; } } } else if (_add && FormSectionData != null) { FormSectionData = fc.GetSectionByUid(new Guid(FormSectionData.Uid)); if (ddControl.SelectedValue.Equals(FormController.MetaPrimitiveControlType)) { string source = String.Empty; bool readOnly = false; foreach (Control c in phProperties.Controls) { if (c is SmartTableLayoutItemProperties) { SmartTableLayoutItemProperties sp = (SmartTableLayoutItemProperties)c; source = sp.Source; readOnly = sp.ReadOnly; } } int colSpan = 1; if (!rb1.Disabled && rb1.Checked) { colSpan = 1; } if (!rb2.Disabled && rb2.Checked) { colSpan = 2; } string label = String.Empty; if (rbDefault.Checked) { label = FormController.DefaultLabelValue; } else if (rbCustom.Checked) { label = txtTitle.Text; } short tabIndex = 0; if (!String.IsNullOrEmpty(TabIndexText.Text.Trim())) { tabIndex = short.Parse(TabIndexText.Text.Trim()); } FormItem newItem = FormController.CreateFormItemPrimitive(-1, -1, int.Parse(ddRows.SelectedValue), colSpan, !rbNone.Checked, label, Unit.Pixel(int.Parse(txtLabelWidth.Text)), tabIndex, source, readOnly); fc.AddFormItem(newItem, new Guid(FormSectionData.Uid)); } } string newUid = Guid.NewGuid().ToString("N"); Session[newUid] = FormDocumentData; CloseAndRefresh(newUid); }
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); }
/// <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); }
public bool WaitForDisplayed() { return(SmartWait.WaitFor(d => FormLabel.FindElements(formSelector, ElementState.Displayed).Any())); }
protected void btnSave_ServerClick(object sender, EventArgs e) { Page.Validate(); if (!Page.IsValid) return; FormController fc = new FormController(FormDocumentData); if (!String.IsNullOrEmpty(itemUid)) //edit { FormSectionData = fc.GetSectionByUid(new Guid(itemUid)); FormSectionData.BorderType = (cbShowBorder.Checked ? 1 : 0); FormSectionData.ShowLabel = cbShowTitle.Checked; FormLabel lbl = null; foreach (FormLabel temp in FormSectionData.Labels) { if (temp.Code.ToLower().Equals(Thread.CurrentThread.CurrentUICulture.Name.ToLower())) lbl = temp; } if (lbl == null) { lbl = new FormLabel(); lbl.Code = Thread.CurrentThread.CurrentUICulture.Name.ToLower(); FormSectionData.Labels.Add(lbl); } lbl.Title = txtTitle.Text; foreach (Control c in phProperties.Controls) { if (c is SmartTableLayoutProperties) { SmartTableLayoutProperties sp = (SmartTableLayoutProperties)c; FormSectionData.Control.CellPadding = sp.CellPadding; if (!String.IsNullOrEmpty(sp.Columns)) FormSectionData.Control.Columns = sp.Columns; } } } else //create { if (ddControl.SelectedValue.Equals(FormController.SmartTableLayoutType)) { int cellPadding = 5; string columns = "50%;*"; foreach (Control c in phProperties.Controls) { if (c is SmartTableLayoutProperties) { SmartTableLayoutProperties sp = (SmartTableLayoutProperties)c; cellPadding = sp.CellPadding; if (!String.IsNullOrEmpty(sp.Columns)) columns = sp.Columns; } } BorderType bType = (cbShowBorder.Checked ? BorderType.TemplateBorder : BorderType.None); FormSection newSection = FormController.CreateSectionSTL(bType, cbShowBorder.Checked, txtTitle.Text, Unit.Percentage(100), columns, cellPadding); fc.AddSection(newSection); } } string newUid = Guid.NewGuid().ToString("N"); Session[newUid] = FormDocumentData; CloseAndRefresh(newUid); }
protected void btnSave_ServerClick(object sender, EventArgs e) { Page.Validate(); if (!Page.IsValid) { return; } FormController fc = new FormController(FormDocumentData); if (!String.IsNullOrEmpty(itemUid)) //edit { FormSectionData = fc.GetSectionByUid(new Guid(itemUid)); FormSectionData.BorderType = (cbShowBorder.Checked ? 1 : 0); FormSectionData.ShowLabel = cbShowTitle.Checked; FormLabel lbl = null; foreach (FormLabel temp in FormSectionData.Labels) { if (temp.Code.ToLower().Equals(Thread.CurrentThread.CurrentUICulture.Name.ToLower())) { lbl = temp; } } if (lbl == null) { lbl = new FormLabel(); lbl.Code = Thread.CurrentThread.CurrentUICulture.Name.ToLower(); FormSectionData.Labels.Add(lbl); } lbl.Title = txtTitle.Text; foreach (Control c in phProperties.Controls) { if (c is SmartTableLayoutProperties) { SmartTableLayoutProperties sp = (SmartTableLayoutProperties)c; FormSectionData.Control.CellPadding = sp.CellPadding; if (!String.IsNullOrEmpty(sp.Columns)) { FormSectionData.Control.Columns = sp.Columns; } } } } else //create { if (ddControl.SelectedValue.Equals(FormController.SmartTableLayoutType)) { int cellPadding = 5; string columns = "50%;*"; foreach (Control c in phProperties.Controls) { if (c is SmartTableLayoutProperties) { SmartTableLayoutProperties sp = (SmartTableLayoutProperties)c; cellPadding = sp.CellPadding; if (!String.IsNullOrEmpty(sp.Columns)) { columns = sp.Columns; } } } BorderType bType = (cbShowBorder.Checked ? BorderType.TemplateBorder : BorderType.None); FormSection newSection = FormController.CreateSectionSTL(bType, cbShowBorder.Checked, txtTitle.Text, Unit.Percentage(100), columns, cellPadding); fc.AddSection(newSection); } } string newUid = Guid.NewGuid().ToString("N"); Session[newUid] = FormDocumentData; CloseAndRefresh(newUid); }
private void CreateControls() { this.lblRoleName = new FormLabel(0, "lblRoleName", false, "role_name"); this.tlpMain.Controls.Add(this.lblRoleName, 0, 1); }
public FormViewer(Form form) { InitializeComponent(); form.InitSections(); this.form = form; this.Title = form.Name; layout = new StackLayout(); layout.Orientation = StackOrientation.Vertical; foreach (Section section in form.sections) { FormSectionLabel lblSection = new FormSectionLabel(); lblSection.Text = section.text; layout.Children.Add(lblSection); //loop through each child control inside the section foreach (Field field in section.fields) { //create label FormLabel lblText = new FormLabel(field); lblText.Text = field.text; layout.Children.Add(lblText); //create field switch (field.type) { case "text": FormEntry entText = new FormEntry(field, lblText); layout.Children.Add(entText); entText.ClassId = field.id.ToString(); if (field.value != null && !String.IsNullOrWhiteSpace(field.value)) { entText.Text = field.value; } break; case "number": FormEntry entNumber = new FormEntry(field, lblText) { Placeholder = "", Keyboard = Keyboard.Numeric, ClassId = field.id.ToString() }; if (field.value != null && !String.IsNullOrWhiteSpace(field.value)) { entNumber.Text = field.value; } layout.Children.Add(entNumber); break; case "radio": FormDropDownList entPicker = new FormDropDownList(field, lblText) { Title = "Select...", ClassId = field.id.ToString() }; foreach (string pickeritem in field.options) { entPicker.Items.Add(pickeritem); } if (field.value != null && !String.IsNullOrWhiteSpace(field.value)) { entPicker.SelectedIndex = entPicker.Items.IndexOf(entPicker.Items.FirstOrDefault(i => i.ToString() == field.value)); } layout.Children.Add(entPicker); break; case "date": FormDate entDate = new FormDate(field, lblText) { Format = "MMMM dd, yyyy", ClassId = field.id.ToString() }; if (field.value != null && !String.IsNullOrWhiteSpace(field.value)) { entDate.Date = DateTime.Parse(field.value); } layout.Children.Add(entDate); break; case "boolean": FormBoolean entToggle = new FormBoolean(field, lblText) { ClassId = field.id.ToString() }; if (field.value != null && !String.IsNullOrWhiteSpace(field.value)) { entToggle.IsToggled = field.value.Trim().ToLower() == "true"; } layout.Children.Add(entToggle); break; } } } FormContent.Content = layout; // Bind the Help and Complete buttons btnHelp.Clicked += (sender, args) => { DisplayAlert("Help", "You have been alerted", "OK", "Cancel"); }; btnComplete.Clicked += (sender, args) => { // if all fields are complete, set to complete status this.form.status2 = FormStatus.Complete; // Check that all required fields are valid if (AreAllFieldsValid()) { this.form.status2 = FormStatus.Complete; Navigation.PopAsync(); } else { DisplayAlert("Form Invalid", "This form could not be marked as complete because there was invalid data entered", "Ok"); } }; }
protected void btnSave_ServerClick(object sender, EventArgs e) { Page.Validate(); if (!Page.IsValid) return; FormController fc = new FormController(FormDocumentData); if (!_add && FormItemData != null) //edit { FormItemData = fc.GetSTLItemByUid(new Guid(itemUid)); FormItemData.ShowLabel = !rbNone.Checked; FormLabel lbl = null; foreach (FormLabel temp in FormItemData.Labels) { if (temp.Code.ToLower().Equals(Thread.CurrentThread.CurrentUICulture.Name.ToLower())) lbl = temp; } if (lbl == null) { lbl = new FormLabel(); lbl.Code = Thread.CurrentThread.CurrentUICulture.Name.ToLower(); FormItemData.Labels.Add(lbl); } if (rbDefault.Checked) lbl.Title = FormController.DefaultLabelValue; else lbl.Title = txtTitle.Text; if (!String.IsNullOrEmpty(txtLabelWidth.Text)) FormItemData.LabelWidth = Unit.Pixel(int.Parse(txtLabelWidth.Text)).ToString(); short tabIndex = 0; if (!String.IsNullOrEmpty(TabIndexText.Text.Trim())) tabIndex = short.Parse(TabIndexText.Text.Trim()); FormItemData.TabIndex = tabIndex; FormItemData.RowSpan = int.Parse(ddRows.SelectedValue); if (!rb1.Disabled && rb1.Checked) FormItemData.ColSpan = 1; if (!rb2.Disabled && rb2.Checked) FormItemData.ColSpan = 2; foreach (Control c in phProperties.Controls) { if (c is SmartTableLayoutItemProperties) { SmartTableLayoutItemProperties sp = (SmartTableLayoutItemProperties)c; //FormItemData.Control.Source = sp.Source; FormItemData.Control.ReadOnly = sp.ReadOnly; } } } else if (_add && FormSectionData != null) { FormSectionData = fc.GetSectionByUid(new Guid(FormSectionData.Uid)); if (ddControl.SelectedValue.Equals(FormController.MetaPrimitiveControlType)) { string source = String.Empty; bool readOnly = false; foreach (Control c in phProperties.Controls) { if (c is SmartTableLayoutItemProperties) { SmartTableLayoutItemProperties sp = (SmartTableLayoutItemProperties)c; source = sp.Source; readOnly = sp.ReadOnly; } } int colSpan = 1; if (!rb1.Disabled && rb1.Checked) colSpan = 1; if (!rb2.Disabled && rb2.Checked) colSpan = 2; string label = String.Empty; if (rbDefault.Checked) label = FormController.DefaultLabelValue; else if (rbCustom.Checked) label = txtTitle.Text; short tabIndex = 0; if (!String.IsNullOrEmpty(TabIndexText.Text.Trim())) tabIndex = short.Parse(TabIndexText.Text.Trim()); FormItem newItem = FormController.CreateFormItemPrimitive(-1, -1, int.Parse(ddRows.SelectedValue), colSpan, !rbNone.Checked, label, Unit.Pixel(int.Parse(txtLabelWidth.Text)), tabIndex, source, readOnly); fc.AddFormItem(newItem, new Guid(FormSectionData.Uid)); } } string newUid = Guid.NewGuid().ToString("N"); Session[newUid] = FormDocumentData; CloseAndRefresh(newUid); }
private void CreateControls() { this.lblGroupName = new FormLabel(0, "lblGroupName", false, "lbl_tour_group_name"); this.tlpMain.Controls.Add(this.lblGroupName, 0, 1); }