示例#1
0
        public CustomerPwdDto CheckLogin(UserCheckInput userCheckInput)
        {
            var customerName = userCheckInput.CustomerName;
            var password     = userCheckInput.Pwd;
            var customer     = GetCustomerByName(customerName);
            Dictionary <string, string> keyValuePairs = new Dictionary <string, string>();

            keyValuePairs.Add("CustomerNo", customer.CustomerNo);
            keyValuePairs.Add("CustomerPwd", password.ToMd5());
            var customerPwd = CustomerPwdRepository.ListByCustoms(keyValuePairs).FirstOrDefault();

            return(CustomerPwdDto.ToDto(customerPwd));
        }
示例#2
0
        public string CheckLogin(UserCheckInput userCheckInput)
        {
            if (string.IsNullOrEmpty(userCheckInput.CustomerName) || string.IsNullOrEmpty(userCheckInput.Pwd))
            {
                this.HttpContext.Response.StatusCode = 204;
                return(null);
            }
            var customerPwd = _customerService.CheckLogin(userCheckInput);

            if (customerPwd != null)
            {
                return(GetToken(customerPwd.CustomerNo));
            }
            else
            {
                this.HttpContext.Response.StatusCode = 204;
                return(null);
            }
        }