Exemplo n.º 1
0
        public bool Login(string userid, string password, out string errorMsg)
        {
            errorMsg = string.Empty;
            using (var client = new LPSServiceClient())
            {
                EmpolyeeOR EmpObj = null;
                try
                {
                    EmpObj = client.Login(userid, password);
                    if (EmpObj.Result != 0)
                    {
                        errorMsg = EmpObj.ResultMsg;
                        return(false);
                    }
                }
                catch (EndpointNotFoundException exEnd)
                {
                    errorMsg = "配置Web服务不存在!";
                    return(false);
                }
                catch (Exception ex)
                {
                    errorMsg = "登录失败!";
                    return(false);
                }

                GlobalData.CurrentUser = EmpObj;
            }
            return(true);
        }
Exemplo n.º 2
0
        public bool Login(string userid, string password,out string errorMsg)
        {
            errorMsg = string.Empty;
            using (var client = new LPSServiceClient())
            {
                EmpolyeeOR EmpObj = null;
                try
                {
                    EmpObj =  client.Login(userid, password);
                    if (EmpObj.Result != 0)
                    {
                        errorMsg = EmpObj.ResultMsg;
                        return false;
                    }
                }
                catch (EndpointNotFoundException exEnd)
                {
                    errorMsg = "配置Web服务不存在!";
                    return false;
                }
                catch (Exception ex)
                {
                    errorMsg = "登录失败!";
                    return false;
                }

                GlobalData.CurrentUser = EmpObj;
            }
            return true;
        }