Esempio n. 1
0
        public ActionResult SystemGroupDelete()
        {
            string g_gid  = Request["g_gid"] ?? string.Empty;
            int    result = SystemSeviceClass.SystemGroup_DeleteByg_gid(g_gid);

            if (result > 0)
            {
                return(Json(new { success = true, errors = new { text = "删除成功" } }));
            }
            else
            {
                return(Json(new { success = false, errors = new { text = "删除失败" } }));
            }
        }
Esempio n. 2
0
        public ActionResult ModuleDelete()
        {
            string m_gid  = Request["m_gid"] ?? string.Empty;
            int    result = SystemSeviceClass.SystemModual_DeleteBym_gid(m_gid);

            if (result > 0)
            {
                return(Json(new { success = true, errors = new { text = "删除成功" } }));
            }
            else
            {
                return(Json(new { success = false, errors = new { text = "删除失败" } }));
            }
        }
Esempio n. 3
0
        public ActionResult RoleDelete()
        {
            string r_gid  = Request["r_gid"] ?? string.Empty;
            int    result = SystemSeviceClass.Role_DeleteByr_gid(r_gid);

            if (result > 0)
            {
                return(Json(new { success = true, errors = new { text = "删除成功" } }));
            }
            else
            {
                return(Json(new { success = true, errors = new { text = "删除失败" } }));
            }
        }
Esempio n. 4
0
        public ActionResult PermissionDelete()
        {
            string p_gid  = Request["p_gid"] ?? string.Empty;
            int    result = SystemSeviceClass.ModulePermission_DeleteByp_gid(p_gid);

            if (result > 0)
            {
                return(Json(new { success = true, errors = new { text = "删除成功" } }));
            }
            else
            {
                return(Json(new { success = true, errors = new { text = "删除失败" } }));
            }
        }
Esempio n. 5
0
        //查询对应模块组下的一级元素
        public ActionResult ModuleSearch()
        {
            string g_gid    = Request["g_gid"] ?? string.Empty;
            int?   m_parent = (Request["m_parent"] ?? string.Empty) == string.Empty ? (int?)null : Request["m_parent"].ToInt32();

            SystemModuleSearchInfo search = new SystemModuleSearchInfo()
            {
                m_g_gid  = g_gid,
                m_parent = m_parent
            };
            int rowCount;
            List <SystemModual> list = SystemSeviceClass.SystemModual_SelectPage(search, 1, 100, out rowCount);

            return(Json(list, "text/html", JsonRequestBehavior.AllowGet));
        }
 //判断登录
 private bool IsLogin()
 {
     if (System.Web.HttpContext.Current.Session[Entity.UserSessionKey] == null)
     {
         if (System.Web.HttpContext.Current.Request.Cookies["name"] != null)
         {
             string name = System.Web.HttpContext.Current.Request.Cookies["name"].Value;
             User   info = SystemSeviceClass.User_SelectByu_name(name);
             System.Web.HttpContext.Current.Session[Entity.UserSessionKey] = info;
             return(true);
         }
         return(false);
     }
     return(true);
 }
Esempio n. 7
0
        public ActionResult RoleEdit()
        {
            string r_gid  = Request["r_gid"] ?? string.Empty;
            string r_name = Request["r_name"] ?? string.Empty;

            Role info = null;

            if (string.IsNullOrEmpty(r_gid))
            {
                info = new Role();
                //新增
                string guid = Guid.NewGuid().ToString().Substring(0, 8);
                info.r_gid        = guid;
                info.r_createTime = DateTime.Now;
                info.r_createUser = SiteHelp.CurrentUserName;
            }
            else
            {
                info = SystemSeviceClass.Role_SelectByr_gid(r_gid);
            }
            info.r_name = r_name;


            if (string.IsNullOrEmpty(r_gid))
            {
                int result = SystemSeviceClass.Role_Insert(info);
                if (result > 0)
                {
                    return(Json(new { success = true, errors = new { text = "新增成功" } }));
                }
                else
                {
                    return(Json(new { success = false, errors = new { text = "新增失败" } }));
                }
            }
            else
            {
                int result = SystemSeviceClass.Role_UpdateByr_gid(info);
                if (result > 0)
                {
                    return(Json(new { success = true, errors = new { text = "修改成功" } }));
                }
                else
                {
                    return(Json(new { success = false, errors = new { text = "修改失败" } }));
                }
            }
        }
Esempio n. 8
0
        //重置密码
        public ActionResult UserEditPwd(string u_gid, string u_password)
        {
            SiteFrame.Model.User info = SystemSeviceClass.User_SelectByu_gid(u_gid);
            info.u_password = Entity.Str2Md5(u_password);

            int result = SystemSeviceClass.User_UpdateByu_gid(info);

            if (result > 0)
            {
                return(Json(new { success = true, errors = new { text = "重置密码成功" } }));
            }
            else
            {
                return(Json(new { success = false, errors = new { text = "重置密码失败" } }));
            }
        }
