Ejemplo n.º 1
0
        public DtoEmployee Login(string account, string pwd)
        {
            DtoEmployee result = null;
            var         model  = BllEmployeeRepository.GetByAccount(account, (int)StatusEnum.效);

            if (model != null)
            {
                if (model.Bem_Password._EqualsByOrdinalIgnoreCase(Encrypt.GetMD5Pwd(pwd)))
                {
                    result = model;
                    try
                    {
                        string ip       = "";
                        string cityName = "";
                        ip = clsCommon.GetIP();
                        if (ip.HasValue())
                        {
                            cityName = clsCommon.CityName_ByBaidu(ip);
                        }
                        if (ip.HasValue() || cityName.HasValue())
                        {
                            var old = BllEmployeeRepository.GetEntity(model.Bem_Id);
                            old.Bem_LastLoginArea = cityName;
                            old.Bem_LastLoginIp   = ip;
                            old.Bem_LastLoginTime = DateTime.Now;
                            BllEmployeeRepository.Update(old);
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
 public Bas_Employee GetEmployeeEntity(int bem_id)
 {
     return(BllEmployeeRepository.GetEntity(bem_id));
 }