Ejemplo n.º 1
0
        private void Del()
        {
            string code = HttpContext.Current.Request["id"].ToString();
            RoleFactory bll = new RoleFactory();

            HttpContext.Current.Response.Write(bll.Del(code));
        }
Ejemplo n.º 2
0
        private void GetMagList()
        {
            string sql = "";
            int iStart = 0;
            try
            {
                iStart = int.Parse(HttpContext.Current.Request["pageIndex"].ToString()) * int.Parse(HttpContext.Current.Request["pageSize"].ToString());
            }
            catch { }
            int iLimit = 20;
            try
            {
                iLimit = int.Parse(HttpContext.Current.Request["pageSize"].ToString());
            }
            catch { }

            string RoleName = string.Empty;
            try
            {
                RoleName = HttpContext.Current.Request["RoleName"].ToString();
            }
            catch
            { }
            if (!string.IsNullOrEmpty(RoleName))
            {
                sql += "and RoleName like '%" + RoleName + "%' ";
            }
            string IsEnable = string.Empty;
            try
            {
                IsEnable = HttpContext.Current.Request["IsEnable"].ToString();
            }
            catch
            { }
            if (!string.IsNullOrEmpty(IsEnable))
            {
                sql += "and IsEnable = '" + IsEnable + "' ";
            }

            RoleFactory bll = new RoleFactory();
            HttpContext.Current.Response.Write(bll.GetMagList(sql, iStart, iLimit));
        }
Ejemplo n.º 3
0
 private void GetFunctionTree()
 {
     string id = HttpContext.Current.Request["id"].ToString();
     RoleFactory bll = new RoleFactory();
     HttpContext.Current.Response.Write(bll.GetFunctionTree(id));
 }
Ejemplo n.º 4
0
 private void SaveRights()
 {
     string RoleID = string.Empty;
     try
     {
         RoleID = HttpContext.Current.Request["RoleID"].ToString();
     }
     catch { }
     if (string.IsNullOrEmpty(RoleID))
     {
         HttpContext.Current.Response.Write(JsonMessage.FailString("参数丢失!"));
         return;
     }
     string Rights = string.Empty;
     try
     {
         Rights = HttpContext.Current.Request["rights"].ToString();
     }
     catch { }
     RoleFactory bll = new RoleFactory();
     HttpContext.Current.Response.Write(bll.SaveRights(RoleID, Rights));
 }
Ejemplo n.º 5
0
        private void Save()
        {
            string json = string.Empty;
            try
            {
                json = HttpContext.Current.Request["json"].ToString();
            }
            catch { }
            if (string.IsNullOrEmpty(json))
            {
                HttpContext.Current.Response.Write(JsonMessage.FailString("参数丢失!"));
                return;
            }

            Sys_Role table = JsonHelper.DeserializeData<Sys_Role>(json);
            RoleFactory bll = new RoleFactory();
            HttpContext.Current.Response.Write(bll.Save(table));
        }