示例#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);
 }