Пример #1
0
        public ActionResult DeleteConfirmed(long id)
        {
            PaymentAddressesPost paymentaddresses = _paymentaddressesService.GetPost(id);

            paymentaddresses.UserName = User.Identity.Name;
            _paymentaddressesService.Delete(paymentaddresses);
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult Edit([Bind("ixPaymentAddress,sPaymentAddress,sStreetAndNumberOrPostOfficeBoxOne,sStreetAndNumberOrPostOfficeBoxTwo,sCityOrSuburb,sCountrySubDivisionCode,sZipOrPostCode,sCountryCode")] PaymentAddressesPost paymentaddresses)
        {
            if (ModelState.IsValid)
            {
                paymentaddresses.UserName = User.Identity.Name;
                _paymentaddressesService.Edit(paymentaddresses);
                return(RedirectToAction("Index"));
            }

            return(View(paymentaddresses));
        }
Пример #3
0
        public ActionResult Edit(long id)
        {
            PaymentAddressesPost paymentaddresses = _paymentaddressesService.GetPost(id);

            if (paymentaddresses == null)
            {
                return(NotFound());
            }

            return(View(paymentaddresses));
        }
Пример #4
0
        public Task Delete(PaymentAddressesPost paymentaddressesPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._paymentaddressesRepository.RegisterDelete(paymentaddressesPost);
            try
            {
                this._paymentaddressesRepository.Commit();
            }
            catch (Exception ex)
            {
                this._paymentaddressesRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.CompletedTask);
        }
Пример #5
0
        public Task <Int64> Create(PaymentAddressesPost paymentaddressesPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._paymentaddressesRepository.RegisterCreate(paymentaddressesPost);
            try
            {
                this._paymentaddressesRepository.Commit();
            }
            catch (Exception ex)
            {
                this._paymentaddressesRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.FromResult(paymentaddressesPost.ixPaymentAddress));
        }
Пример #6
0
 public void RegisterDelete(PaymentAddressesPost paymentaddressesPost)
 {
     _context.PaymentAddressesPost.Remove(paymentaddressesPost);
 }
Пример #7
0
 public void RegisterEdit(PaymentAddressesPost paymentaddressesPost)
 {
     _context.Entry(paymentaddressesPost).State = EntityState.Modified;
 }
Пример #8
0
 public void RegisterCreate(PaymentAddressesPost paymentaddressesPost)
 {
     _context.PaymentAddressesPost.Add(paymentaddressesPost);
 }