public async Task <IActionResult> UnitEdit(int id) { ServiceReference_Unit.Unit e = await unit.findUnitByIdAsync(id); ViewBag.flag = flag; ViewBag.message = message; flag = ""; message = ""; return(View(e)); }
public async Task <IActionResult> UnitUpdate(ServiceReference_Unit.Unit e) { bool _boolean = await unit.updateUnitAsync(e); if (_boolean) { flag = "success"; message = "Update unit success"; } else { flag = "error"; message = "Update unit unsuccess."; } return(RedirectToAction("UnitEdit/" + e.UnitId)); }
public async Task <IActionResult> UnitSave(ServiceReference_Unit.Unit e) { bool _boolean = await unit.createUnitAsync(e); if (_boolean) { flag = "success"; message = "Add new unit success"; } else { flag = "error"; message = "Add new unit unsuccess."; } return(RedirectToAction("UnitCreate")); }