public ActionResult DeleteConfirmed(long id)
        {
            PaymentsPost payments = _paymentsService.GetPost(id);

            payments.UserName = User.Identity.Name;
            _paymentsService.Delete(payments);
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit([Bind("ixPayment,sPayment,ixInvoice")] PaymentsPost payments)
        {
            if (ModelState.IsValid)
            {
                payments.UserName = User.Identity.Name;
                _paymentsService.Edit(payments);
                return(RedirectToAction("Index"));
            }
            ViewBag.ixInvoice = new SelectList(_paymentsService.selectInvoices().Select(x => new { x.ixInvoice, x.sInvoice }), "ixInvoice", "sInvoice", payments.ixInvoice);

            return(View(payments));
        }
        public ActionResult Edit(long id)
        {
            PaymentsPost payments = _paymentsService.GetPost(id);

            if (payments == null)
            {
                return(NotFound());
            }
            ViewBag.ixInvoice = new SelectList(_paymentsService.selectInvoices().Select(x => new { x.ixInvoice, x.sInvoice }), "ixInvoice", "sInvoice", payments.ixInvoice);

            return(View(payments));
        }
        public Task Delete(PaymentsPost paymentsPost)
        {
            // Additional validations

            // Pre-process

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

            // Post-process

            return(Task.CompletedTask);
        }
        public Task <Int64> Create(PaymentsPost paymentsPost)
        {
            // Additional validations

            // Pre-process

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

            // Post-process

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