Beispiel #1
0
        public ActionResult GetTreeJson(string keyword)
        {
            var data = moduleBLL.GetList();

            if (!string.IsNullOrEmpty(keyword))
            {
                data = data.TreeWhere(t => t.FullName.Contains(keyword), "");
            }
            var treeList = new List <TreeEntity>();

            foreach (ModuleEntity item in data)
            {
                TreeEntity tree        = new TreeEntity();
                bool       hasChildren = data.Count(t => t.ParentId == item.ModuleId) == 0 ? false : true;
                tree.id          = item.ModuleId;
                tree.text        = item.FullName;
                tree.value       = item.ModuleId;
                tree.isexpand    = true;
                tree.complete    = true;
                tree.hasChildren = hasChildren;
                tree.parentId    = item.ParentId;
                tree.img         = item.Icon;
                treeList.Add(tree);
            }
            return(Content(treeList.TreeToJson()));
        }
Beispiel #2
0
        public ActionResult ModuleTreeJson(string postId)
        {
            var existModule = permissionBLL.GetModuleList(postId).ToList();
            var data        = moduleBLL.GetList();
            var treeList    = new List <TreeEntity>();

            foreach (ModuleEntity item in data)
            {
                TreeEntity tree        = new TreeEntity();
                bool       hasChildren = data.Count(t => t.ParentId == item.Id) != 0;
                tree.id          = item.Id;
                tree.text        = item.FullName;
                tree.value       = item.Id;
                tree.title       = "";
                tree.checkstate  = existModule.Count(t => t.ItemId == item.Id);
                tree.showcheck   = true;
                tree.isexpand    = true;
                tree.complete    = true;
                tree.hasChildren = hasChildren;
                tree.parentId    = item.ParentId;
                tree.img         = item.Icon;
                treeList.Add(tree);
            }
            return(Content(treeList.TreeToJson()));
        }
Beispiel #3
0
        public ActionResult GetTreeJson(string keyword, string target)
        {
            var data = moduleBLL.GetList();

            if (!string.IsNullOrEmpty(keyword))
            {
                data = data.TreeWhere(t => t.F_FullName.Contains(keyword), "F_ModuleId");
            }
            if (!string.IsNullOrEmpty(target))
            {
                data = data.TreeWhere(t => t.F_Target.Contains(target), "F_ModuleId");
            }
            var treeList = new List <TreeEntity>();

            foreach (ModuleEntity item in data)
            {
                TreeEntity tree        = new TreeEntity();
                bool       hasChildren = data.Count(t => t.F_ParentId == item.F_ModuleId) == 0 ? false : true;
                tree.id             = item.F_ModuleId;
                tree.text           = item.F_FullName;
                tree.value          = item.F_ModuleId;
                tree.isexpand       = item.F_AllowExpand == 0?false:true;
                tree.complete       = true;
                tree.hasChildren    = hasChildren;
                tree.parentId       = item.F_ParentId;
                tree.img            = item.F_Icon;
                tree.Attribute      = "F_Target";
                tree.AttributeValue = item.F_Target;
                treeList.Add(tree);
            }
            var tree2 = treeList.TreeToJson();

            return(Content(tree2));
        }
Beispiel #4
0
        public ActionResult SSJK()
        {
            var user = OperatorProvider.Provider.Current();

            ViewBag.deptId   = user.DeptId;
            ViewBag.deptName = user.DeptName;
            ModuleBLL moduleBLL = new ModuleBLL();
            var       module    = new ModuleEntity();
            var       list      = moduleBLL.GetList().Where(x => x.UrlAddress != "" && x.UrlAddress != null);

            module           = list.Where(x => x.UrlAddress.Contains("/Works/WorkMeeting/Index3")).FirstOrDefault();//班会
            ViewBag.meetid   = module.ModuleId;
            ViewBag.meeturl  = module.UrlAddress;
            ViewBag.meettext = module.FullName;
            module           = list.Where(x => x.UrlAddress.Contains("/Works/Education/Index4")).FirstOrDefault();//  /Works/Education/Index2
            ViewBag.eduid    = module.ModuleId;
            ViewBag.eduurl   = module.UrlAddress;
            ViewBag.edutext  = module.FullName;
            module           = list.Where(x => x.UrlAddress.Contains("/Works/Danger/Index2")).FirstOrDefault();//KYT
            ViewBag.kytid    = module.ModuleId;
            ViewBag.kyturl   = module.UrlAddress;
            ViewBag.kyttext  = module.FullName;
            module           = list.Where(x => x.UrlAddress.Contains("/Works/Activity/Index4")).FirstOrDefault();//KYT
            ViewBag.actid    = module.ModuleId;
            ViewBag.acturl   = module.UrlAddress;
            ViewBag.acttext  = module.FullName;

            ViewBag.cpname = Config.GetValue("CustomerModel");
            return(View());
        }
