public object GetGallery([FromBody] ParamDefault OBJ) { GetGalleryDetailBL GETOBJ = new GetGalleryDetailBL(); var GetGalleryResult = GETOBJ.GetGallery(OBJ); return(GetGalleryResult); }
public object GetGallery(ParamDefault OBJ) { try { SchoolMainContext db = new ConcreateContext().GetContext(OBJ.USERID, OBJ.PASSWORD); if (db == null) { return(new Results() { IsSuccess = false, Message = "Invalid User" }); } var AcadamicYear = db.View_GETACADEMICYEAR.FirstOrDefault(); if (AcadamicYear == null) { return(new Results { IsSuccess = false, Message = "Not Found Academic Year" }); } var GetGallery = db.VW_GetGallery.Where(r => r.EDUYEAR == AcadamicYear.ACADEMICYEAR).OrderByDescending(r => r.CREATEDON).ToList(); List <Gallary> Details = new List <Gallary>(); object[,] str = new object[GetGallery.Count, 2]; for (int i = 0; i < GetGallery.Count; i++) { string[] imgpath = GetGallery[i].IMAGEPATH.Split(','); object[] strpath = new object[imgpath.Length]; for (int j = 0; j < imgpath.Length; j++) { strpath[j] = imgpath[j]; } Details.Add(new Gallary { AlbumName = GetGallery[i].ALBUMNAME, ImageList = strpath }); //str[i,0] = "AlbumName:" + GetGallery[i].ALBUMNAME ; //str[i, 1] = strpath; } return(new GalleryResult() { IsSuccess = true, URL = "http://www.nkvsem.akronsystems.com/ALBUMUPLOADS/Original/", GalleryAlbumList = Details.ToArray() }); } catch (Exception ex) { return(new Results { IsSuccess = false, Message = ex.Message }); } }