public async Task <IActionResult> AddTape(BaseMaterialViewModel model) { if (!ModelState.IsValid) { return(View(model)); } await this.materials.AddTapeAsync( model.Date, model.Price, model.SafetyMargin); return(RedirectToAction(nameof(AllTape))); }
public async Task <IActionResult> EditTape(int id, BaseMaterialViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var success = await this.materials.EditTapeAsync( id, model.Date, model.Price, model.SafetyMargin); if (!success) { return(NotFound()); } return(RedirectToAction(nameof(AllTape))); }