public async Task <ActionResult> Edit([Bind(Include = "idCostsCarWashAndDeteyling,nameExpenses,amount,dateExpenses,expenseCategoryId,typeServicesId")] CostsCarWashAndDeteylingView costsCarWashAndDeteylingView) { if (ModelState.IsValid) { CostsCarWashAndDeteylingBll costsCarWashAndDeteyling = Mapper.Map <CostsCarWashAndDeteylingView, CostsCarWashAndDeteylingBll>(costsCarWashAndDeteylingView); await _costsCarWashAndDeteyling.Update(costsCarWashAndDeteyling); return(RedirectToAction("Index")); } ViewBag.Category = new SelectList(await _expenseCategory.GetTableAll(), "idExpenseCategory", "name"); return(View(costsCarWashAndDeteylingView)); }
// GET: CostsCarWashAndDeteyling/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CostsCarWashAndDeteylingView costsCarWashAndDeteylingView = Mapper.Map <CostsCarWashAndDeteylingView>(await _costsCarWashAndDeteyling.SelectId(id)); if (costsCarWashAndDeteylingView == null) { return(HttpNotFound()); } ViewBag.Category = new SelectList(await _expenseCategory.GetTableAll(), "idExpenseCategory", "name"); return(View(costsCarWashAndDeteylingView)); }
// GET: CostsCarWashAndDeteyling/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CostsCarWashAndDeteylingView costsCarWashAndDeteylingView = Mapper.Map <CostsCarWashAndDeteylingView>(await _costsCarWashAndDeteyling.SelectId(id)); if (costsCarWashAndDeteylingView == null) { return(HttpNotFound()); } return(View(costsCarWashAndDeteylingView)); }