public ActionResult WithdrawSave([Bind(Include = "StationAccountId, PaymentRequestId, WithdrawedComments")] PaymentRequestDetailsViewModel withDrawDetails) { if (ModelState.IsValid) { PaymentRequest request = db.PaymentRequests.Find(withDrawDetails.PaymentRequestId); if (request.State == PaymentRequestState.BusinessManagerApproved || request.State == PaymentRequestState.BusinessManagerRejected || request.State == PaymentRequestState.FinanceManagerRejected) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "请款单批准已完结,无法撤回.")); } request.State = PaymentRequestState.Withdrawed; request.WithdrawedComments = withDrawDetails.WithdrawedComments; request.WithdrawedTimestamp = DateTime.Now; request.BusinessManagerId = System.Web.HttpContext.Current.User.Identity.GetUserId(); db.Entry(request).State = EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("Index", new { accountId = withDrawDetails.StationAccountId })); }
public ActionResult WithdrawCancel([Bind(Include = "StationAccountId")] PaymentRequestDetailsViewModel withDrawDetails) { return(RedirectToAction("Index", new { accountId = withDrawDetails.StationAccountId })); }