public void AddZip(ZipModelDC obj) { if (obj == null) { throw new ArgumentException(Messages.ZipExceptionAdd); } _db.Zips.Add(MapToZip(obj)); _db.SaveChanges(); }
public void AddEmail(EmailModelDC obj) { if (obj == null) { throw new ArgumentException(Messages.EmailExceptionAdd); } _db.Emails.Add(MapToEmail(obj)); _db.SaveChanges(); }
public void AddState(StateInfoModelDC obj) { if (obj == null) { throw new ArgumentException(Messages.StateExceptionAdd); } _db.StateInfoes.Add(MapToStateInfo(obj)); _db.SaveChanges(); }
public void AddUser(UserDetailModelDC obj) { if (obj == null) { throw new ArgumentException(Messages.UserExceptionAdd); } _db.UserDetails.Add(MapToUser(obj)); _db.SaveChanges(); }
public void AddCounty(CountyModelDC obj) { if (obj == null) { throw new ArgumentOutOfRangeException(Messages.CountyExceptionAdd); } _db.Counties.Add(MapToCounty(obj)); _db.SaveChanges(); }
public void AddAddress(AddressModelDC obj) { foreach (Address address in _db.Addresses) { if (address.AddressId == obj.addressId) { throw new ArgumentOutOfRangeException(Messages.AddressExceptionAdd); } } if (obj == null) { throw new ArgumentOutOfRangeException(Messages.AddressExceptionAdd); } _db.Addresses.Add(MapToAddress(obj)); _db.SaveChanges(); }
public void AddCity(CityModelDC obj) { foreach (City city in _db.Cities) { if (city.CityId == obj.cityId) { throw new ArgumentOutOfRangeException(Messages.CityExceptionAdd); } } if (obj == null) { throw new ArgumentOutOfRangeException(Messages.CityExceptionAdd); } _db.Cities.Add(MapToCity(obj)); _db.SaveChanges(); }