public async Task <IActionResult> Create(StaffViewModel StaffViewModel) { if (ModelState.IsValid) { await context.Staff.AddAsync(StaffViewModel.Staff); await context.SaveChangesAsync(); cache.Clean(); return(RedirectToAction("Index", "Staff")); } return(View(StaffViewModel)); }
public async Task <IActionResult> Create(CostsViewModel costsViewModel) { if (ModelState.IsValid) { await context.Costs.AddAsync(costsViewModel.Cost); await context.SaveChangesAsync(); cache.Clean(); return(RedirectToAction("Index", "Costs")); } return(View(costsViewModel)); }
public async Task <IActionResult> Create(GsmViewModel gsmViewModel) { if (ModelState.IsValid) { await context.Gsm.AddAsync(gsmViewModel.Gsm); await context.SaveChangesAsync(); cache.Clean(); return(RedirectToAction("Index", "Gsm")); } return(View(gsmViewModel)); }