Beispiel #5
0
        public ActionResult ModuleButtonTreeJson(string jobId)
        {
            var existModuleButton = permissionBLL.GetModuleButtonList(jobId);
            var moduleData        = moduleBLL.GetList();
            var moduleButtonData  = moduleButtonBLL.GetList();
            var treeList          = new List <TreeEntity>();

            foreach (ModuleEntity item in moduleData)
            {
                TreeEntity tree = new TreeEntity();
                tree.id          = item.ModuleId;
                tree.text        = item.FullName;
                tree.value       = item.ModuleId;
                tree.checkstate  = existModuleButton.Count(t => t.ItemId == item.ModuleId);
                tree.showcheck   = true;
                tree.isexpand    = true;
                tree.complete    = true;
                tree.hasChildren = true;
                tree.parentId    = item.ParentId;
                tree.img         = item.Icon;
                treeList.Add(tree);
            }
            foreach (ModuleButtonEntity item in moduleButtonData)
            {
                TreeEntity tree        = new TreeEntity();
                bool       hasChildren = moduleButtonData.Count(t => t.ParentId == item.ModuleButtonId) == 0 ? false : true;
                tree.id    = item.ModuleButtonId;
                tree.text  = item.FullName;
                tree.value = item.ModuleButtonId;
                if (item.ParentId == "0")
                {
                    tree.parentId = item.ModuleId;
                }
                else
                {
                    tree.parentId = item.ParentId;
                }
                tree.checkstate  = existModuleButton.Count(t => t.ItemId == item.ModuleButtonId);
                tree.showcheck   = true;
                tree.isexpand    = true;
                tree.complete    = true;
                tree.img         = "fa fa-wrench " + item.ModuleId;
                tree.hasChildren = hasChildren;
                treeList.Add(tree);
            }
            return(Content(treeList.TreeToJson()));
        }
Beispiel #6
0
        public async Task <IActionResult> GetListJson()
        {
            try
            {
                TData <List <ModuleEntity> > obj = await moduleBLL.GetList();

                //var a1 = obj.data[0].moduleButtons;
                return(Json(obj));
            }
            catch (System.Exception ex)
            {
                throw;
            }
        }
Beispiel #7
0
 /// <summary>
 /// 根据菜单的名称获取菜单的信息(此菜单是系统菜单的,不是配置的菜单)
 /// </summary>
 /// <param name="moduleIdName"></param>
 /// <returns></returns>
 public object GetModuleInfoByName(string moduleIdName)
 {
     try
     {
         ModuleBLL bLL        = new ModuleBLL();
         var       moduleList = bLL.GetList();
         if (moduleIdName == null)
         {
             return(new { Code = -1, Count = 1, Info = "菜单的名称不能为空" });
         }
         else
         {
             var data = moduleList.FirstOrDefault(p => p.FullName.Equals(moduleIdName));
             return(new { Code = 0, Count = 1, Info = "获取数据成功", data });
         }
     }
     catch (Exception ex)
     {
         return(new { Code = -1, Info = "获取数据失败", ex.Message });
     }
 }
