Exemple #1
0
        //Get: PayingBy/Delete
        public ActionResult Delete(int id)
        {
            var service  = new PayingByService();
            var category = service.GetPayingBy(id);

            return(View(category));
        }
Exemple #2
0
        // GET: PayingBy Index
        public ActionResult Index()
        {
            var service = new PayingByService();
            var model   = service.GetPayments();

            return(View(model));
        }
Exemple #3
0
        //Get: PayingBy/Edit/{id}
        public ActionResult Edit(int id)
        {
            var service  = new PayingByService();
            var detail   = service.GetPayingBy(id);
            var payingBy = new PayingByEdit()
            {
                CashOrCard = detail.CashOrCard
            };

            return(View(payingBy));
        }
Exemple #4
0
        public ActionResult DeletePost(int id)
        {
            var service = new PayingByService();

            if (service.DeletePayingBy(id))
            {
                TempData["SaveResult"] = "Paymnent Deleted";
                return(RedirectToAction("Index"));
            }
            ModelState.AddModelError("", "Paymnet could not be updated");
            var model = service.GetPayingBy(id);

            return(View(model));
        }
Exemple #5
0
        public ActionResult Edit(int id, PayingByEdit model)
        {
            var service = new PayingByService();

            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            if (service.UpdatePayingBy(id, model))
            {
                TempData["SaveResult"] = "Payment Updated";
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", "Payment could not be updated");
            return(View(model));
        }
Exemple #6
0
        public ActionResult Create(PayingByCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = new PayingByService();

            if (service.CreatePayingBy(model))
            {
                TempData["SaveResult"] = "Ppayment Created";
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", "Payment could not be added");
            return(View(model));
        }