public LoginModel getUserInfo(string UserID) { Mapper.CreateMap<F98021, LoginModel>(); objF98021 = new F98021Repository(); LoginModel objResult = new LoginModel(); if (objF98021.GetAll(u => u.UserID.Equals(UserID)).Count() > 0) { F98021 objEntity = objF98021.GetSingle(u => u.UserID.Equals(UserID)); objResult = Mapper.Map(objEntity, objResult); } return objResult; }
public bool CheckUserLogin(string user, string password) { string vPassword = StringUtils.GetHash(password); try { objF98021 = new F98021Repository(); var info = objF98021.GetSingle(u => u.UserID == user && u.Password == vPassword); return info != null; } catch (Exception ex) { Console.WriteLine(ex.Message); return false; } }