protected void btnSave_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in myManageGridView.Rows)
            {
                string  strId   = ((Label)row.FindControl(STR_LABEL_ID)).Text;
                TextBox uptName = (TextBox)row.FindControl("txtUptMenuCategoryName");

                //check name
                if (!CheckInputEmptyAndLength(uptName, "E00801", "E00802", false))
                {
                    return;
                }

                //update
                Johnny.CMS.OM.SystemInfo.MenuCategory model = new Johnny.CMS.OM.SystemInfo.MenuCategory();
                model.MenuCategoryId   = DataConvert.GetInt32(strId);
                model.MenuCategoryName = uptName.Text;

                Johnny.CMS.BLL.SystemInfo.MenuCategory bll = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
                bll.Update(model);
            }

            SetMessage(GetMessage("C00003"));

            //update grid
            getData();
        }
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            //check category name
            if (!CheckInputEmptyAndLength(txtMenuCategoryName, "E00801", "E00802", false))
                return;

            Johnny.CMS.BLL.SystemInfo.MenuCategory bll = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
            Johnny.CMS.OM.SystemInfo.MenuCategory model = new Johnny.CMS.OM.SystemInfo.MenuCategory();

            if (Request.QueryString["action"] == "modify")
            {
                //update
                model.MenuCategoryId = Convert.ToInt32(Request.QueryString["id"]);
                model.MenuCategoryName = txtMenuCategoryName.Text;

                bll.Update(model);
                SetMessage(GetMessage("C00003"));
            }
            else
            {
                //insert
                model.MenuCategoryName = txtMenuCategoryName.Text;
                
                if (bll.Add(model) > 0)
                {
                    SetMessage(GetMessage("C00001"));
                    txtMenuCategoryName.Text = "";
                }
                else
                    SetMessage(GetMessage("C00002"));
            }
        }        
        protected void btnSave_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in myManageGridView.Rows)
            {
                string strId = ((Label)row.FindControl(STR_LABEL_ID)).Text;
                TextBox uptName = (TextBox)row.FindControl("txtUptMenuCategoryName");

                //check name
                if (!CheckInputEmptyAndLength(uptName, "E00801", "E00802", false))
                    return;

                //update
                Johnny.CMS.OM.SystemInfo.MenuCategory model = new Johnny.CMS.OM.SystemInfo.MenuCategory();
                model.MenuCategoryId = DataConvert.GetInt32(strId);
                model.MenuCategoryName = uptName.Text;

                Johnny.CMS.BLL.SystemInfo.MenuCategory bll = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
                bll.Update(model);
            }

            SetMessage(GetMessage("C00003"));

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

            if (!this.IsPostBack)
            {
                litPageTitle.Text = GetLabelText("MenuCategory_Title");
                litMenuCategoryName.Text = GetLabelText("Menucategory_MenuCategoryName");
                txtMenuCategoryName.ToolTip = GetLabelText("Menucategory_MenuCategoryName");

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

                    Johnny.CMS.BLL.SystemInfo.MenuCategory bll = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
                    Johnny.CMS.OM.SystemInfo.MenuCategory model = new Johnny.CMS.OM.SystemInfo.MenuCategory();
                    model = bll.GetModel(MenuCategoryId);

                    txtMenuCategoryName.Text = model.MenuCategoryName;

                    btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save;
                    //btnAdd.Text = CONST_BUTTONTEXT_SAVE;
                }

                //RFVldtMenuCategoryName.ErrorMessage = GetMessage("E00801", txtMenuCategoryName.MaxLength.ToString());
            }
        }
Example #5
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!this.IsPostBack)
            {
                litPageTitle.Text           = GetLabelText("MenuCategory_Title");
                litMenuCategoryName.Text    = GetLabelText("Menucategory_MenuCategoryName");
                txtMenuCategoryName.ToolTip = GetLabelText("Menucategory_MenuCategoryName");

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

                    Johnny.CMS.BLL.SystemInfo.MenuCategory bll   = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
                    Johnny.CMS.OM.SystemInfo.MenuCategory  model = new Johnny.CMS.OM.SystemInfo.MenuCategory();
                    model = bll.GetModel(MenuCategoryId);

                    txtMenuCategoryName.Text = model.MenuCategoryName;

                    btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save;
                    //btnAdd.Text = CONST_BUTTONTEXT_SAVE;
                }

                //RFVldtMenuCategoryName.ErrorMessage = GetMessage("E00801", txtMenuCategoryName.MaxLength.ToString());
            }
        }
