示例#1
0
        void personelClient_GetEmployeeDetailViewByIDCompleted(object sender, GetEmployeeDetailViewByIDCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEDETAIL epDetail = e.Result;

                List <UserPost> userPosts = new List <UserPost>();
                if (epDetail.EMPLOYEEPOSTS != null)
                {
                    foreach (var postItem in epDetail.EMPLOYEEPOSTS)
                    {
                        UserPost userPost = new UserPost();
                        userPost.EmployeePostID = postItem.EMPLOYEEPOSTID;
                        userPost.IsAgency       = postItem.ISAGENCY == "0" ? true : false;
                        userPost.PostLevel      = postItem.POSTLEVEL;
                        userPost.PostID         = postItem.POSTID;
                        userPost.CompanyID      = postItem.CompanyID;
                        userPost.CompanyName    = postItem.CompanyName;
                        userPost.DepartmentID   = postItem.DepartmentID;
                        userPost.DepartmentName = postItem.DepartmentName;
                        userPost.PostID         = postItem.POSTID;
                        userPost.PostName       = postItem.PostName;
                        userPosts.Add(userPost);
                    }
                }
                bool IsManager = false;
                if (User.ISMANGER == 1)
                {
                    IsManager = true;
                }
                if (epDetail.EMPLOYEEPOSTS != null)
                {
                    var postlist
                        = from ent in epDetail.EMPLOYEEPOSTS
                          select new SMT.SaaS.LocalData.V_EMPLOYEEPOSTBRIEF
                        {
                        EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID,
                        POSTID         = ent.POSTID,
                        PostName       = ent.PostName,
                        DepartmentID   = ent.DepartmentID,
                        DepartmentName = ent.DepartmentName,
                        CompanyID      = ent.CompanyID,
                        CompanyName    = ent.CompanyName,
                        ISAGENCY       = ent.ISAGENCY,
                        POSTLEVEL      = ent.POSTLEVEL
                        };
                    Common.CurrentLoginUserInfo = Common.GetLoginUserInfo(epDetail.EMPLOYEEID, epDetail.EMPLOYEENAME, epDetail.EMPLOYEECODE, epDetail.EMPLOYEESTATE, User.SYSUSERID, epDetail.MOBILE, epDetail.OFFICEPHONE, epDetail.SEX, postlist.ToList(), epDetail.WORKAGE, epDetail.PHOTO, IsManager);
                }
                else
                {
                    Common.CurrentLoginUserInfo = Common.GetLoginUserInfo(epDetail.EMPLOYEEID, epDetail.EMPLOYEENAME, epDetail.EMPLOYEECODE, epDetail.EMPLOYEESTATE, User.SYSUSERID, epDetail.MOBILE, epDetail.OFFICEPHONE, epDetail.SEX, null, epDetail.WORKAGE, epDetail.PHOTO, IsManager);
                }
                Common.CurrentLoginUserInfo.PermissionInfoUI = new List <SMT.SaaS.LocalData.V_UserPermissionUI>();
                foreach (var fent in Permission)
                {
                    SMT.SaaS.LocalData.V_UserPermissionUI tps = new SMT.SaaS.LocalData.V_UserPermissionUI();
                    tps = Common.CloneObject <SMT.Saas.Tools.PermissionWS.V_UserPermissionUI, SMT.SaaS.LocalData.V_UserPermissionUI>(fent, tps);
                    Common.CurrentLoginUserInfo.PermissionInfoUI.Add(tps);
                }


                if (this.LoginedClick != null)
                {
                    this.LoginedClick(this, null);
                }
            }
        }
示例#2
0
文件: UserLogin.cs 项目: JuRogn/OA
        void personelClient_GetEmployeeDetailViewByIDCompleted(object sender, GetEmployeeDetailViewByIDCompletedEventArgs e)
        {
            if (e.Result != null)
            {

                SMT.Saas.Tools.PersonnelWS.V_EMPLOYEEDETAIL epDetail = e.Result;

                List<UserPost> userPosts = new List<UserPost>();
                if (epDetail.EMPLOYEEPOSTS != null)
                {
                    foreach (var postItem in epDetail.EMPLOYEEPOSTS)
                    {
                        UserPost userPost = new UserPost();
                        userPost.EmployeePostID = postItem.EMPLOYEEPOSTID;
                        userPost.IsAgency = postItem.ISAGENCY == "0" ? true : false;
                        userPost.PostLevel = postItem.POSTLEVEL;
                        userPost.PostID = postItem.POSTID;
                        userPost.CompanyID = postItem.CompanyID;
                        userPost.CompanyName = postItem.CompanyName;
                        userPost.DepartmentID = postItem.DepartmentID;
                        userPost.DepartmentName = postItem.DepartmentName;
                        userPost.PostID = postItem.POSTID;
                        userPost.PostName = postItem.PostName;
                        userPosts.Add(userPost);
                    }
                }
                bool IsManager = false;
                if (User.ISMANGER == 1)
                {
                    IsManager = true;
                }
                if (epDetail.EMPLOYEEPOSTS != null)
                {
                    var postlist
                          = from ent in epDetail.EMPLOYEEPOSTS
                            select new SMT.SaaS.LocalData.V_EMPLOYEEPOSTBRIEF
                            {
                                EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID,
                                POSTID = ent.POSTID,
                                PostName = ent.PostName,
                                DepartmentID = ent.DepartmentID,
                                DepartmentName = ent.DepartmentName,
                                CompanyID = ent.CompanyID,
                                CompanyName = ent.CompanyName,
                                ISAGENCY = ent.ISAGENCY,
                                POSTLEVEL = ent.POSTLEVEL
                            };
                    Common.CurrentLoginUserInfo = Common.GetLoginUserInfo(epDetail.EMPLOYEEID, epDetail.EMPLOYEENAME, epDetail.EMPLOYEECODE, epDetail.EMPLOYEESTATE, User.SYSUSERID,epDetail.MOBILE, epDetail.OFFICEPHONE, epDetail.SEX, postlist.ToList(), epDetail.WORKAGE, epDetail.PHOTO, IsManager);
                }
                else
                {
                    Common.CurrentLoginUserInfo = Common.GetLoginUserInfo(epDetail.EMPLOYEEID, epDetail.EMPLOYEENAME, epDetail.EMPLOYEECODE, epDetail.EMPLOYEESTATE, User.SYSUSERID, epDetail.MOBILE, epDetail.OFFICEPHONE, epDetail.SEX, null, epDetail.WORKAGE, epDetail.PHOTO, IsManager);
                }
                Common.CurrentLoginUserInfo.PermissionInfoUI = new List<SMT.SaaS.LocalData.V_UserPermissionUI>();                     
                 foreach (var fent in Permission)
                 {
                     SMT.SaaS.LocalData.V_UserPermissionUI tps= new SMT.SaaS.LocalData.V_UserPermissionUI();
                     tps=Common.CloneObject<SMT.Saas.Tools.PermissionWS.V_UserPermissionUI, SMT.SaaS.LocalData.V_UserPermissionUI>(fent, tps);
                     Common.CurrentLoginUserInfo.PermissionInfoUI.Add(tps);

                 }


                 if (this.LoginedClick != null)
                 {
                     this.LoginedClick(this, null);
                 }
            }
        }