Esempio n. 9
0
        public ActionResult ModuleList()
        {
            SystemGroupSearchInfo groupSearch = new SystemGroupSearchInfo();
            int rowcount;
            //查询所有模块组下的,所有的模块信息
            List <SystemGroup> groupList = SystemSeviceClass.SystemGroup_SelectPage(groupSearch, 1, 100, out rowcount);

            //查询所有模块信息
            SystemModuleSearchInfo search     = new SystemModuleSearchInfo();
            List <SystemModual>    moduleList = SystemSeviceClass.SystemModual_SelectPage(search, 1, 1000, out rowcount);

            ViewData["groupList"]  = groupList;
            ViewData["moduleList"] = moduleList;

            return(View());
        }
Esempio n. 10
0
        public ActionResult PermissionListView()
        {
            string m_gid = Request["m_gid"] ?? string.Empty;

            int rowCount;
            //查询所有的模块
            SystemPermissionSearchInfo search = new SystemPermissionSearchInfo()
            {
                p_m_gid = m_gid
            };
            List <ModulePermission> list = SystemSeviceClass.ModulePermission_SelectPage(search, 1, 100, out rowCount);

            ViewData["window"] = Request["window"] ?? string.Empty;
            ViewData["list"]   = list;
            ViewData["m_gid"]  = m_gid;

            return(View());
        }
Esempio n. 11
0
        public ActionResult GroupEditView()
        {
            string      g_gid = Request["g_gid"] ?? string.Empty;
            SystemGroup info  = null;

            if (string.IsNullOrEmpty(g_gid))
            {
                info = new SystemGroup();
            }
            else
            {
                info = SystemSeviceClass.SystemGroup_SelectByg_gid(g_gid);
            }

            ViewData["window"] = Request["window"] ?? string.Empty;
            ViewData["info"]   = info;
            return(View());
        }
Esempio n. 12
0
        public ActionResult UserEditView()
        {
            string gid    = Request["gid"] ?? string.Empty;
            string window = Request["window"] ?? string.Empty;

            SiteFrame.Model.User info = null;
            if (!string.IsNullOrEmpty(gid))
            {
                info = SystemSeviceClass.User_SelectByu_gid(gid);
            }
            else
            {
                info = new User();
            }
            ViewBag.uInfo      = info;
            ViewData["window"] = window;

            return(View());
        }
Esempio n. 13
0
        public ActionResult RoleEditView()
        {
            string r_gid  = Request["r_gid"] ?? string.Empty;
            string window = Request["window"] ?? string.Empty;

            Role info = null;

            if (string.IsNullOrEmpty(r_gid))
            {
                info = new Role();
            }
            else
            {
                info = SystemSeviceClass.Role_SelectByr_gid(r_gid);
            }

            ViewData["window"] = window;
            ViewData["info"]   = info;
            return(View());
        }
Esempio n. 14
0
        //查询角色 对应的 模块下的 所有权限
        public ActionResult PerListView()
        {
            //模块gid
            string m_gid = Request["m_gid"] ?? string.Empty;
            //角色gid
            string ruid = Request["ruid"] ?? string.Empty;

            //查询 角色 已有该模块下的 哪些权限
            List <ModulePermission> rpList = SystemSeviceClass.ModulePermission_SelectModulePerByRoleGid(ruid, m_gid);

            SystemPermissionSearchInfo search = new SystemPermissionSearchInfo()
            {
                p_m_gid = m_gid
            };
            int rowcount;
            //模块下的所有权限
            List <ModulePermission> pList = SystemSeviceClass.ModulePermission_SelectPage(search, 1, 100, out rowcount);

            //bool:角色是否有该权限
            Dictionary <ModulePermission, bool> mbDic = new Dictionary <ModulePermission, bool>();

            foreach (ModulePermission item in pList)
            {
                if (rpList.Where(u => u.p_gid == item.p_gid).Count() > 0)
                {
                    mbDic.Add(item, true);
                }
                else
                {
                    mbDic.Add(item, false);
                }
            }

            ViewBag.mbDic = mbDic;
            ViewBag.ruid  = ruid;
            ViewBag.m_gid = m_gid;

            return(PartialView());
        }
Esempio n. 15
0
        public ActionResult RoleListView()
        {
            int page     = Request["page"].ToString().ToInt32(1);
            int pageSize = Request["pagesize"].ToString().ToInt32(15);
            //搜索关键字
            string r_name = Request["r_name"] ?? string.Empty;

            int rowCount;
            //查询所有的模块
            SystemRoleSearchInfo search = new SystemRoleSearchInfo()
            {
                r_name = r_name
            };
            List <Role> list = SystemSeviceClass.Role_SelectPage(search, page, pageSize, out rowCount);

            ViewData["list"] = list;

            ViewData["page"]     = page;
            ViewData["pageSize"] = pageSize;
            ViewData["rowCount"] = rowCount;

            return(PartialView());
        }
