/// <summary> /// ����һ������ /// </summary> public void Add(ProductExtModel model) { DbCommand dbCommand = dbw.GetStoredProcCommand("UP_pdProductExt_ADD"); dbw.AddInParameter(dbCommand, "ProductId", DbType.Int32, model.ProductId); dbw.AddInParameter(dbCommand, "ProductDesc", DbType.String, model.ProductDesc); dbw.ExecuteNonQuery(dbCommand); }
/// <summary> /// ����ʵ������� /// </summary> public ProductExtModel ReaderBind(IDataReader dataReader) { ProductExtModel model=new ProductExtModel(); object ojb; ojb = dataReader["ProductId"]; if(ojb != null && ojb != DBNull.Value) { model.ProductId=(int)ojb; } model.ProductDesc=dataReader["ProductDesc"].ToString(); return model; }
/// <summary> /// ����һ������ /// </summary> public void Update(ProductExtModel model) { dal.Update(model); }
/// <summary> /// ����һ������ /// </summary> public void Add(ProductExtModel model) { dal.Add(model); }
/// <summary> /// ��������б� /// </summary> public List<ProductExtModel> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List<ProductExtModel> modelList = new List<ProductExtModel>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { ProductExtModel model; for (int n = 0; n < rowsCount; n++) { model = new ProductExtModel(); if(ds.Tables[0].Rows[n]["ProductId"].ToString()!="") { model.ProductId=int.Parse(ds.Tables[0].Rows[n]["ProductId"].ToString()); } model.ProductDesc=ds.Tables[0].Rows[n]["ProductDesc"].ToString(); modelList.Add(model); } } return modelList; }