示例#1
0
        public ActionResult UpdateGolbal(GlobalSetting globalModel)
        {
            GlobalSetting entity = GlobalSettingManager.GetGlobalCache();

            globalModel.ID = entity.ID;
            GlobalSettingManager.SaveOrUpdate(globalModel);
            GlobalSettingManager.SetGlobalCache();

            return(Content("1"));
        }
示例#2
0
        //
        // GET: /System/

        public ActionResult Index()
        {
            ViewData["companyName"]  = GlobalSettingManager.GetGlobalCache().CompanyName;
            ViewData["isProvince"]   = GlobalSettingManager.GetGlobalCache().IsProvince;
            ViewData["isCity"]       = GlobalSettingManager.GetGlobalCache().IsCity;
            ViewData["isRegion"]     = GlobalSettingManager.GetGlobalCache().IsRegion;
            ViewData["isDepartment"] = GlobalSettingManager.GetGlobalCache().IsDepartment;
            ViewData["SystemModel"]  = SystemModelManager.LoadAll();
            ViewData["Province"]     = ProvinceManager.LoadAll();
            ViewData["City"]         = CityManager.LoadAll();
            ViewData["Region"]       = RegionManager.LoadAll();
            ViewData["Department"]   = DepartmentManager.LoadAll();
            ViewData["Role"]         = RoleManager.LoadAll();
            ViewData["SysUser"]      = UserInfoManager.LoadAll();
            ViewData["NullGuid"]     = new Guid();
            return(View());
        }
示例#3
0
        public ActionResult Index()
        {
            GlobalSettingManager.SetGlobalCache();
            ViewData["companyName"] = GlobalSettingManager.GetGlobalCache().CompanyName;
            if (UserInfoManager.IfLogOn())
            {
                ViewData["name"]   = UserInfoManager.GetUserSession().Name;
                ViewData["userId"] = UserInfoManager.GetUserSession().ID.ToString();
                string avatarString = UserInfoManager.GetUserAvatar();
                ViewData["avatar"]  = avatarString == "" ? "../../Upload/Avatar/DefaultAvatar.jpg" : avatarString;
                ViewData["visible"] = UserInfoManager.GetUserSession().IsAdmin;
                // 侧边栏加载系统模块菜单
                ViewData["SystemModel"] = SystemModelManager.LoadAll();

                // 显示签到按钮操作
                Registration registrationObj = RegistrationManager.GetDayRegistration(UserInfoManager.GetUserSession().ID, DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                if (registrationObj == null)
                {
                    ViewData["registration"] = "签到";
                }
                else
                {
                    ViewData["registration"] = "下班";
                }

                UserInfo user = UserInfoManager.GetUserSession();

                ViewData["EmailReceiveUserRelation"] = EmailReceiveUserRelationManager.LoadAll().Where(f => f.ReceiveUser.ID == user.ID).Take(5);
                ViewData["TaskReceiveUserRelation"]  = TaskReceiveUserRelationManager.LoadAll().Where(f => f.ReceiveUser.ID == user.ID).Take(5);
                ViewData["Notice"]       = NoticeManager.LoadAll().Where(f => f.ReceiveUser.ID == user.ID);
                ViewData["MyEmailCount"] = ((IEnumerable <EmailReceiveUserRelation>)ViewData["EmailReceiveUserRelation"]).Count();
                ViewData["MyTaskCount"]  = ((IEnumerable <TaskReceiveUserRelation>)ViewData["TaskReceiveUserRelation"]).Count();
                ViewData["NoticeCount"]  = ((IEnumerable <Notice>)ViewData["Notice"]).Count();

                return(View());
            }
            else
            {
                return(View("LogOn"));
            }
        }
示例#4
0
 public ActionResult LogOn()
 {
     ViewData["companyName"] = GlobalSettingManager.GetGlobalCache().CompanyName;
     return(View());
 }