Example #1
0
 public ActionResult SalesAdvancePaymentEdit(int id, int? contractId, FormCollection collection)
 {
     if (!UserInfo.CurUser.HasRight("业务管理-销售收款")) return Redirect("~/content/AccessDeny.htm");
     SalesAdvancePayment p = db.SalesAdvancePayments.Find(id);
     if (p == null)
     {
         p = new SalesAdvancePayment { ContractId = (int)contractId };
         db.SalesAdvancePayments.Add(p);
     }
     TryUpdateModel(p, collection);
     if (ModelState.IsValid)
     {
         db.SaveChanges();
         return Redirect("~/content/close.htm");
     }
     return View(p);
 }
Example #2
0
 public ActionResult SalesAdvancePaymentEdit(int id, int? contractId)
 {
     if (!UserInfo.CurUser.HasRight("业务管理-销售收款")) return Redirect("~/content/AccessDeny.htm");
     SalesAdvancePayment p = db.SalesAdvancePayments.Find(id);
     if (p == null)
     {
         p = new SalesAdvancePayment { ContractId = (int)contractId, PaymentDate = DateTime.Today };
     }
     return View(p);
 }