示例#1
0
文件: Login.xaml.cs 项目: jjg0519/OA
        /// <summary>
        /// 根据SysUserID,验证用户是否允许登录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void sysloginClinet_GetUserInfobyIDCompleted(object sender, GetUserInfobyIDCompletedEventArgs e)
        {
            if (e.Error != null && e.Error.Message != string.Empty)
            {
                SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(e.Error.ToString());
                SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText();
                HtmlPage.Window.Invoke("loadCompletedSL", new string[] { "false", e.Error.ToString() });
            }
            else
            {
                if (e.Result == null)
                {
                    txtUserMsg.Text = "警告!用户异常,不能执行当前请求。";
                    HtmlPage.Window.Invoke("loadCompletedSL", new string[] { "false", txtUserMsg.Text });
                    SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("警告!用户不存在,不能执行当前请求。");
                    SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText();
                    return;
                }
                else
                {
                    isloading          = true;
                    sysUser            = new EmployeeInfoWS.V_UserLogin();
                    sysUser.EMPLOYEEID = e.Result.EMPLOYEEID;
                    sysUser.ISMANAGER  = e.Result.ISMANAGER;
                    sysUser.SYSUSERID  = e.Result.SYSUSERID;

                    //登录成功,获取员工信息
                    employeeInfoClient.getEmployeeInfobyLoginAsync(sysUser.EMPLOYEEID);

                    SMT.SaaS.LocalData.Tables.V_UserLogin us = new SaaS.LocalData.Tables.V_UserLogin();
                    us.UserName   = sysUser.SYSUSERID;
                    us.EMPLOYEEID = sysUser.EMPLOYEEID;
                    us.ISMANAGER  = sysUser.ISMANAGER;
                    us.SYSUSERID  = sysUser.SYSUSERID;
                    SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo            = new LoginUserInfo();
                    SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID = us.EMPLOYEEID;
                    SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.SysUserID  = us.SYSUSERID;
                    SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.IsManager  = us.ISMANAGER == "1" ? true : false;
                }
            }
        }
示例#2
0
        /// <summary>
        /// 根据SysUserID,验证用户是否允许登录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void sysloginClinet_GetUserInfobyIDCompleted(object sender, GetUserInfobyIDCompletedEventArgs e)
        {
            if (e.Error != null && e.Error.Message != string.Empty)
            {
                SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(e.Error.ToString());
                SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText();
                HtmlPage.Window.Invoke("loadCompletedSL", new string[] { "false", e.Error.ToString() });
            }
            else
            {
                if (e.Result == null)
                {
                    txtUserMsg.Text = "警告!用户异常,不能执行当前请求。";
                    HtmlPage.Window.Invoke("loadCompletedSL", new string[] { "false", txtUserMsg.Text });
                    SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("警告!用户不存在,不能执行当前请求。");
                    SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText();
                    return;
                }
                else
                {
                    isloading = true;
                    sysUser = new EmployeeInfoWS.V_UserLogin();
                    sysUser.EMPLOYEEID = e.Result.EMPLOYEEID;
                    sysUser.ISMANAGER = e.Result.ISMANAGER;
                    sysUser.SYSUSERID = e.Result.SYSUSERID;

                    //登录成功,获取员工信息
                    employeeInfoClient.getEmployeeInfobyLoginAsync(sysUser.EMPLOYEEID);

                    SMT.SaaS.LocalData.Tables.V_UserLogin us = new SaaS.LocalData.Tables.V_UserLogin();
                    us.UserName = sysUser.SYSUSERID;
                    us.EMPLOYEEID = sysUser.EMPLOYEEID;
                    us.ISMANAGER = sysUser.ISMANAGER;
                    us.SYSUSERID = sysUser.SYSUSERID;
                    SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo = new LoginUserInfo();
                    SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID = us.EMPLOYEEID;
                    SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.SysUserID = us.SYSUSERID;
                    SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.IsManager = us.ISMANAGER == "1" ? true : false;
                }
            }
        }