Esempio n. 1
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            Johnny.CMS.BLL.SystemInfo.PageBinding bll = new Johnny.CMS.BLL.SystemInfo.PageBinding();
            Johnny.CMS.OM.SystemInfo.PageBinding model = new Johnny.CMS.OM.SystemInfo.PageBinding();
            if (Request.QueryString["action"] == "modify")
            {
                //update
                model.PageBindingId = Convert.ToInt32(Request.QueryString["id"]);
                model.MenuCategoryId = DataConvert.GetInt32(ddlCategory.SelectedValue);
                model.Title = txtTitle.Text;
                model.ListMenuId = DataConvert.GetInt32(ddlListMenu.SelectedValue);
                model.AddMenuId = DataConvert.GetInt32(ddlAddMenu.SelectedValue);

                bll.Update(model);
                SetMessage(GetMessage("C00003"));
            }
            else
            {
                //insert                
                model.MenuCategoryId = DataConvert.GetInt32(ddlCategory.SelectedValue);
                model.Title = txtTitle.Text;
                model.ListMenuId = DataConvert.GetInt32(ddlListMenu.SelectedValue);
                model.AddMenuId = DataConvert.GetInt32(ddlAddMenu.SelectedValue);

                if (bll.Add(model) > 0)
                {
                    SetMessage(GetMessage("C00001"));
                    ddlCategory.SelectedIndex = 0;
                    txtTitle.Text = "";
                }
                else
                    SetMessage(GetMessage("C00002"));
            }
        }
Esempio n. 2
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in myManageGridView.Rows)
            {
                TableCell cell = row.Cells[0];
                Johnny.Controls.Web.CheckBox.CheckBox chkSelect = (Johnny.Controls.Web.CheckBox.CheckBox)cell.FindControl("chkSelect");
                if (chkSelect.Checked)
                {
                    string strId = ((Label)row.FindControl(STR_LABEL_ID)).Text;

                    //delete
                    Johnny.CMS.BLL.SystemInfo.PageBinding bll = new Johnny.CMS.BLL.SystemInfo.PageBinding();
                    bll.Delete(DataConvert.GetInt32(strId));
                }
            }

            SetMessage(GetMessage("C00005"));

            //update grid
            getData();
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in myManageGridView.Rows)
            {
                TableCell cell = row.Cells[0];
                Johnny.Controls.Web.CheckBox.CheckBox chkSelect = (Johnny.Controls.Web.CheckBox.CheckBox)cell.FindControl("chkSelect");
                if (chkSelect.Checked)
                {
                    string strId = ((Label)row.FindControl(STR_LABEL_ID)).Text;

                    //delete
                    Johnny.CMS.BLL.SystemInfo.PageBinding bll = new Johnny.CMS.BLL.SystemInfo.PageBinding();
                    bll.Delete(DataConvert.GetInt32(strId));

                }
            }

            SetMessage(GetMessage("C00005"));

            //update grid
            getData();
        }
Esempio n. 4
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!this.IsPostBack)
            {
                litPageTitle.Text = GetLabelText("PageBinding_Title");
                litMenuCategory.Text = GetLabelText("Pagebinding_MenuCategoryId");
                ddlCategory.ToolTip = GetLabelText("Pagebinding_MenuCategoryId");
                litTitle.Text = GetLabelText("Pagebinding_Title");
                txtTitle.ToolTip = GetLabelText("Pagebinding_Title");
                litListMenu.Text = GetLabelText("Pagebinding_ListMenuId");
                ddlListMenu.ToolTip = GetLabelText("Pagebinding_ListMenuId");
                litAddMenu.Text = GetLabelText("Pagebinding_AddMenuId");
                ddlAddMenu.ToolTip = GetLabelText("Pagebinding_AddMenuId");

                if (Request.QueryString["action"] == "modify")
                {
                    //get PageBindingId
                    int PageBindingId = Convert.ToInt32(Request.QueryString["id"]);

                    //Permission entity
                    Johnny.CMS.BLL.SystemInfo.PageBinding bll = new Johnny.CMS.BLL.SystemInfo.PageBinding();

                    //bind data
                    Johnny.CMS.OM.SystemInfo.PageBinding model = new Johnny.CMS.OM.SystemInfo.PageBinding();
                    model = bll.GetModel(PageBindingId);

                    CreateddlCategory();
                    foreach (ListItem item in ddlCategory.Items)
                    {
                        if (DataConvert.GetInt32(item.Value) == model.MenuCategoryId)
                        {
                            item.Selected = true;
                            break;
                        }
                    }
                    txtTitle.Text = model.Title;
                    CreateddlMenu();
                    foreach (ListItem item in ddlListMenu.Items)
                    {
                        if (DataConvert.GetInt32(item.Value) == model.ListMenuId)
                        {
                            item.Selected = true;
                            break;
                        }
                    }

                    foreach (ListItem item in ddlAddMenu.Items)
                    {
                        if (DataConvert.GetInt32(item.Value) == model.AddMenuId)
                        {
                            item.Selected = true;
                            break;
                        }
                    }                    

                    btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save;
                    //btnAdd.Text = CONST_BUTTONTEXT_SAVE;
                }
                else
                {
                    CreateddlCategory();
                    CreateddlMenu();
                }

                //RFVldtMenuName.Text = GetMessage("E00901", txtMenuName.MaxLength.ToString());
                //RFVldtPageLink.Text = GetMessage("E00903", txtPageLink.MaxLength.ToString());
            }