Example #6
0
 //所有菜单栏目
 private void CreateAllItems(ListBox listcontrolleft)
 {
     Johnny.CMS.BLL.SystemInfo.MenuCategory bll = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
     listcontrolleft.DataSource = bll.GetList();
     listcontrolleft.DataTextField = "MenuCategoryName";
     listcontrolleft.DataValueField = "MenuCategoryId";
     listcontrolleft.DataBind();
 }
Example #7
0
 private void CreateddlCategory()
 {
     Johnny.CMS.BLL.SystemInfo.MenuCategory category = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
     ddlCategory.DataSource = category.GetList();
     ddlCategory.DataTextField = "MenuCategoryName";
     ddlCategory.DataValueField = "MenuCategoryId";
     ddlCategory.DataBind();
 }
Example #8
0
 //所有菜单栏目
 private void CreateAllItems(ListBox listcontrolleft)
 {
     Johnny.CMS.BLL.SystemInfo.MenuCategory bll = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
     listcontrolleft.DataSource     = bll.GetList();
     listcontrolleft.DataTextField  = "MenuCategoryName";
     listcontrolleft.DataValueField = "MenuCategoryId";
     listcontrolleft.DataBind();
 }
Example #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //菜单栏目
            Johnny.CMS.BLL.SystemInfo.MenuCategory        category      = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
            IList <Johnny.CMS.OM.SystemInfo.MenuCategory> categoryModel = category.GetList();

            //菜单
            Johnny.CMS.BLL.SystemInfo.Menu        menu      = new Johnny.CMS.BLL.SystemInfo.Menu();
            IList <Johnny.CMS.OM.SystemInfo.Menu> menuModel = menu.GetList(true);

            //用户权限
            Johnny.CMS.BLL.Access.Accounts accounts = new Johnny.CMS.BLL.Access.Accounts();
            ArrayList arrPermission = new ArrayList();

            arrPermission = accounts.GetUserPermission(DataConvert.GetString(Session["UserName"]));

            //顶部菜单与菜单类别
            int iTopMenuId = DataConvert.GetInt32(Request.QueryString["TopMenuId"]);

            if (iTopMenuId <= 0)
            {
                iTopMenuId = 1;
            }
            Johnny.CMS.BLL.SystemInfo.TopMenuBinding        topMainMenu      = new Johnny.CMS.BLL.SystemInfo.TopMenuBinding();
            IList <Johnny.CMS.OM.SystemInfo.TopMenuBinding> topMainMenuModel = topMainMenu.GetList(iTopMenuId);

            //生成左侧菜单导航栏
            foreach (Johnny.CMS.OM.SystemInfo.MenuCategory item in categoryModel)
            {
                if (CategoryContains(item.MenuCategoryId, topMainMenuModel))
                {
                    MainMenuItem mainmenu = new MainMenuItem();
                    mainmenu.Text = item.MenuCategoryName;

                    foreach (Johnny.CMS.OM.SystemInfo.Menu subitem in menuModel)
                    {
                        //判断是否属于该主菜单,并且具有访问权限
                        if (subitem.MenuCategoryId == item.MenuCategoryId && arrPermission.Contains(subitem.PermissionId))
                        {
                            SubMenuItem submenu = new SubMenuItem();
                            submenu.Text    = subitem.MenuName;
                            submenu.Url     = subitem.PageLink;
                            submenu.ToolTip = subitem.ToolTip;
                            submenu.Image   = subitem.Image;
                            mainmenu.SubItems.Add(submenu);
                        }
                    }

                    if (mainmenu.SubItems.Count > 0)
                    {
                        LeftMenu1.items.Add(mainmenu);
                    }
                }
            }
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //菜单栏目
            Johnny.CMS.BLL.SystemInfo.MenuCategory category = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
            IList<Johnny.CMS.OM.SystemInfo.MenuCategory> categoryModel = category.GetList();

            //菜单
            Johnny.CMS.BLL.SystemInfo.Menu menu = new Johnny.CMS.BLL.SystemInfo.Menu();
            IList<Johnny.CMS.OM.SystemInfo.Menu> menuModel = menu.GetList(true);
                        
            //用户权限
            Johnny.CMS.BLL.Access.Accounts accounts = new Johnny.CMS.BLL.Access.Accounts();
            ArrayList arrPermission = new ArrayList();
            arrPermission = accounts.GetUserPermission(DataConvert.GetString(Session["UserName"]));

            //顶部菜单与菜单类别
            int iTopMenuId = DataConvert.GetInt32(Request.QueryString["TopMenuId"]);
            if (iTopMenuId <= 0)
                iTopMenuId = 1;
            Johnny.CMS.BLL.SystemInfo.TopMenuBinding topMainMenu = new Johnny.CMS.BLL.SystemInfo.TopMenuBinding();
            IList<Johnny.CMS.OM.SystemInfo.TopMenuBinding> topMainMenuModel = topMainMenu.GetList(iTopMenuId);

            //生成左侧菜单导航栏
            foreach (Johnny.CMS.OM.SystemInfo.MenuCategory item in categoryModel)
            {
                if (CategoryContains(item.MenuCategoryId, topMainMenuModel))
                {
                    MainMenuItem mainmenu = new MainMenuItem();
                    mainmenu.Text = item.MenuCategoryName;

                    foreach (Johnny.CMS.OM.SystemInfo.Menu subitem in menuModel)
                    {
                        //判断是否属于该主菜单,并且具有访问权限
                        if (subitem.MenuCategoryId == item.MenuCategoryId && arrPermission.Contains(subitem.PermissionId))
                        {
                            SubMenuItem submenu = new SubMenuItem();
                            submenu.Text = subitem.MenuName;
                            submenu.Url = subitem.PageLink;
                            submenu.ToolTip = subitem.ToolTip;
                            submenu.Image = subitem.Image;
                            mainmenu.SubItems.Add(submenu);
                        }
                    }

                    if (mainmenu.SubItems.Count > 0)
                        LeftMenu1.items.Add(mainmenu);
                }
            }
        }
