Ejemplo n.º 1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public string DelSysRole()
        {
            int  id = Convert.ToInt32(Request.QueryString["id"]);
            bool b  = new DAL.sys_role().Delete(id);

            return(b ? "success" : "fail");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取角色权限
        /// </summary>
        /// <returns></returns>
        public static DataRow GetSysRole()
        {
            int     roleid = Convert.ToInt32(DAL.AccountDAL.U_roleid());
            DataRow dr     = DB.CatchTo.Get("role" + roleid) as DataRow;

            if (dr == null)
            {
                dr = new DAL.sys_role().GetList("r_state=1 and id=" + roleid).Tables[0].Rows[0];
                DB.CatchTo.Set("role" + roleid, dr);
            }
            return(dr);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="mo"></param>
        /// <returns></returns>
        public string SaveSysRole(Model.sys_role mo)
        {
            string savetype = Request.QueryString["savetype"].ToString();

            mo.r_state = string.IsNullOrEmpty(Request.Form["r_state"]) ? 0 : 1;

            bool b = false;

            if (savetype == "0")
            {
                if (new DAL.sys_role().Add(mo) >= 0)
                {
                    b = true;
                }
            }
            else
            {
                mo.id = Convert.ToInt32(savetype);
                b     = new DAL.sys_role().Update(mo);
            }
            return(b ? "success" : "fail");
        }