예제 #1
0
        // GET: Disbursement/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var disbursement = await _disbursementRepo.GetByIdAsync((int)id);

            if (disbursement == null)
            {
                return(HttpNotFound());
            }

            ViewBag.CollectionPointId = new SelectList(_collectionRepo.GetAll(), "CollectionPointId",
                                                       "CollectionName", disbursement.CollectionPointId);

            return(View(disbursement));
        }
예제 #2
0
        public async Task <DisbursementDTO> Get(int id)
        {
            var disbursement = await _disbursementRepo.GetByIdAsync(id);

            return(new DisbursementDTO(disbursement));
        }