Beispiel #8
0
        public ActionResult GZTZ()
        {
            var module = new ModuleEntity();
            //int month = 1;
            //if (DateTime.Now.Month < 4) month = 1;
            //else if (DateTime.Now.Month < 7) month = 4;
            //else if (DateTime.Now.Month < 10) month = 7;
            //else if (DateTime.Now.Month <= 12) month = 10;
            //DateTime sdt = new DateTime(DateTime.Now.Year, month, 1);
            //var user = OperatorProvider.Provider.Current();

            //if (user.DeptId == "0") user.DeptCode = "0";

            //var total = 0;

            //var list = workmeetingbll.GetData(10000, 1, out total, new Dictionary<string, string>() { { "departmentid", user.DeptId }, { "meetingstarttime", sdt.ToString("yyyy-MM-dd") } });
            //ViewData["Count1"] = total;

            ////var list1 = workmeetingbll.GetBaseDataNew("", 10000, 1, out total).Where(x => x.CreateDate > sdt);
            //ViewData["Count2"] = service.GetAllDanger(user.DeptCode, sdt.ToString("yyyy-MM-dd"));

            //ViewData["Count3"] = service.GetAllActivity(user.DeptCode, sdt.ToString("yyyy-MM-dd"));
            //ViewData["Count4"] = service.GetAllEducation(user.DeptCode, sdt.ToString("yyyy-MM-dd"));
            //ViewData["Count5"] = service.GetAllLllegal(user.DeptId, sdt.ToString("yyyy-MM-dd"));
            //ViewData["Count6"] = service.GetAllEmergencyWork(user.DeptName, sdt.ToString("yyyy-MM-dd"));
            //ViewData["Count7"] = service.GetAllToolborrow(user.DeptCode, sdt.ToString("yyyy-MM-dd"));
            //ViewData["Count8"] = service.GetAllGlassStock(user.DeptCode, sdt.ToString("yyyy-MM-dd"));
            var user = OperatorProvider.Provider.Current();

            ViewBag.deptId   = user.DeptId;
            ViewBag.deptName = user.DeptName;
            ModuleBLL moduleBLL = new ModuleBLL();
            var       list      = moduleBLL.GetList().Where(x => x.UrlAddress != "" && x.UrlAddress != null);

            module            = list.Where(x => x.UrlAddress.Contains("/Works/WorkMeeting/Index2")).FirstOrDefault();//班会
            ViewBag.meetid    = module.ModuleId;
            ViewBag.meeturl   = module.UrlAddress;
            ViewBag.meettext  = module.FullName;
            module            = list.Where(x => x.UrlAddress.Contains("/Works/Danger/Index2")).FirstOrDefault();//KYT
            ViewBag.kytid     = module.ModuleId;
            ViewBag.kyturl    = module.UrlAddress;
            ViewBag.kyttext   = module.FullName;
            module            = list.Where(x => x.UrlAddress.Contains("/Works/Activity/Index3")).FirstOrDefault();//KYT
            ViewBag.actid     = module.ModuleId;
            ViewBag.acturl    = module.UrlAddress;
            ViewBag.acttext   = module.FullName;
            module            = list.Where(x => x.UrlAddress.Contains("/Works/Education/Index2")).FirstOrDefault();//教育培训
            ViewBag.eduid     = module.ModuleId;
            ViewBag.eduurl    = module.UrlAddress;
            ViewBag.edutext   = module.FullName;
            module            = list.Where(x => x.UrlAddress.Contains("/Works/Lllegal/Index2")).FirstOrDefault();//教育培训
            ViewBag.legalid   = module.ModuleId;
            ViewBag.legalurl  = module.UrlAddress;
            ViewBag.legaltext = module.FullName;
            module            = list.Where(x => x.UrlAddress.Contains("/Works/emergency/Index1")).FirstOrDefault();//教育培训
            ViewBag.emid      = module.ModuleId;
            ViewBag.emurl     = module.UrlAddress;
            ViewBag.emtext    = module.FullName;
            module            = list.Where(x => x.UrlAddress.Contains("/Works/Drug/Index")).FirstOrDefault();//教育培训
            ViewBag.glassid   = module.ModuleId;
            ViewBag.glassurl  = module.UrlAddress;
            ViewBag.glasstext = module.FullName;

            ViewBag.cpname = Config.GetValue("CustomerModel");
            return(View());
        }