예제 #1
0
        public IActionResult UpdateComputerTechnology(AdminComputerTechnologyViewModel model)
        {
            var convertedModel = _mapper.Map <ComputerTechnologyDTO>(model);

            _computerTechnologyService.UpdateComputerTechnology(convertedModel);

            return(RedirectToAction("ComputerTechnology", "Admin"));
        }
예제 #2
0
        public IActionResult CreateComputerTechnology(AdminComputerTechnologyViewModel model)
        {
            ViewBag.ShowNavbar = false;

            var convertedModel = _mapper.Map <ComputerTechnologyDTO>(model);

            _computerTechnologyService.CreateComputerTechnology(convertedModel);

            return(RedirectToAction("ComputerTechnology", "Admin"));
        }
예제 #3
0
        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));
        }
예제 #4
0
        public IActionResult DeleteComputerTechnology(AdminComputerTechnologyViewModel model)
        {
            _computerTechnologyService.DeleteComputerTechnology(model.Id);

            return(RedirectToAction("ComputerTechnology", "Admin"));
        }