public static DataTable GetByOffer(Guid offerGuid) { DataTable dataTable = new DataTable(); dataTable.Columns.Add("Guid", typeof(Guid)); dataTable.Columns.Add("OfferGuid", typeof(Guid)); dataTable.Columns.Add("ProductGuid", typeof(Guid)); dataTable.Columns.Add("FullfillType", typeof(byte)); dataTable.Columns.Add("FullFillTermsGuid", typeof(Guid)); dataTable.Columns.Add("Quantity", typeof(int)); dataTable.Columns.Add("SortOrder", typeof(int)); dataTable.Columns.Add("Name", typeof(string)); using (IDataReader reader = DBOfferProduct.GetByOffer(offerGuid)) { while (reader.Read()) { DataRow row = dataTable.NewRow(); row["Guid"] = reader["Guid"]; row["OfferGuid"] = reader["OfferGuid"]; row["ProductGuid"] = reader["ProductGuid"]; row["FullfillType"] = reader["FullfillType"]; row["FullFillTermsGuid"] = reader["FullFillTermsGuid"]; row["Quantity"] = reader["Quantity"]; row["SortOrder"] = reader["SortOrder"]; row["Name"] = reader["Name"]; dataTable.Rows.Add(row); } } return(dataTable); }
public static Collection <OfferProduct> GetbyOffer(Guid offerGuid) { Collection <OfferProduct> offerProducts = new Collection <OfferProduct>(); using (IDataReader reader = DBOfferProduct.GetByOffer(offerGuid)) { while (reader.Read()) { OfferProduct offerProduct = new OfferProduct(); offerProduct.fullFillTermsGuid = new Guid(reader["FullfillTermsGuid"].ToString()); offerProduct.fullfillType = Convert.ToByte(reader["FullfillType"]); offerProduct.guid = new Guid(reader["Guid"].ToString()); offerProduct.offerGuid = offerGuid; offerProduct.productGuid = new Guid(reader["ProductGuid"].ToString()); offerProduct.quantity = Convert.ToInt32(reader["Quantity"]); offerProduct.sortOrder = Convert.ToInt32(reader["SortOrder"]); offerProducts.Add(offerProduct); } } return(offerProducts); }
public static IDataReader GetReaderByOffer(Guid offerGuid) { return(DBOfferProduct.GetByOffer(offerGuid)); }