public ActionResult UpdateWebInterface(int webInterfaceId) { var bo = imageService.GetItem(webInterfaceId); WebInterfaceViewModels webInterface = new WebInterfaceViewModels(); webInterface.MapFromBO(bo); return(View(webInterface)); }
public ActionResult UpdateWebInterfaceUpdate(WebInterfaceViewModels webInterface) { if (ModelState.IsValid) { try { var bo = webInterface.MapToBO(); imageService.UpdateItem(bo); } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = "Please, correct all errors."; } return(RedirectToAction("Home")); }
public ActionResult Home() { //Danh sách slider trang chủ var modelImage = imageService.GetData("SLTC", "Slider"); //ImageViewModels là view của slider trang chủ var apiModelImage = ImageViewModels.MapFromBOs(modelImage); //Danh sách phần mềm nổi bật var modelFeaturedSoftware = articleService.GetFeaturedItem(); var apiModelFeaturedSoftware = FeaturedSoftwareViewModels.MapFromBOs(modelFeaturedSoftware); //Danh sách kho phần mềm var modelNormalSoftware = articleService.GetNormalItem(); var apiModelNormalSoftware = NormalSoftwareViewModels.MapFromBOs(modelNormalSoftware); //Danh sách kho giao diện web var modelWebInterface = imageService.GetData("KGDW", "Slider"); var apiModelWEbInterface = WebInterfaceViewModels.MapFromBOs(modelWebInterface); HomeViewModels homeViewModels = new HomeViewModels(); homeViewModels.imageViewModels = apiModelImage; homeViewModels.FeaturedSoftwareViewModels = apiModelFeaturedSoftware; homeViewModels.NormalSoftwareViewModels = apiModelNormalSoftware; homeViewModels.WebInterfaceViewModels = apiModelWEbInterface; return(View("Home", homeViewModels)); }
public ActionResult CreateWebInterface() { WebInterfaceViewModels webInterface = new WebInterfaceViewModels(); return(View(webInterface)); }