public void UpdateUserLogin(UserHistory userHistory) { using (var uow = new UnitOfWork()) { if (userHistory != null) { var userLogin = uow.GetRepository<UserLogin>().Items.FirstOrDefault(x => x.Id == userHistory.UserloginId); userLogin.PasswordCap = userHistory.PasswordCap; userLogin.Captcha = userHistory.Captcha; uow.GetRepository<UserLogin>().Update(userLogin); uow.SaveChanges(); } } }
public UserHistory AddUserHistory(UserHistory userHistory) { using (var uow = new UnitOfWork()) { var userHstryFmDb = uow.GetRepository<UserHistory>().Items.FirstOrDefault(x => x.Captcha == userHistory.Captcha && x.IpAddress == userHistory.IpAddress); if (userHstryFmDb == null) { var userHstry = new UserHistory() { IpAddress = userHistory.IpAddress, CreatedDate = DateTime.Now, Captcha = userHistory.Captcha, saltkey = userHistory.saltkey, UserloginId = userHistory.UserloginId, PasswordCap = userHistory.PasswordCap }; uow.GetRepository<UserHistory>().Insert(userHstry); uow.SaveChanges(); UpdateUserLogin(userHstry); } return userHistory; } }
public void UpdateUserLogin(UserHistory userHistory) { _userRepository.UpdateUserLogin(userHistory); }
public UserHistory AddUserHistory(UserHistory userHistory) { var userHistry = _userRepository.AddUserHistory(userHistory); return userHistry; }
public UserHistory AddUserHistory(UserHistory userHistory) { var userHstry = _userBl.AddUserHistory(userHistory); return userHstry; }
public void UpdateUserLogin(UserHistory userHistory) { _userBl.UpdateUserLogin(userHistory); }