Exemple #1
0
        public ActionResult Save(AddressDbModel _data, long ID)
        {
            _data.CreatedOn = DateTime.Now;
            var data = repo.Save <AddressDbModel>(_data, ID);

            if (data != null)
            {
                return(RedirectToAction("Index", "Address"));
            }
            else
            {
                ModelState.AddModelError("", "Somehting went wront. Please try again");
                return(View());
            }
        }
Exemple #2
0
        public AddressDbModel GetAddressFromView()
        {
            var address = new AddressDbModel
            {
                Id            = _view.AddressId,
                PersonID      = _view.ContactId,
                AddressTypeID = _view.AddressTypeID,
                HomeNumber    = _view.HomeNumber,
                Street        = _view.Street,
                City          = _view.City,
                Country       = _view.Country
            };

            return(address);
        }
Exemple #3
0
        public async Task <int> SaveAddressAsync(AddressDbModel address)
        {
            await _db.InsertOrReplaceAsync(address);

            return(address.Id);
        }