public IActionResult Delete(int id) { var model = new CompanyServiceUpdateModel(); model.Delete(id); return(RedirectToAction("Index")); }
public IActionResult Edit(int id) { var model = new CompanyServiceUpdateModel(); model.Load(id); return(View(model)); }
public IActionResult Add() { var model = new CompanyServiceUpdateModel(); ViewBag.rateType = Enum.GetNames(typeof(RateType)); return(View(model)); }
public IActionResult Edit(CompanyServiceUpdateModel model) { if (ModelState.IsValid) { model.EditCompanyService(); } return(View(model)); }
public IActionResult Add(CompanyServiceUpdateModel model) { var userId = User.FindFirstValue(ClaimTypes.NameIdentifier); if (ModelState.IsValid) { var uniqueFileName = model.GetUploadedImage(model.Image.FileName); model.AddNewService(uniqueFileName, userId); } ViewBag.rateType = Enum.GetNames(typeof(RateType)); return(View(model)); }