Exemplo n.º 1
0
        protected void HandleFieldUpdateButtonClicked(object sender, EventArgs e)
        {
            int             fieldid = (int)this.Session["FORMDESIGNER:FIELDID"];
            DesignableField field   = this.controller.DesignableForm.GetFieldByID(fieldid);

            /// Update the name
            string newFieldName = this.FieldNameTextbox.Text;

            if (!string.IsNullOrEmpty(newFieldName))
            {
                field.Name = newFieldName;
            }

            /// Update the control type
            FieldControlType controlType = (FieldControlType)Enum.Parse(typeof(FieldControlType), this.FieldControlTypeList.SelectedValue, true);

            field.Metadata.ControlType = controlType;

            if (field.IsKeyField() == false && this.FieldIsKeyFieldCheckbox.Checked)
            {
                field.SetAsKeyField();
            }

            /// Store
            field.Store();

            this.BindFieldList();

            this.FieldUpdateStatusLabel.Text    = "Field Updated";
            this.FieldUpdateStatusLabel.Visible = true;
        }
Exemplo n.º 2
0
        private void BindFieldLookupCodeList()
        {
            int             fieldid = (int)this.Session["FORMDESIGNER:FIELDID"];
            DesignableField field   = this.controller.DesignableForm.GetFieldByID(fieldid);

            this.FieldCodesRepeater.DataSource = field.LookupCodes;
            this.FieldCodesRepeater.DataBind();
        }
Exemplo n.º 3
0
        protected void BindFieldEditor()
        {
            int             fieldid = (int)this.Session["FORMDESIGNER:FIELDID"];
            DesignableField field   = this.controller.DesignableForm.GetFieldByID(fieldid);

            this.FieldNameTextbox.Text = field.Name;
            this.FieldControlTypeList.SelectedValue = field.Metadata.ControlType.ToString();

            this.FieldUpdateStatusLabel.Text    = string.Empty;
            this.FieldUpdateStatusLabel.Visible = false;
            this.FieldEditorPanel.Visible       = true;

            this.FieldIsKeyFieldCheckbox.Checked = field.IsKeyField();
        }
Exemplo n.º 4
0
        protected void HandleAddNewFieldButtonClicked(object sender, EventArgs e)
        {
            string newFieldName = this.NewFieldNameTextbox.Text;

            if (string.IsNullOrEmpty(newFieldName))
            {
                return;
            }
            this.NewFieldNameTextbox.Text = string.Empty;
            DesignableField newField = this.controller.DesignableForm.AddField(newFieldName);

            this.controller.DesignableForm.Store();
            this.BindFieldList();
            this.EditField(newField.FormField.Id);
        }
Exemplo n.º 5
0
        protected void HandleAddNewFieldCodeButtonClicked(object sender, EventArgs e)
        {
            string newFieldCodeName = this.NewFieldCodeTextbox.Text;

            if (string.IsNullOrEmpty(newFieldCodeName))
            {
                return;
            }
            this.NewFieldCodeTextbox.Text = string.Empty;
            int             fieldid = (int)this.Session["FORMDESIGNER:FIELDID"];
            DesignableField field   = this.controller.DesignableForm.GetFieldByID(fieldid);

            field.AddLookupCode(newFieldCodeName);
            field.Store();
            this.BindFieldLookupCodeList();
        }
Exemplo n.º 6
0
        protected void HandleFieldNameUpdateButtonClicked(object sender, EventArgs e)
        {
            string newFieldName = this.FieldNameTextbox.Text;

            if (string.IsNullOrEmpty(newFieldName))
            {
                return;
            }

            int             fieldid = (int)this.Session["FORMDESIGNER:FIELDID"];
            DesignableField field   = this.controller.DesignableForm.GetFieldByID(fieldid);

            field.Name = newFieldName;
            field.Store();

            this.BindFieldList();

            this.FieldUpdateStatusLabel.Text    = "Field Name Updated";
            this.FieldUpdateStatusLabel.Visible = true;
        }
Exemplo n.º 7
0
 protected void HandleFieldItemCommand(object sender, ListViewCommandEventArgs args)
 {
     if (args.CommandName.Equals("EditField", StringComparison.InvariantCultureIgnoreCase))
     {
         int fieldid = int.Parse(args.CommandArgument.ToString());
         this.EditField(fieldid);
     }
     else if (args.CommandName.Equals("MoveFieldUp", StringComparison.InvariantCultureIgnoreCase))
     {
         int             fieldid = int.Parse(args.CommandArgument.ToString());
         DesignableField field   = this.controller.DesignableForm.GetFieldByID(fieldid);
         field.MoveUp();
         this.BindFieldList();
     }
     else if (args.CommandName.Equals("MoveFieldDown", StringComparison.InvariantCultureIgnoreCase))
     {
         int             fieldid = int.Parse(args.CommandArgument.ToString());
         DesignableField field   = this.controller.DesignableForm.GetFieldByID(fieldid);
         field.MoveDown();
         this.BindFieldList();
     }
 }