Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 2
0
        void personelClient_GetEmployeeDetailViewByIDCompleted(object sender, GetEmployeeDetailViewByIDCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result != null)
                {
                    V_EMPLOYEEDETAIL result  = e.Result;
                    bool             isAdmin = _IsAdmin == "1" ? true : false;
                    if (result.EMPLOYEEPOSTS == null)
                    {
                        result.EMPLOYEEPOSTS = new System.Collections.ObjectModel.ObservableCollection <V_EMPLOYEEPOSTBRIEF>();
                    }

                    //Common.CurrentLoginUserInfo = Common.GetLoginUserInfo(
                    //    _UserEmployeeID, result.EMPLOYEENAME,
                    //    result.EMPLOYEECODE, result.EMPLOYEESTATE,
                    //    _SysUserID, result.OFFICEPHONE,
                    //    result.SEX, result.EMPLOYEEPOSTS.ToList(), result.WORKAGE, result.PHOTO, isAdmin);
                    //Common.CurrentLoginUserInfo.LoginRecordID = _LoginRecord;
                    //Common.CurrentLoginUserInfo.UserName = Utility.UserLogin.UserName;
                    //Common.CurrentLoginUserInfo.UserPwd = Utility.UserLogin.UserPassword;
                    //AppConfig._CurrentStyleCode = 1;

                    //if (Application.Current.Resources["CurrentUserID"] == null)
                    //{
                    //    if (Application.Current.Resources.Contains("CurrentUserID"))
                    //        Application.Current.Resources.Remove("CurrentUserID");

                    //    Application.Current.Resources.Add("CurrentUserID", _UserEmployeeID);
                    //}

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

                    //    //结束系统初始化过程
                    //    if (_Actived)
                    //    {
                    //        if (InitSystemCompleted.IsNotNull())
                    //        {
                    //            //触发系统初始化完成事件
                    //            InitSystemCompleted(this, EventArgs.Empty);
                    //            if (!CurrentContext.SysInit)
                    //                CurrentContext.SysInit = true;

                    //            txbLodingInfo.Text = "系统初始化完毕!";
                    //        }
                    //        //关闭系统初始化开关
                    //        _Actived = false;
                    //    }
                }
            }
            else
            {
                if (this.OnInitFailed != null)
                {
                    this.OnInitFailed(this, e);
                }
                //errorPanel.Visibility = Visibility.Visible;
                //loadingfoPanel.Visibility = Visibility.Collapsed;
                //ExceptionManager.SendException(Resource.MSG_100014_WCF_ERROR, "PF", "LoadPostInfo", "1000014", e.Error);
            }
        }
Exemplo n.º 3
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);
                 }
            }
        }