예제 #1
0
        public ActionResult UpdateWebInterface(int webInterfaceId)
        {
            var bo = imageService.GetItem(webInterfaceId);
            WebInterfaceViewModels webInterface = new WebInterfaceViewModels();

            webInterface.MapFromBO(bo);
            return(View(webInterface));
        }
예제 #2
0
 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"));
 }
예제 #3
0
        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));
        }
예제 #4
0
        public ActionResult CreateWebInterface()
        {
            WebInterfaceViewModels webInterface = new WebInterfaceViewModels();

            return(View(webInterface));
        }