public bool Add(User user) { UserNullCheck(user); EmptyFieldsCheck(user); FirstNameCheck(user.FirstName); LastNameCheck(user.LastName); //ToDo проверка-замена первой буквы имени/фамилии на заглавную EmailCheck(user.Email); UserPhoneNumberCheck(user.PhoneNumber); UserLoginCheck(user.Login); UserPasswordCheck(user.Password); ProductPhotoCheck(user.Photo); NullCheck(user.ListOrder); return(userDao.Add(user)); }
public void Add(User user) { try { if (user == null) { throw new System.Exception("User is null."); } else if ((user.Name == "") || (user.DateOfBirthday == null)) { throw new System.Exception("Some fields of User are blank."); } _cacheLogic.Delete(ALL_USERS_CACHE_KEY); _userDAO.Add(user); } catch (Exception e) { Console.WriteLine(e.Message + Environment.NewLine + e.Source + Environment.NewLine + e.TargetSite + Environment.NewLine + e.StackTrace); throw new Exception("Can't add user to text file."); } }
public bool Save(User newUser) { if (newUser.Name.Contains('|')) { throw new ArgumentException("User info can't contains symbol '|'"); } if (newUser.DateOfBirth > DateTime.Today) { throw new ArgumentException("Date of Birth can't be above than current date"); } if (newUser.Age > 150) { throw new ArgumentException("User's age cant' be above than 150 years"); } if (userDao.Add(newUser)) { return(true); } throw new InvalidOperationException("Error on user saving"); }
public void Add(User user) { _userDao.Add(user); }
public void Add(User user) { ValidationTool.Validate(new UserValidator(), user); _iUserDao.Add(user); }
public void Add(User user) { user.Acc.Password = GetPasswordsHash(user.Acc.Password); userDao.Add(user); }
public User Add(User user) { return(_userDao.Add(user)); }
public int Add(info_User t) { return(iud.Add(t)); }
//[TransactionScopeAspect(TransactionScopeOption.Required, IsolationLevel.ReadCommitted, 60)] //[FluentValidationAspect(typeof(UserValidator))] public void Add(User user) { _userDao.Add(user); _userDao.Commit(); }
public void Add(User value) { userDao.Add(value); }
public IResult Add(User user) { _userDao.Add(user); return(new SuccessResult(Messages.UserAdded)); }
public bool Add(User obj) { return(userDao.Add(obj)); }
public bool Add(User user) { NullCheck(user); return(userDao.Add(user)); }
internal int Add(int v) { return(usrDao.Add(v)); }
public int Add(User item) { return(_userDao.Add(item)); }
public User Add(User user) => _userDao.Add(user);