/// <summary> /// btnSave_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { EyouSoft.Model.SysStructure.MComMenu1Info info = new EyouSoft.Model.SysStructure.MComMenu1Info(); info.MenuId = ComMenu1Id; info.Name = Utils.GetFormValue("txtMenu1Name"); info.SysId = SysId; info.ClassName = Utils.GetFormValue("radClassName"); info.Menu2s = new List <EyouSoft.Model.SysStructure.MComMenu2Info>(); info.IsDisplay = Utils.GetFormValue("chkIsDisplay") == "1"; string[] chkSysMenu2Ids = Utils.GetFormValues("chkSysMenu2Id"); foreach (var s in chkSysMenu2Ids) { int sysMenu2Id = Utils.GetInt(s, -1); if (sysMenu2Id <= 0) { continue; } EyouSoft.Model.SysStructure.MComMenu2Info item = new EyouSoft.Model.SysStructure.MComMenu2Info(); item.DefaultMenu2Id = sysMenu2Id; item.MenuId = Utils.GetInt(Utils.GetFormValue("txtComMenu2Id_" + sysMenu2Id)); item.Name = Utils.GetFormValue("txtComMenu2Name_" + sysMenu2Id); item.Url = Utils.GetFormValue("txtSysMenu2Url_" + sysMenu2Id); info.Menu2s.Add(item); } //数据未验证 EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); if (info.MenuId > 0) { if (bll.UpdateSysMenu(info) == 1) { RegisterAlertAndRedirectScript("修改成功", string.Format("menu.aspx?sysid={0}&cid={1}", SysId, CompanyId)); } else { RegisterAlertAndReloadScript("修改失败"); } } else { if (bll.CreateSysMenu(info) == 1) { RegisterAlertAndRedirectScript("添加成功", string.Format("menu.aspx?sysid={0}&cid={1}", SysId, CompanyId)); } else { RegisterAlertAndReloadScript("添加失败"); } } bll = null; }
/// <summary> /// btnSetAdminPrivsBySys_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSetSysPrivs_Click(object sender, EventArgs e) { IList <EyouSoft.Model.SysStructure.MComMenu2Info> privs = new List <EyouSoft.Model.SysStructure.MComMenu2Info>(); string[] p1s = Utils.GetFormValues("chk_p_1"); foreach (var p1 in p1s) { string[] p2s = Utils.GetFormValues("chk_p_2_p1v_" + p1); foreach (var p2 in p2s) { EyouSoft.Model.SysStructure.MComMenu2Info privs2 = new EyouSoft.Model.SysStructure.MComMenu2Info(); privs2.Privs = new List <EyouSoft.Model.SysStructure.MSysPrivsInfo>(); privs2.MenuId = Utils.GetInt(p2); string[] p3s = Utils.GetFormValues("chk_P_3_p2v_" + p2); foreach (var p3 in p3s) { privs2.Privs.Add(new EyouSoft.Model.SysStructure.MSysPrivsInfo() { PrivsId = Utils.GetInt(p3) }); } privs.Add(privs2); } } EyouSoft.BLL.SysStructure.BSys bll = new EyouSoft.BLL.SysStructure.BSys(); if (bll.SetSysPrivs(SysId, privs) == 1) { RegisterAlertAndRedirectScript("设置子系统权限成功", "systems.aspx"); } else { RegisterAlertAndReloadScript("设置子系统权限失败"); } bll = null; }