public async Task <ActionResult> Edit([Bind(Include = "idOtherExpenses,nameExpenses,amount,dateExpenses,expenseCategoryId")] OtherExpensesView otherExpensesView) { if (ModelState.IsValid) { OtherExpensesBll otherExpenses = Mapper.Map <OtherExpensesView, OtherExpensesBll>(otherExpensesView); await _otherExpenses.Insert(otherExpenses); return(RedirectToAction("Index")); } ViewBag.Category = new SelectList(await _expenseCategory.GetTableAll(), "idExpenseCategory", "name"); return(View(otherExpensesView)); }
// GET: OtherExpenses/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OtherExpensesView otherExpensesView = Mapper.Map <OtherExpensesView>(await _otherExpenses.SelectId(id)); if (otherExpensesView == null) { return(HttpNotFound()); } return(View(otherExpensesView)); }
// GET: OtherExpenses/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OtherExpensesView otherExpensesView = Mapper.Map <OtherExpensesView>(await _otherExpenses.SelectId(id)); if (otherExpensesView == null) { return(HttpNotFound()); } ViewBag.Category = new SelectList(await _expenseCategory.GetTableAll(), "idExpenseCategory", "name"); return(View(otherExpensesView)); }