Пример #1
0
        public ActionResult Contacts()
        {
            var UsersList = UserManage.LoadListAll(p => p.ID != CurrentUser.Id).OrderBy(p => p.LEVELS).OrderBy(p => p.CREATEDATE).Select(p => new
            {
                p.ID,
                FaceImg = string.IsNullOrEmpty(p.FACE_IMG) ? "/Pro/Project/User_Default_Avatat?name=" + p.NAME.Substring(0, 1) : p.FACE_IMG,
                p.NAME,
                HuJiSuoZaiDi  = UserInfoManage.Get(m => m.USERID == p.ID) != null ? UserInfoManage.Get(m => m.USERID == p.ID).HuJiSuoZaiDi : "",
                HUJIPAICHUSUO = UserInfoManage.Get(m => m.USERID == p.ID) != null ? UserInfoManage.Get(m => m.USERID == p.ID).HUJIPAICHUSUO : "",
                InsideEmail   = p.ACCOUNT + EmailDomain,
                Email         = UserInfoManage.Get(m => m.USERID == p.ID) != null ? UserInfoManage.Get(m => m.USERID == p.ID).EMAILADDRESS : "",
                p.LEVELS,
                Mobile  = UserInfoManage.Get(m => m.USERID == p.ID) != null ? UserInfoManage.Get(m => m.USERID == p.ID).PHONE : "",
                Mobile2 = UserInfoManage.Get(m => m.USERID == p.ID) != null ? UserInfoManage.Get(m => m.USERID == p.ID).SECONDPHONE : "",
                Tel     = UserInfoManage.Get(m => m.USERID == p.ID) != null ? UserInfoManage.Get(m => m.USERID == p.ID).OFFICEPHONE : "",
                Depart  = GetDepart(p.DPTID),
                p.CREATEDATE
            }).ToList();

            return(View(JsonConverter.JsonClass(UsersList)));
        }
Пример #2
0
        public ActionResult UserInfo(int?userid)
        {
            try
            {
                //是否为人事部
                var IsMatters = true;

                var entity = new Domain.SYS_USERINFO();

                var UserName = CurrentUser.Name;

                if (userid != null && userid > 0)
                {
                    entity = UserInfoManage.Get(p => p.USERID == userid) ?? new Domain.SYS_USERINFO()
                    {
                        USERID = int.Parse(userid.ToString())
                    };
                    UserName = UserManage.Get(p => p.ID == userid).NAME;
                    if ((CurrentUser.DptInfo != null && CurrentUser.DptInfo.NAME != "人事部") || !CurrentUser.IsAdmin)
                    {
                        IsMatters = false;
                    }
                }
                else
                {
                    entity = UserInfoManage.Get(p => p.USERID == CurrentUser.Id) ?? new Domain.SYS_USERINFO()
                    {
                        USERID = CurrentUser.Id
                    };
                }

                ViewData["UserName"] = UserName;

                ViewBag.IsMatters = IsMatters;

                Dictionary <string, string> dic = Common.Enums.ClsDic.DicCodeType;
                var dictype = this.CodeManage.GetDicType();
                //在岗状态
                string zgzt = dic["在岗状态"];
                ViewData["zgzt"] = dictype.Where(p => p.CODETYPE == zgzt).ToList();
                //婚姻状况
                string hyzk = dic["婚姻状况"];
                ViewData["hunyin"] = dictype.Where(p => p.CODETYPE == hyzk).ToList();
                //政治面貌
                string zzmm = dic["政治面貌"];
                ViewData["zzmm"] = dictype.Where(p => p.CODETYPE == zzmm).ToList();
                //民族
                string mz = dic["民族"];
                ViewData["mz"] = dictype.Where(p => p.CODETYPE == mz).ToList();
                //职称级别
                string zcjb = dic["职称"];
                ViewData["zcjb"] = dictype.Where(p => p.CODETYPE == zcjb).ToList();
                //学历
                string xl = dic["学历"];
                ViewData["xl"] = dictype.Where(p => p.CODETYPE == xl).ToList();

                return(View(entity));
            }
            catch (Exception e)
            {
                WriteLog(Common.Enums.enumOperator.Select, "加载人员档案:", e);
                throw e.InnerException;
            }
        }