コード例 #1
0
        void closeButton_Click(object sender, EventArgs e)
        {
            View b = null; MultiView c = null;

            b = Parent as View;

            if (b != null)
            {
                c = b.Parent as MultiView;
                c.ActiveViewIndex = 0;

                FieldBoxList = null;
                Designer     = null;
            }
        }
コード例 #2
0
        public void CloseDesigner_Click(object sender, EventArgs e)
        {
            RidSameViewState();

            View b = null; MultiView c = null;

            b = Parent as View;

            if (b != null)
            {
                c = b.Parent as MultiView;
                c.ActiveViewIndex = 0;

                collectionRightControls = null;
                designer = null;
            }
        }
コード例 #3
0
        private Table ViewPage()
        {
            var       table = new Table();
            TableRow  row;
            TableCell cell;

            #region label and Textbox Name Template

            row  = new TableRow();
            cell = new TableCell();
            cell.Controls.Add(new Literal {
                Text = "<br />"
            });

            var label = new Label {
                Text = "Имя шаблона"
            };
            cell.Controls.Add(label);

            TemplateNameBox = new TextBox {
                ID = "NameBox"
            };
            cell.Controls.Add(TemplateNameBox);

            if (!string.IsNullOrEmpty(TemplateID) && Template != null)
            {
                TemplateNameBox.Text = Template.Name;
            }

            #endregion

            row.Cells.Add(cell);

            #region Create button's

            var cell2 = new TableCell();
            cell2.Controls.Add(new Literal {
                Text = "<br />"
            });
            //cell2.VerticalAlign = VerticalAlign.Top;
            var IncludeButton = new Button()
            {
                ID = "includeButton", Text = "+"
            };
            IncludeButton.Click += new EventHandler(includeButton_Click);
            cell2.Controls.Add(IncludeButton);

            var excludeButton = new Button()
            {
                Text = "-"
            };
            excludeButton.Click += new EventHandler(excludeButton_Click);
            cell2.Controls.Add(excludeButton);

            var upButton = new Button()
            {
                Text = "\u2191"
            };
            upButton.Click += new EventHandler(upButton_Click);
            cell2.Controls.Add(upButton);

            var downButton = new Button()
            {
                Text = "\u2193"
            };
            downButton.Click += new EventHandler(downButton_Click);
            cell2.Controls.Add(downButton);
            cell2.Controls.Add(new Literal {
                Text = "&nbsp&nbsp&nbsp"
            });

            var rejectFilterButton = new Button {
                Text = "Сброс фильтров"
            };
            rejectFilterButton.Click += new EventHandler(rejectFilterButton_Click);
            cell2.Controls.Add(rejectFilterButton);
            cell2.Controls.Add(new Literal {
                Text = "&nbsp&nbsp&nbsp"
            });

            isTemplateDefault = new System.Web.UI.WebControls.CheckBox {
                ID = "CheckBoxTemplateDefault", Text = "Сделать шаблоном по умолчанию ? "
            };
            isTemplateDefault.Checked = Template.TemplateByDefault;
            cell2.Controls.Add(isTemplateDefault);
            cell2.Controls.Add(new Literal {
                Text = "&nbsp&nbsp&nbsp"
            });

            if (ShowSaveAsButton)
            {
                var saveAsButton = new Button {
                    ID = "SaveAsButton", Text = "Сохранить как"
                };
                saveAsButton.Click += new EventHandler(saveAsButton_Click);
                cell2.Controls.Add(saveAsButton);
            }

            if (ShowSaveButton)
            {
                var saveButton = new Button {
                    ID = "SaveButton", Text = "Сохранить"
                };
                saveButton.Click += new EventHandler(saveButton_Click);
                cell2.Controls.Add(saveButton);
            }

            if (ShowCloseButton)
            {
                var closeButton = new Button {
                    ID = "CloseButton", Text = "Закрыть", BackColor = Color.FromArgb(205, 205, 205)
                };
                closeButton.Click += new EventHandler(closeButton_Click);
                cell2.Controls.Add(closeButton);
            }

            cell2.Controls.Add(new Literal {
                Text = "&nbsp&nbsp&nbsp"
            });

            if (ShowCreateNewTemplateButton)
            {
                var newButton = new Button {
                    ID = "CreateTemplate", Text = "Новый", BackColor = Color.FromArgb(218, 226, 245)
                };
                newButton.OnClientClick = "return confirm(' Создать новый шаблон ? Несохраненные данные в текущем шаблоне будут потеряны.');";
                newButton.Click        += new EventHandler(createNewTemplate_Click);
                cell2.Controls.Add(newButton);
            }

            #endregion

            row.Cells.Add(cell2);
            table.Rows.Add(row);

            row = new TableRow();

            #region Designer

            cell = new TableCell();
            cell.VerticalAlign = VerticalAlign.Top;

            if (string.IsNullOrEmpty(EntityID))
            {
                EntityID = (Template as Template).Entity.ID.ToString();
            }

            designer = new Designer()
            {
                userID = this.userID
            };
            InitializationDesigner();

            #endregion

            cell.Controls.Add(designer);

            #region Build fields

            cell2 = new TableCell();
            cell2.VerticalAlign = VerticalAlign.Top;
            cell2.Controls.Add(new Literal {
                Text = "<br /><br />"
            });

            FieldTable = new Table {
                ID = "FieldTable"
            };
            var headerRow = CreateHeaderRow();
            FieldTable.Rows.Add(headerRow);
            CreateFieldTableRows();

            #endregion

            cell2.Controls.Add(FieldTable);

            row.Cells.Add(cell);
            row.Cells.Add(cell2);

            table.Rows.Add(row);

            return(table);
        }