Пример #1
0
        private void AddFormFooter(Panel p)
        {
            using (HtmlTable htmlTable = new HtmlTable())
            {
                using (HtmlTableRow row = new HtmlTableRow())
                {
                    using (HtmlTableCell labelCell = new HtmlTableCell())
                    {
                        labelCell.Attributes.Add("class", "label-cell");

                        row.Cells.Add(labelCell);
                    }

                    using (HtmlTableCell controlCell = new HtmlTableCell())
                    {
                        this.saveButton = new Button();
                        this.saveButton.ID = "SaveButton";
                        this.saveButton.Text = Resources.ScrudResource.Save;
                        this.saveButton.OnClientClick = "adjustSpinnerSize();";

                        this.saveButton.Click += this.SaveButton_Click;

                        this.saveButton.CssClass = this.GetButtonCssClass();

                        controlCell.Controls.Add(this.saveButton);

                        this.cancelButton = new Button();
                        this.cancelButton.ID = "CancelButton";
                        this.cancelButton.Text = Resources.ScrudResource.Cancel;
                        this.cancelButton.CausesValidation = false;
                        this.cancelButton.OnClientClick = "$('#FormPanel').hide(500); $('#GridPanel').show(500);";
                        this.cancelButton.Click += this.CancelButton_Click;
                        this.cancelButton.CssClass = this.GetButtonCssClass();

                        controlCell.Controls.Add(this.cancelButton);

                        using (HtmlInputReset resetButton = new HtmlInputReset())
                        {
                            resetButton.Value = Resources.ScrudResource.Reset;
                            resetButton.Attributes.Add("class", this.GetButtonCssClass());

                            controlCell.Controls.Add(resetButton);
                        }

                        row.Cells.Add(controlCell);

                        htmlTable.Rows.Add(row);
                        p.Controls.Add(htmlTable);
                    }
                }
            }
        }
Пример #2
0
        private void AddFormFooter(Panel p)
        {
            using (HtmlTable htmlTable = new HtmlTable())
            {
                using (HtmlTableRow row = new HtmlTableRow())
                {
                    using (HtmlTableCell labelCell = new HtmlTableCell())
                    {
                        labelCell.Attributes.Add("class", "label-cell");

                        row.Cells.Add(labelCell);
                    }

                    using (HtmlTableCell controlCell = new HtmlTableCell())
                    {
                        controlCell.Attributes.Add("class", "control-cell");

                        if (this.IsModal())
                        {
                            this.useButton = new Button();
                            this.useButton.ID = "UseButton";
                            this.useButton.Text = Titles.Use;
                            this.useButton.OnClientClick = "scrudDispalyLoading();";

                            this.useButton.Click += this.UseButton_Click;

                            this.useButton.CssClass = this.GetButtonCssClass();

                            controlCell.Controls.Add(this.useButton);
                        }

                        this.saveButton = new Button();
                        this.saveButton.ID = "SaveButton";
                        this.saveButton.Text = Titles.Save;
                        this.saveButton.OnClientClick = "return(scrudClientValidation());";

                        this.saveButton.Click += this.SaveButton_Click;

                        this.saveButton.CssClass = this.GetSaveButtonCssClass();

                        controlCell.Controls.Add(this.saveButton);

                        this.cancelButton = new Button();
                        this.cancelButton.ID = "CancelButton";
                        this.cancelButton.Text = Titles.Cancel;
                        this.cancelButton.CausesValidation = false;
                        this.cancelButton.OnClientClick = "$('#FormPanel').hide(500); $('#GridPanel').show(500);";
                        this.cancelButton.Click += this.CancelButton_Click;
                        this.cancelButton.CssClass = this.GetButtonCssClass();

                        controlCell.Controls.Add(this.cancelButton);

                        using (HtmlInputReset resetButton = new HtmlInputReset())
                        {
                            resetButton.Value = Titles.Reset;
                            resetButton.Attributes.Add("class", this.GetButtonCssClass());

                            controlCell.Controls.Add(resetButton);
                        }

                        row.Cells.Add(controlCell);

                        htmlTable.Rows.Add(row);
                        p.Controls.Add(htmlTable);
                    }
                }
            }
        }