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

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

            Db.SupplyPayments.Add(supplyPayment);
            Db.SaveChanges();
        }
Exemple #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"));
            }
        }
Exemple #4
0
        public ActionResult Create(int supplyid)
        {
            SupplyPayment supplyPayment = Db.SupplyPayments.Where(pm => pm.SupplyId == supplyid).FirstOrDefault();

            return(View(supplyPayment));
        }