public IActionResult UpdateComputerTechnology(AdminComputerTechnologyViewModel model) { var convertedModel = _mapper.Map <ComputerTechnologyDTO>(model); _computerTechnologyService.UpdateComputerTechnology(convertedModel); return(RedirectToAction("ComputerTechnology", "Admin")); }
public IActionResult CreateComputerTechnology(AdminComputerTechnologyViewModel model) { ViewBag.ShowNavbar = false; var convertedModel = _mapper.Map <ComputerTechnologyDTO>(model); _computerTechnologyService.CreateComputerTechnology(convertedModel); return(RedirectToAction("ComputerTechnology", "Admin")); }
public IActionResult CreateUpdateComputerTechnology(AdminComputerTechnologyViewModel model) { ViewBag.ShowNavbar = false; //Create if (model.Id != 0) { var computerTechnology = _computerTechnologyService.GetComputerTechnologyFromID(model.Id); var convertedModel = _mapper.Map <AdminComputerTechnologyViewModel>(computerTechnology); convertedModel.AspAction = "UpdateComputerTechnology"; convertedModel.AspController = "AdminCRUD"; convertedModel.ButttonText = "Opdater"; return(View("CreateUpdateComputerTechnology", convertedModel)); } model.AspAction = "CreateComputerTechnology"; model.AspController = "AdminCRUD"; model.ButttonText = "Opret"; return(View("CreateUpdateComputerTechnology", model)); }
public IActionResult DeleteComputerTechnology(AdminComputerTechnologyViewModel model) { _computerTechnologyService.DeleteComputerTechnology(model.Id); return(RedirectToAction("ComputerTechnology", "Admin")); }