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();
        }
Exemple #3
0
        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();
        }
Exemple #5
0
        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();
        }