public ActionResult PurchasePayment(int id, int? contractId, FormCollection collection) { if (!UserInfo.CurUser.HasRight("业务管理-采购付款")) return Redirect("~/content/AccessDeny.htm"); PurchasePayment p = db.PurchasePayments.Find(id); if (p == null) { p = new PurchasePayment { ContractId = (int)contractId }; db.PurchasePayments.Add(p); } TryUpdateModel(p, collection); if (ModelState.IsValid) { db.SaveChanges(); return Redirect("~/content/close.htm"); } return View(p); }
public ActionResult PurchasePayment(int id, int? contractId) { if (!UserInfo.CurUser.HasRight("业务管理-采购付款")) return Redirect("~/content/AccessDeny.htm"); PurchasePayment p = db.PurchasePayments.Find(id); if (p == null) { p = new PurchasePayment { ContractId = (int)contractId, PaymentDate = DateTime.Today }; } return View(p); }