public static List <GalleryListViewModel> GetImageGallery(int pageNumber, int numberOfItems, out int numberOfPages) { List <GalleryListViewModel> myList = new List <GalleryListViewModel>(); DataTable dt = GalleryDAL.GetImageGalleryList(pageNumber, numberOfItems, out numberOfPages); foreach (DataRow row in dt.Rows) { GalleryListViewModel myListItems = new GalleryListViewModel { ImageId = (int)row["ImageID"], MainImage = row["ImageName"].ToString().Trim(), ThumbnailImage = row["ImageName"].ToString().Replace(Path.GetExtension(row["ImageName"].ToString()).ToLower(), "_thumb") + Path.GetExtension(row["ImageName"].ToString()).ToLower().Trim(), SmallThumbnail = row["ImageName"].ToString().Replace(Path.GetExtension(row["ImageName"].ToString()).ToLower(), "_small") + Path.GetExtension(row["ImageName"].ToString()).ToLower().Trim(), Manufacturer = row["Manufacturer"].ToString(), ModelName = row["ModelName"].ToString(), Disabled = (bool)row["Disabled"] }; myList.Add(myListItems); } return(myList); }
public static DataTable GetJsonImageGallery(int pageNumber, int numberOfItems, out int numberOfPages) { return(GalleryDAL.GetImageGalleryList(pageNumber, numberOfItems, out numberOfPages)); }