コード例 #1
0
        public ActionResult ReciptPlan(int id)
        {
            var loanReciptPlan = _loanReciptPlanService.FindById(id);

            if (loanReciptPlan == null)
            {
                return(HttpNotFound());
            }
            ViewBag.HubID = new SelectList(_commonService.GetAllHubs(), "HubID", "Name");
            var loanReciptPlanViewModel = new LoanReciptPlanWithDetailViewModel()
            {
                LoanReciptPlanID = id,
                TotalAmount      = loanReciptPlan.Quantity,
                Remaining        = _loanReciptPlanDetailService.GetRemainingQuantity(id)
            };

            ViewBag.Errors = "Out of Quantity! The Remaining Quantity is:";
            return(View(loanReciptPlanViewModel));
        }
コード例 #2
0
        public ActionResult ReciptPlan(LoanReciptPlanWithDetailViewModel loanReciptPlanDetail)
        {
            var userID = _userAccountService.GetUserInfo(HttpContext.User.Identity.Name).UserProfileID;

            if (ModelState.IsValid && loanReciptPlanDetail != null)
            {
                var loanReciptPlanModel = new LoanReciptPlanDetail()
                {
                    LoanReciptPlanID = loanReciptPlanDetail.LoanReciptPlanID,
                    HubID            = loanReciptPlanDetail.HubID,
                    //MemoReferenceNumber = loanReciptPlanDetail.MemoRefrenceNumber,
                    RecievedQuantity = loanReciptPlanDetail.Amount,
                    RecievedDate     = DateTime.Today,
                    ApprovedBy       = userID
                };
                _loanReciptPlanDetailService.AddRecievedLoanReciptPlanDetail(loanReciptPlanModel);
                return(RedirectToAction("Detail", new { id = loanReciptPlanDetail.LoanReciptPlanID }));
            }
            ViewBag.HubID = new SelectList(_commonService.GetAllHubs(), "HubID", "Name");
            return(View(loanReciptPlanDetail));
        }
コード例 #3
0
 public ActionResult LoanReciptPlanDetail_Delete([DataSourceRequest] DataSourceRequest request, LoanReciptPlanWithDetailViewModel loanReciptPlanWithDetailViewModel)
 {
     if (loanReciptPlanWithDetailViewModel != null)
     {
         _loanReciptPlanDetailService.DeleteById(loanReciptPlanWithDetailViewModel.LoanReciptPlanDetailID);
     }
     return(Json(ModelState.ToDataSourceResult(request), JsonRequestBehavior.AllowGet));
 }