public static DataTable GetTableForPageOfProducts( Guid storeGuid, int pageNumber, int pageSize) { var images = new List <StoreImage>(); using (IDataReader reader = DBStoreImage.GetForPageOfReference(storeGuid, pageNumber, pageSize)) { while (reader.Read()) { images.Add(new StoreImage() { Guid = new Guid(reader["Guid"].ToString()), ReferenceGuid = new Guid(reader["ReferenceGuid"].ToString()), StoreGuid = storeGuid, ImageUrl = reader["ImageUrl"].ToString(), DisplayOrder = Convert.ToInt32(reader["DisplayOrder"]), Alt = reader["Alt"].ToString(), Title = reader["Title"].ToString() }); } } return(ListToTable(images)); }
private bool Update() { return(DBStoreImage.Update( Guid, ImageUrl, DisplayOrder, Alt, Title)); }
private bool Create() { int rowsAffected = DBStoreImage.Add( Guid, ReferenceGuid, StoreGuid, ImageUrl, DisplayOrder, Alt, Title); return(rowsAffected > 0); }
private bool Exists() { bool result = false; using (IDataReader reader = DBStoreImage.Get(Guid)) { if (reader.Read()) { result = true; } } return(result); }
private void GetImage(Guid guid) { using (IDataReader reader = DBStoreImage.Get(guid)) { if (reader.Read()) { Guid = guid; ReferenceGuid = new Guid(reader["ReferenceGuid"].ToString()); StoreGuid = new Guid(reader["StoreGuid"].ToString()); ImageUrl = reader["ImageUrl"].ToString(); DisplayOrder = Convert.ToInt32(reader["DisplayOrder"]); Alt = reader["Alt"].ToString(); Title = reader["Title"].ToString(); } } }
public static List <StoreImage> GetByStore(Guid storeGuid) { var images = new List <StoreImage>(); using (IDataReader reader = DBStoreImage.GetByStore(storeGuid)) { while (reader.Read()) { images.Add(new StoreImage() { Guid = new Guid(reader["Guid"].ToString()), ReferenceGuid = new Guid(reader["ReferenceGuid"].ToString()), StoreGuid = storeGuid, ImageUrl = reader["ImageUrl"].ToString(), DisplayOrder = Convert.ToInt32(reader["DisplayOrder"]), Alt = reader["Alt"].ToString(), Title = reader["Title"].ToString() }); } } return(images); }
public static bool DeleteByStore(Guid storeGuid) { return(DBStoreImage.DeleteByStore(storeGuid)); }
public static bool DeleteByReference(Guid referenceGuid) { return(DBStoreImage.DeleteByReference(referenceGuid)); }
public static bool Delete(Guid guid) { return(DBStoreImage.Delete(guid)); }