Exemplo n.º 1
0
        protected void uiButtonUpdate_Click(object sender, EventArgs e)
        {
            EGEMech.BLL.Page page = new EGEMech.BLL.Page();
            if (CurrentPage !=null)
            {
                page = CurrentPage;
            }
            else
            {
                page.AddNew();
            }

            page.Title = uiTextBoxTitle.Text;
            page.Name = uiTextBoxName.Text;
            page.InMenu = uiCheckBoxInMenu.Checked;
            page.Content = Server.HtmlEncode(uiFCKeditorContent.Value);
            if (!string.IsNullOrEmpty(uiDropDownListPages.SelectedValue))
                page.ParentID = Convert.ToInt32(uiDropDownListPages.SelectedValue);
            page.Save();
            uiPanelEdit.Visible = false;
            uiPanelViewPages.Visible = true;
            Clearfields();
            BindData();
            LoadDDLs();
            CurrentPage = null;
        }
Exemplo n.º 2
0
        protected void uiGridViewPages_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditPages")
            {
                EGEMech.BLL.Page page = new EGEMech.BLL.Page();
                page.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument));
                CurrentPage = page;

                uiTextBoxTitle.Text = page.Title;
                uiTextBoxName.Text = page.Name;
                uiCheckBoxInMenu.Checked = page.InMenu;
                uiFCKeditorContent.Value = Server.HtmlDecode(page.Content);
                if(!page.IsColumnNull("ParentID"))
                    uiDropDownListPages.SelectedValue = page.ParentID.ToString();
                uiPanelViewPages.Visible = false;
                uiPanelEdit.Visible = true;
            }
            else if (e.CommandName == "DeletePages")
            {
                try
                {
                    EGEMech.BLL.Page page = new EGEMech.BLL.Page();
                    page.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument));
                    page.MarkAsDeleted();
                    page.Save();
                    BindData();
                }
                catch (Exception ex)
                {
                    uiLabelError.Visible = true;
                }

            }
        }