コード例 #1
0
 /// <summary>
 /// 保存信息
 /// </summary>
 protected void Save()
 {
     SOSOshop.BLL.Role   bll   = new SOSOshop.BLL.Role();
     SOSOshop.Model.Role model = new SOSOshop.Model.Role();
     model.Name        = this.txtRoleName.Text.Trim();
     model.Description = this.txtDescription.Text.Trim();
     if (ViewState["ID"] != null)
     {
         model.ID = int.Parse(ViewState["ID"].ToString());
         bll.Amend(model);
         this.ltlMsg.Text     = "操作成功,已保存该信息";
         this.pnlMsg.Visible  = true;
         this.pnlMsg.CssClass = "actionOk";
         #region 后台用户操作日志记录
         SOSOshop.Model.AdminInfo adminInfo = SOSOshop.BLL.AdministrorManager.Get();
         SOSOshop.BLL.Logs.Log.LogAdminAdd("修改角色", (adminInfo == null ? 0 : adminInfo.AdminId), (adminInfo == null ? "" : adminInfo.AdminName), 1);
         #endregion
     }
     else
     {
         bll.Create(model);
         this.ltlMsg.Text     = "操作成功,已保存该信息";
         this.pnlMsg.Visible  = true;
         this.pnlMsg.CssClass = "actionOk";
         #region 后台用户操作日志记录
         SOSOshop.Model.AdminInfo adminInfo = SOSOshop.BLL.AdministrorManager.Get();
         SOSOshop.BLL.Logs.Log.LogAdminAdd("添加角色", (adminInfo == null ? 0 : adminInfo.AdminId), (adminInfo == null ? "" : adminInfo.AdminName), 1);
         #endregion
     }
 }
コード例 #2
0
 private void del(int id)
 {
     SOSOshop.BLL.Role bll = new SOSOshop.BLL.Role();
     if (bll.Delete(id) > 0)
     {
         Response.Write("ok");
     }
 }
コード例 #3
0
 protected void BandInfo(int id)
 {
     SOSOshop.BLL.Role   bll   = new SOSOshop.BLL.Role();
     SOSOshop.Model.Role model = bll.GetModelID(id);
     this.txtRoleName.Text    = model.Name;
     this.txtDescription.Text = model.Description;
     ViewState["ID"]          = model.ID;
 }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SOSOshop.BLL.PromptInfo.Popedom("007002006", "对不起,您没有权限进行设置");
         int roleid = ChangeHope.WebPage.PageRequest.GetQueryInt("id");
         if (roleid > 0)
         {
             ViewState["RoleId"] = roleid;
             SOSOshop.BLL.Role   bll   = new SOSOshop.BLL.Role();
             SOSOshop.Model.Role model = bll.GetModelID(roleid);
             if (model != null)
             {
                 this.lbRoleName.Text        = model.Name;
                 this.lbRoleDescription.Text = model.Description;
                 this.BindInfo(roleid.ToString());
             }
         }
     }
 }
コード例 #5
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected string GetList()
        {
            SOSOshop.BLL.SysParameter      sp       = new SOSOshop.BLL.SysParameter();
            ChangeHope.WebPage.Table       table    = new ChangeHope.WebPage.Table();
            SOSOshop.BLL.Role              data     = new SOSOshop.BLL.Role();
            ChangeHope.DataBase.DataByPage dataPage = data.GetList();
            //第一步先添加表头
            table.AddHeadCol("10%", "序号");
            table.AddHeadCol("25%", "角色名");
            table.AddHeadCol("40%", "描述");
            table.AddHeadCol("25%", "操作");
            table.AddRow();
            //添加表的内容
            if (dataPage.DataReader != null)
            {
                int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
                if (curpage < 0)
                {
                    curpage = 1;
                }
                int count = 0;
                while (dataPage.DataReader.Read())
                {
                    count++;
                    string No = (15 * (curpage - 1) + count).ToString();
                    table.AddCol("No." + No);
                    table.AddCol(dataPage.DataReader["name"].ToString());
                    table.AddCol(dataPage.DataReader["description"].ToString());
                    table.AddCol(string.Format("<a href=role_edit.aspx?id={0}>编辑</a> <a href='role_setmember.aspx?id={0}'>设置成员</a> <a href='popedom_manage.aspx?id={0}'>权限管理</a> <a href='#' onclick='Del({0})'>删除</a>", dataPage.DataReader["id"].ToString()));

                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;

            dataPage.Dispose();
            dataPage = null;
            return(view);
        }