public static List<Gallery> GetGalleryWithoutPhoto(DataTable dt) { if (dt.Rows.Count == 0) return null; List<Gallery> galleryList = new List<Gallery>(); for (int i = 0; i < dt.Rows.Count; i++) { Gallery g = new Gallery(); g.SiteId = Convert.ToInt32(dt.Rows[i]["SiteID"]); g.GalleryId = Convert.ToInt32(dt.Rows[i]["GalleryId"]); g.GalleryName = dt.Rows[i]["GalleryName"].ToString(); g.Status = Convert.ToInt32(dt.Rows[i]["Status"]); g.UpdatedBy = dt.Rows[i]["UpdatedBy"].ToString(); g.UpdatedOn = Convert.ToDateTime(dt.Rows[i]["UpdatedOn"]); g.IsDefault = Convert.ToBoolean(dt.Rows[i]["IsDefault"]); galleryList.Add(g); } return galleryList; }
public static int SetPhotoGallery(Gallery g) { return DalPhotoGallery.SetPhotoGallery(g.SiteId, g.GalleryName, g.Status, g.UpdatedBy,g.IsDefault); }