Пример #1
0
        public ActionResult AddLinks()
        {
            DSRCManagementSystem.Models.QuickLinks objmodel = new DSRCManagementSystem.Models.QuickLinks();
            try
            {
                var userid    = Convert.ToInt32(Session["UserID"].ToString());
                var RoleID    = Session["RoleId"];
                var Functions = db.Functions.ToList();

                var modules = from p in db.Modules
                              join f in db.RoleFunctionPrivileges on p.PageModuleID equals f.PageModuleID
                              join q in db.UserRoles on f.RoleID equals q.RoleID
                              where q.UserID == userid
                              select p;
                ViewBag.ModuleList = new SelectList(new[] { new Module()
                                                            {
                                                                PageModuleID = 0, ModuleName = ""
                                                            } }.Union(modules.Distinct()).OrderBy(o => o.ModuleName), "PageModuleID", "ModuleName");

                objmodel.path = "../../UsersData/Logo/Images/No_Image.png";
            }

            catch (Exception ex)
            {
                throw ex;
            }
            return(View(objmodel));
        }
Пример #2
0
        public ActionResult QuickLinks()
        {
            DSRCManagementSystem.Models.QuickLinks objmodel = new DSRCManagementSystem.Models.QuickLinks();
            var userid       = Convert.ToInt32(Session["UserID"].ToString());
            var LinksDetails = (from p in db.ManageQuickLinks
                                join m in db.Modules on p.PageModuleID equals m.PageModuleID
                                where p.IsActive == true && p.UserID == userid
                                select new QuickLinks()
            {
                path = p.IconPath,
                QuickLinkID = p.QuickLinkID,
                PageModuleID = m.PageModuleID,
                ModuleName = m.ModuleName,
                DisplayName = p.DisplayName
            }).ToList();


            return(View(LinksDetails));
        }