/// <summary> /// 对象实体绑定数据 /// </summary> private GiftOrderItemModel ReaderBind(IDataReader dataReader) { GiftOrderItemModel model = new GiftOrderItemModel(); object ojb; model.OrderId=dataReader["OrderId"].ToString(); ojb = dataReader["ProductId"]; if(ojb != null && ojb != DBNull.Value) { model.ProductId=(int)ojb; } ojb = dataReader["Quantity"]; if(ojb != null && ojb != DBNull.Value) { model.Quantity=(int)ojb; } ojb = dataReader["Score"]; if(ojb != null && ojb != DBNull.Value) { model.Score=(int)ojb; } ojb = dataReader["TotalScore"]; if(ojb != null && ojb != DBNull.Value) { model.TotalScore=(int)ojb; } model.ProductName = dataReader["productName"].ToString(); return model; }
/// <summary> /// 对象实体绑定数据 /// </summary> private GiftOrderItemModel ReaderBind(IDataReader dataReader) { GiftOrderItemModel model = new GiftOrderItemModel(); object ojb; model.OrderId = dataReader["OrderId"].ToString(); ojb = dataReader["ProductId"]; if (ojb != null && ojb != DBNull.Value) { model.ProductId = (int)ojb; } ojb = dataReader["Quantity"]; if (ojb != null && ojb != DBNull.Value) { model.Quantity = (int)ojb; } ojb = dataReader["Score"]; if (ojb != null && ojb != DBNull.Value) { model.Score = (int)ojb; } ojb = dataReader["TotalScore"]; if (ojb != null && ojb != DBNull.Value) { model.TotalScore = (int)ojb; } model.ProductName = dataReader["productName"].ToString(); return(model); }