Esempio n. 16
0
        public ActionResult ModuleEditView()
        {
            string       m_gid  = Request["m_gid"] ?? string.Empty;
            string       window = Request["window"] ?? string.Empty;
            SystemModual info   = null;

            if (string.IsNullOrEmpty(m_gid))
            {
                info = new SystemModual();
            }
            else
            {
                info = SystemSeviceClass.SystemModual_SelectBym_gid(m_gid);
            }
            SystemGroupSearchInfo groupSearch = new SystemGroupSearchInfo();
            int rowCount;
            List <SystemGroup> gList = SystemSeviceClass.SystemGroup_SelectPage(groupSearch, 1, 100, out rowCount);

            ViewData["window"] = window;
            ViewData["gList"]  = gList;
            ViewData["info"]   = info;
            return(View());
        }
Esempio n. 17
0
        public ActionResult SystemGroupEdit()
        {
            string g_gid      = Request["g_gid"] ?? string.Empty;
            string g_name     = Request["g_name"] ?? string.Empty;
            string g_picCover = Request["g_picCover"] ?? string.Empty;
            int    m_sort     = Request["g_sort"].ToInt32(0);

            HttpPostedFileBase fb = Request.Files["coverFile"];

            SystemGroup info = null;

            if (string.IsNullOrEmpty(g_gid))
            {
                info = new SystemGroup();
                //新增
                info.g_gid        = Entity.GenerateGUID();
                info.g_createTime = DateTime.Now;
                info.g_createUser = SiteHelp.CurrentUserName;
            }
            else
            {
                info = SystemSeviceClass.SystemGroup_SelectByg_gid(g_gid);
            }
            info.g_name = g_name;
            info.g_sort = m_sort;

            if (fb != null && fb.ContentLength > 0)
            {
                string fileName = "/ImageIcon/" + fb.FileName;
                fb.SaveAs(Server.MapPath("~" + fileName));
                info.g_picCover = fileName;
            }
            else
            {
                info.g_picCover = g_picCover;
            }

            if (string.IsNullOrEmpty(g_gid))
            {
                int result = SystemSeviceClass.SystemGroup_Insert(info);
                if (result > 0)
                {
                    return(Json(new { success = true, errors = new { text = "新增成功" } }));
                }
                else
                {
                    return(Json(new { success = false, errors = new { text = "新增失败" } }));
                }
            }
            else
            {
                int result = SystemSeviceClass.SystemGroup_UpdateByg_gid(info);
                if (result > 0)
                {
                    return(Json(new { success = true, errors = new { text = "修改成功" } }));
                }
                else
                {
                    return(Json(new { success = false, errors = new { text = "修改失败" } }));
                }
            }
        }
Esempio n. 18
0
        public ActionResult ModuleEdit()
        {
            string m_gid        = Request["m_gid"] ?? string.Empty;
            string m_name       = Request["m_name"] ?? string.Empty;
            string g_gid        = Request["moduleGroup"] ?? string.Empty;
            string moduleGrade  = Request["moduleGrade"] ?? string.Empty;
            string m_controller = Request["m_controller"] ?? string.Empty;
            string m_action     = Request["m_action"] ?? string.Empty;
            string modulePart   = Request["modulePart"] ?? string.Empty;
            string m_path       = Request["m_path"] ?? string.Empty;


            SystemModual info = null;

            if (string.IsNullOrEmpty(m_gid))
            {
                info = new SystemModual();
                //新增
                string guid = Guid.NewGuid().ToString().Substring(0, 8);
                info.m_gid        = guid;
                info.m_g_gid      = g_gid;
                info.m_createTime = DateTime.Now;
                info.m_createUser = SiteHelp.CurrentUserName;
            }
            else
            {
                info = SystemSeviceClass.SystemModual_SelectBym_gid(m_gid);
            }

            if (moduleGrade == "0")//一级元素
            {
                info.m_parent     = 0;
                info.m_parent_gid = string.Empty;
            }
            else if (moduleGrade == "1" && !string.IsNullOrEmpty(modulePart))//二级元素
            {
                info.m_parent     = modulePart.Split(new[] { "-" }, StringSplitOptions.RemoveEmptyEntries)[0].ToInt32();
                info.m_parent_gid = modulePart.Split(new[] { "-" }, StringSplitOptions.RemoveEmptyEntries)[1];
            }
            info.m_path       = m_path;
            info.m_name       = m_name;
            info.m_Controller = m_controller;
            info.m_Action     = m_action;

            if (string.IsNullOrEmpty(m_gid))
            {
                int result = SystemSeviceClass.SystemModual_Insert(info);
                if (result > 0)
                {
                    return(Json(new { success = true, errors = new { text = "新增成功" } }));
                }
                else
                {
                    return(Json(new { success = false, errors = new { text = "新增失败" } }));
                }
            }
            else
            {
                int result = SystemSeviceClass.SystemModual_UpdateBym_gid(info);
                if (result > 0)
                {
                    return(Json(new { success = true, errors = new { text = "修改成功" } }));
                }
                else
                {
                    return(Json(new { success = false, errors = new { text = "修改失败" } }));
                }
            }
        }