Beispiel #1
0
        public void Delete(int id)
        {
            SupplyPayment supplyPayment = Db.SupplyPayments.Find(id);

            Db.SupplyPayments.Remove(supplyPayment);
            Db.SaveChanges();
        }
Beispiel #2
0
        public void Post(SupplyPayment supplyPayment)
        {
            supplyPayment.DatePaid = DateTime.Today;
            supplyPayment.UserId   = User.Identity.GetUserId();

            Db.SupplyPayments.Add(supplyPayment);
            Db.SaveChanges();
        }
Beispiel #3
0
        public ActionResult Create(SupplyPayment supplyPayment)
        {
            try
            {
                supplyPayment.DatePaid = DateTime.Today;
                supplyPayment.UserId   = User.Identity.GetUserId();

                Db.SupplyPayments.Add(supplyPayment);
                Db.SaveChanges();

                return(RedirectToAction("Details", "Supply", new { id = supplyPayment.SupplyId }));
            }
            catch
            {
                ViewBag.ErrorMessage = "Error occured while adding supply payment";
                return(View("Error"));
            }
        }
Beispiel #4
0
        public ActionResult Create(int supplyid)
        {
            SupplyPayment supplyPayment = Db.SupplyPayments.Where(pm => pm.SupplyId == supplyid).FirstOrDefault();

            return(View(supplyPayment));
        }