Exemplo n.º 1
0
        public ActionResult EditPayment(BillHistory collection)
        {
            using (LinkToDBDataContext context = new LinkToDBDataContext())
            {
                BillHistory history = context.GetBillHistoryItem(collection.Id);

                try
                {
                    history.ModifyDate = DateTime.Now;
                    history.Version += 1;
                    history.DatePaid = collection.DatePaid;
                    history.Amount = collection.Amount;
                    history.Payee = collection.Payee;
                    history.IssueDate = collection.IssueDate;

                    context.SubmitChanges();

                    return RedirectToAction("Edit", new { id = history.BillId });
                }
                catch
                {
                    return View(history);
                }
            }
        }
Exemplo n.º 2
0
 public ActionResult EditPayment(int id)
 {
     using (LinkToDBDataContext context = new LinkToDBDataContext())
     {
         BillHistory history = context.GetBillHistoryItem(id);
         history.Bill = context.GetBill(history.BillId);
         return View(history);
     }
 }