public void alignmentChanged(string parameter) { string[] parameters = parameter.Split('b'); Debug.WriteLine(parameter); tblSlidesService service = new tblSlidesService(); if (parameters[0].Equals("0")) { Debug.WriteLine("Links"); service.updateAlignment(service.getSlides().ElementAt(Int32.Parse(parameters[1])), 0); } else { if (parameters[0].Equals("1")) { Debug.WriteLine("Midden"); service.updateAlignment(service.getSlides().ElementAt(Int32.Parse(parameters[1])), 1); } else { Debug.WriteLine("Rechts"); service.updateAlignment(service.getSlides().ElementAt(Int32.Parse(parameters[1])), 2); } } }
public void VerwijderSlide(int id) { System.Diagnostics.Debug.WriteLine(id); tblSlidesService slideService = new tblSlidesService(); slideService.deleteSlide(id); CSCBelgiumCloudService cloudService = new CSCBelgiumCloudService(); cloudService.DeleteSlideImagesFromStorage(id); }
public ActionResult addSliderImage(AddSliderImageViewModel vm) { tblSlidesService service = new tblSlidesService(); tblSlides slide = new tblSlides(); if (vm.newSlide.CaptionText == null) { vm.newSlide.CaptionText = " "; } if (ModelState.IsValid) { Debug.WriteLine("test:" + vm.newSlide.CationColor); slide.CaptionText = vm.newSlide.CaptionText; slide.CaptionAlignment = vm.alignment.ToString(); slide.CationColor = vm.newSlide.CationColor; if (service.getSlides().Count() != 0) { slide.SlideOrder = service.getSlides().Select(a => a.SlideOrder).Max() + 1; } else { slide.SlideOrder = 1; } HttpPostedFileBase file = Request.Files["txtAfbeelding"]; if (file != null && file.ContentLength > 0) { System.Diagnostics.Debug.WriteLine("image"); MemoryStream target = new MemoryStream(); file.InputStream.CopyTo(target); byte[] image = target.ToArray(); slide.ImagePath = @"Slides/Slide"; service.addSlide(slide); slide.ImagePath = @"Slides/Slide" + slide.SlideID + @"/slide.jpg"; service.UpdateSlide(slide); CSCBelgiumCloudService cloudservice = new CSCBelgiumCloudService(); cloudservice.UploadImageAsBlob(slide, file); return(RedirectToAction("ManageSliderImages")); } else { Debug.WriteLine("file null"); return(View()); } } else { Debug.WriteLine("modelstate invalid"); return(View()); } }
public ActionResult Index(string element = "") { HomeViewModel vm = new HomeViewModel(); tblCarsService service = new tblCarsService(); tblSlidesService sservice = new tblSlidesService(); vm.first8Cars = service.getAllCars().Take(8).ToList(); vm.firstImages = service.GetFrontImages().ToList(); vm.slides = sservice.getSlides(); vm.scrollToElement = element; return(View(vm)); }
public ActionResult ManageSliderImages() { tblSlidesService service = new tblSlidesService(); ManageSliderImagesViewModel vm = new ManageSliderImagesViewModel(); vm.slides = service.getSlides(); vm.LinksEerst = Uitlijning.Links; vm.MiddenEerst = Uitlijning.Midden; vm.RechtsEerst = Uitlijning.Rechts; vm.order = service.getSlides().Select(a => a.SlideOrder).ToList(); return(View(vm)); }
public void OrderChanged(string parameter) { string[] parameters = parameter.Split('b'); string s = parameters[0]; int result; if (int.TryParse(s, out result)) { Debug.WriteLine(parameter); tblSlidesService service = new tblSlidesService(); Debug.WriteLine(parameters[0]); Debug.WriteLine(parameters[1]); service.UpdateOrder(service.getSlides().ElementAt(Int32.Parse(parameters[1])), Int32.Parse(parameters[0])); } else { } }