Example #11
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.MenuCategory bll = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
                    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.MenuCategory bll = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
                    bll.Delete(DataConvert.GetInt32(strId));

                }
            }

            SetMessage(GetMessage("C00005"));

            //update grid
            getData();
        }
Example #13
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            //check category name
            if (!CheckInputEmptyAndLength(txtMenuCategoryName, "E00801", "E00802", false))
            {
                return;
            }

            Johnny.CMS.BLL.SystemInfo.MenuCategory bll   = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
            Johnny.CMS.OM.SystemInfo.MenuCategory  model = new Johnny.CMS.OM.SystemInfo.MenuCategory();

            if (Request.QueryString["action"] == "modify")
            {
                //update
                model.MenuCategoryId   = Convert.ToInt32(Request.QueryString["id"]);
                model.MenuCategoryName = txtMenuCategoryName.Text;

                bll.Update(model);
                SetMessage(GetMessage("C00003"));
            }
            else
            {
                //insert
                model.MenuCategoryName = txtMenuCategoryName.Text;

                if (bll.Add(model) > 0)
                {
                    SetMessage(GetMessage("C00001"));
                    txtMenuCategoryName.Text = "";
                }
                else
                {
                    SetMessage(GetMessage("C00002"));
                }
            }
        }
Example #14
0
 private void CreateddlCategory()
 {
     Johnny.CMS.BLL.SystemInfo.MenuCategory category = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
     ddlCategory.DataSource = category.GetList();
     ddlCategory.DataTextField = "MenuCategoryName";
     ddlCategory.DataValueField = "MenuCategoryId";
     ddlCategory.DataBind();
 }
Example #15
0
 public override void getData()
 {
     Johnny.CMS.BLL.SystemInfo.MenuCategory bll = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
     myManageGridView.DataSource = bll.GetList();
     myManageGridView.DataBind();
 }
 public override void getData()
 {
     Johnny.CMS.BLL.SystemInfo.MenuCategory bll = new Johnny.CMS.BLL.SystemInfo.MenuCategory();
     myManageGridView.DataSource = bll.GetList();
     myManageGridView.DataBind();
 }