//                            <zr:ValidationRadioButton ID="rdbDisplay0" runat="server" GroupName="IsDisplay" Text="ÊÇ" IsRequired="True" />
//                <zr:ValidationRadioButton ID="rdbDisplay1" runat="server" GroupName="IsDisplay" Text="·ñ"  IsRequired="True" />
//<asp:Panel ID="IsDisplayTip" runat="server" class="msgNormal" tip="ÏÔʾÔÚ×ó²à²Ëµ¥À¸Àï">ÏÔʾÔÚ×ó²à²Ëµ¥À¸Àï</asp:Panel>
        }
Esempio n. 5
0
 public override void getData()
 {
     Johnny.CMS.BLL.SystemInfo.PageBinding bll = new Johnny.CMS.BLL.SystemInfo.PageBinding();
     myManageGridView.DataSource = bll.GetList();
     myManageGridView.DataBind();
 }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                /*
                 * string strXmlFile = System.Web.HttpRuntime.AppDomainAppPath + "admin/xmlconfig/pagepart.xml";
                 * //set properties
                 * XmlDocument doc = new XmlDocument();
                 * doc.Load(strXmlFile);
                 * XmlNodeList nodes = doc.SelectSingleNode("JohnnyCMS").SelectNodes("Page");
                 *
                 * string currentPage = GetCurrentPageName();
                 * for (int ix = 0; ix < nodes.Count; ix++)
                 * {
                 *  if (currentPage == nodes[ix].Attributes["AddName"].Value || currentPage == nodes[ix].Attributes["ListName"].Value)
                 *  {
                 *      lblStatus.Text = "&nbsp;";
                 *      //lblCategory.Text = nodes[ix].ChildNodes[0].InnerText;
                 *      lblTitle.Text = nodes[ix].ChildNodes[1].InnerText;
                 *      hyperlinkAllList.Text = nodes[ix].ChildNodes[2].InnerText;
                 *      hyperlinkAllList.NavigateUrl = nodes[ix].ChildNodes[3].InnerText;
                 *      hyperlinkAdd.Text = nodes[ix].ChildNodes[4].InnerText;
                 *      hyperlinkAdd.NavigateUrl = nodes[ix].ChildNodes[5].InnerText;
                 *      if (nodes[ix].Attributes["Single"].Value == "True")
                 *      {
                 *          lblSeparator.Visible = false;
                 *          hyperlinkAdd.Visible = false;
                 *      }
                 *      break;
                 *  }
                 * }*/

                //Get current page
                string currentPage = GetCurrentPageName();
                //Get Page Binding
                Johnny.CMS.BLL.SystemInfo.PageBinding        pagebinding = new Johnny.CMS.BLL.SystemInfo.PageBinding();
                IList <Johnny.CMS.OM.SystemInfo.PageBinding> bindinglist = pagebinding.GetList();
                Johnny.CMS.BLL.SystemInfo.Menu        menu     = new Johnny.CMS.BLL.SystemInfo.Menu();
                IList <Johnny.CMS.OM.SystemInfo.Menu> menulist = menu.GetList();
                foreach (var menuitem in menulist)
                {
                    if (menuitem.PageLink.Equals(currentPage) || menuitem.PageLink.Contains("/" + currentPage))
                    {
                        foreach (var bindingitem in bindinglist)
                        {
                            if (menuitem.MenuId == bindingitem.ListMenuId || menuitem.MenuId == bindingitem.AddMenuId)
                            {
                                lblStatus.Text        = "&nbsp;";
                                lblTitle.Text         = bindingitem.Title;
                                hyperlinkAllList.Text = GlobalizationUtility.GetLabelText("AdminMaster_List");
                                //hyperlinkAllList.Text = DataConvert.GetString(GetGlobalResourceObject("globaladmin", "AdminMasterLinkButtonList"));
                                Johnny.CMS.OM.SystemInfo.Menu listmenu = menulist.FirstOrDefault(p => p.MenuId == bindingitem.ListMenuId);
                                hyperlinkAllList.NavigateUrl = listmenu.PageLink;
                                //hyperlinkAdd.Text = "Add";
                                hyperlinkAdd.Text = GlobalizationUtility.GetLabelText("AdminMaster_Add");
                                Johnny.CMS.OM.SystemInfo.Menu addmenu = menulist.FirstOrDefault(p => p.MenuId == bindingitem.AddMenuId);
                                hyperlinkAdd.NavigateUrl = addmenu.PageLink;
                                if (bindingitem.ListMenuId == bindingitem.AddMenuId)
                                {
                                    hyperlinkAllList.Text = bindingitem.Title;
                                    lblSeparator.Visible  = false;
                                    hyperlinkAdd.Visible  = false;
                                }
                                break;
                            }
                        }
                        break;
                    }
                }
            }
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                /*
                string strXmlFile = System.Web.HttpRuntime.AppDomainAppPath + "admin/xmlconfig/pagepart.xml";
                //set properties
                XmlDocument doc = new XmlDocument();
                doc.Load(strXmlFile);
                XmlNodeList nodes = doc.SelectSingleNode("JohnnyCMS").SelectNodes("Page");

                string currentPage = GetCurrentPageName();
                for (int ix = 0; ix < nodes.Count; ix++)
                {
                    if (currentPage == nodes[ix].Attributes["AddName"].Value || currentPage == nodes[ix].Attributes["ListName"].Value)
                    {
                        lblStatus.Text = "&nbsp;";
                        //lblCategory.Text = nodes[ix].ChildNodes[0].InnerText;
                        lblTitle.Text = nodes[ix].ChildNodes[1].InnerText;
                        hyperlinkAllList.Text = nodes[ix].ChildNodes[2].InnerText;
                        hyperlinkAllList.NavigateUrl = nodes[ix].ChildNodes[3].InnerText;
                        hyperlinkAdd.Text = nodes[ix].ChildNodes[4].InnerText;
                        hyperlinkAdd.NavigateUrl = nodes[ix].ChildNodes[5].InnerText;
                        if (nodes[ix].Attributes["Single"].Value == "True")
                        {
                            lblSeparator.Visible = false;
                            hyperlinkAdd.Visible = false;
                        }
                        break;
                    }
                }*/

                //Get current page
                string currentPage = GetCurrentPageName();
                //Get Page Binding
                Johnny.CMS.BLL.SystemInfo.PageBinding pagebinding = new Johnny.CMS.BLL.SystemInfo.PageBinding();
                IList<Johnny.CMS.OM.SystemInfo.PageBinding> bindinglist = pagebinding.GetList();
                Johnny.CMS.BLL.SystemInfo.Menu menu = new Johnny.CMS.BLL.SystemInfo.Menu();
                IList<Johnny.CMS.OM.SystemInfo.Menu> menulist = menu.GetList();
                foreach (var menuitem in menulist)
                {
                    if (menuitem.PageLink.Equals(currentPage) || menuitem.PageLink.Contains("/"+currentPage))
                    {
                        foreach (var bindingitem in bindinglist)
                        {
                            if (menuitem.MenuId == bindingitem.ListMenuId || menuitem.MenuId == bindingitem.AddMenuId)
                            {
                                lblStatus.Text = "&nbsp;";
                                lblTitle.Text = bindingitem.Title;
                                hyperlinkAllList.Text = GlobalizationUtility.GetLabelText("AdminMaster_List");
                                //hyperlinkAllList.Text = DataConvert.GetString(GetGlobalResourceObject("globaladmin", "AdminMasterLinkButtonList"));
                                Johnny.CMS.OM.SystemInfo.Menu listmenu = menulist.FirstOrDefault(p => p.MenuId == bindingitem.ListMenuId);
                                hyperlinkAllList.NavigateUrl = listmenu.PageLink;
                                //hyperlinkAdd.Text = "Add";
                                hyperlinkAdd.Text = GlobalizationUtility.GetLabelText("AdminMaster_Add");
                                Johnny.CMS.OM.SystemInfo.Menu addmenu = menulist.FirstOrDefault(p => p.MenuId == bindingitem.AddMenuId);
                                hyperlinkAdd.NavigateUrl = addmenu.PageLink;
                                if (bindingitem.ListMenuId == bindingitem.AddMenuId)
                                {
                                    hyperlinkAllList.Text = bindingitem.Title;
                                    lblSeparator.Visible = false;
                                    hyperlinkAdd.Visible = false;
                                }
                                break;
                            }
                        }
                        break;
                    }
                }
            }
        }
 public override void getData()
 {
     Johnny.CMS.BLL.SystemInfo.PageBinding bll = new Johnny.CMS.BLL.SystemInfo.PageBinding();
     myManageGridView.DataSource = bll.GetList();
     myManageGridView.DataBind();
 }