public void Save(Numero numero) { try { if (numero == null) { throw new ArgumentException("numero is empty"); } if (String.IsNullOrEmpty(numero.Name)) { throw new ArgumentException("numero name is empty"); } if (numero.UserId <= 0) { throw new ArgumentException("user id is empty"); } if (String.IsNullOrEmpty(numero.NumeroPattern)) { throw new ArgumentException("NumeroPattern is empty"); } numeroDAL = new NumeroDAL(); numeroDAL.Insert(numero); } catch (Exception) { throw; } }
public List <Numero> GetNumeros(int userId) { if (userId <= 0) { throw new ArgumentException("user id is empty"); } numeroDAL = new NumeroDAL(); return(numeroDAL.Search(userId)); }
public Numero GetNumero(int id) { if (id <= 0) { throw new ArgumentException("id is empty"); } numeroDAL = new NumeroDAL(); return(numeroDAL.Fetch(id)); }