private static EventItem GetItemFromReader(IDataReader dataReader) { EventItem objItem = new EventItem(); objItem.ItemCode = SqlHelper.GetString(dataReader, "ItemCode"); objItem.ItemName = SqlHelper.GetString(dataReader, "ItemName"); objItem.EventCode = SqlHelper.GetString(dataReader, "EventCode"); objItem.ItemDesc = SqlHelper.GetString(dataReader, "ItemDesc"); objItem.Prices = SqlHelper.GetDecimal(dataReader, "Prices"); objItem.DonatePrices = SqlHelper.GetDecimal(dataReader, "DonatePrices"); objItem.ConfirmPrices = SqlHelper.GetDecimal(dataReader, "ConfirmPrices"); objItem.BuyerConfirm = SqlHelper.GetDecimal(dataReader, "BuyerConfirm"); objItem.SellerConfirm = SqlHelper.GetDecimal(dataReader, "SellerConfirm"); objItem.Status = SqlHelper.GetString(dataReader, "Status"); objItem.ImgUrl = SqlHelper.GetString(dataReader, "ImgUrl"); objItem.isSell = SqlHelper.GetBoolean(dataReader, "isSell"); objItem.CreatedUser = SqlHelper.GetString(dataReader, "CreatedUser"); objItem.CreatedDate = SqlHelper.GetDateTime(dataReader, "CreatedDate"); objItem.BuyerName = SqlHelper.GetString(dataReader, "BuyerName"); objItem.BuyerCode = SqlHelper.GetString(dataReader, "BuyerCode"); objItem.BuyerPhone = SqlHelper.GetString(dataReader, "BuyerPhone"); objItem.IsPhoneValidate = SqlHelper.GetBoolean(dataReader, "IsPhoneValidate"); objItem.ItemTypeCode = SqlHelper.GetString(dataReader, "ItemTypeCode"); objItem.Curyid = SqlHelper.GetString(dataReader, "Curyid"); objItem.CuryAmt = SqlHelper.GetDecimal(dataReader, "CuryAmt"); objItem.ItemClass = SqlHelper.GetString(dataReader, "ItemClass"); return(objItem); }
public static EventItemCollection Filter(string EventCode, string ItemType) { EventItemCollection collection = new EventItemCollection(); using (var reader = SqlHelper.ExecuteReader("tblEventItem_Filter", new SqlParameter[] { new SqlParameter("@EventCode", EventCode), new SqlParameter("@ItemType", ItemType) })) { while (reader.Read()) { EventItem obj = new EventItem(); obj = GetItemFromReader(reader); collection.Add(obj); } } return(collection); }