public void SortOrders(int[] carsouselIds) { for (int i = 0; i < carsouselIds.Length; i++) { var carousel = _carouselBLL.GetByid(carsouselIds [i]); carousel.Order = i; _carouselBLL.Save(carousel); } }
public IActionResult Edit(int?id) { var carouselVM = new CarouselEditViewModel(); if (id.HasValue) { var carousel = _carouselBLL.GetByid(id.Value); carouselVM = CarouselEditViewModel.FromModel(carousel); } ViewData["Title"] = carouselVM.IsCreateMode ? "Create" : "Update"; return(View(carouselVM)); }