Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SupplierPaymentList supplierPaymentList = db.SupplierPaymentLists.Find(id);
            var y = supplierPaymentList.SupplierId;

            db.SupplierPaymentLists.Remove(supplierPaymentList);
            db.SaveChanges();
            return(RedirectToAction("Index", "SupplierPayment", new { id = y }));
        }
Example #2
0
        public ActionResult Create([Bind(Include = "Id,Income,Expense,Description")] SupplierPaymentList supplierPaymentList, int id)
        {
            if (ModelState.IsValid)
            {
                supplierPaymentList.SupplierDate = DateTime.Now;
                supplierPaymentList.SupplierId   = id;
                db.SupplierPaymentLists.Add(supplierPaymentList);
                db.SaveChanges();
                return(RedirectToAction("Index", "Supplier"));
            }

            return(View(supplierPaymentList));
        }