private void ShowInfo(int ProductId, int RelaProductId) { NoName.NetShop.BLL.RelaProductModelBll bll = new NoName.NetShop.BLL.RelaProductModelBll(); NoName.NetShop.Model.RelaProductModel model = bll.GetModel(ProductId, RelaProductId); this.lblProductId.Text = model.ProductId.ToString(); this.lblRelaProductId.Text = model.RelaProductId.ToString(); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(NoName.NetShop.Model.RelaProductModel model) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("UP_pdRelaProduct_Update"); db.AddInParameter(dbCommand, "ProductId", DbType.Int32, model.ProductId); db.AddInParameter(dbCommand, "RelaProductId", DbType.Int32, model.RelaProductId); db.ExecuteNonQuery(dbCommand); }
protected void btnAdd_Click(object sender, EventArgs e) { string strErr=""; if(strErr!="") { MessageBox.Show(this,strErr); return; } NoName.NetShop.Model.RelaProductModel model=new NoName.NetShop.Model.RelaProductModel(); NoName.NetShop.BLL.RelaProductModelBll bll=new NoName.NetShop.BLL.RelaProductModelBll(); bll.Update(model); }
protected void btnAdd_Click(object sender, EventArgs e) { string strErr = ""; if (strErr != "") { MessageBox.Show(this, strErr); return; } NoName.NetShop.Model.RelaProductModel model = new NoName.NetShop.Model.RelaProductModel(); NoName.NetShop.BLL.RelaProductModelBll bll = new NoName.NetShop.BLL.RelaProductModelBll(); bll.Add(model); }
/// <summary> /// 对象实体绑定数据 /// </summary> public NoName.NetShop.Model.RelaProductModel ReaderBind(IDataReader dataReader) { NoName.NetShop.Model.RelaProductModel model = new NoName.NetShop.Model.RelaProductModel(); object ojb; ojb = dataReader["ProductId"]; if (ojb != null && ojb != DBNull.Value) { model.ProductId = (int)ojb; } ojb = dataReader["RelaProductId"]; if (ojb != null && ojb != DBNull.Value) { model.RelaProductId = (int)ojb; } return(model); }
/// <summary> /// 得到一个对象实体 /// </summary> public NoName.NetShop.Model.RelaProductModel GetModel(int ProductId, int RelaProductId) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("UP_pdRelaProduct_GetModel"); db.AddInParameter(dbCommand, "ProductId", DbType.Int32, ProductId); db.AddInParameter(dbCommand, "RelaProductId", DbType.Int32, RelaProductId); NoName.NetShop.Model.RelaProductModel model = null; using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { if (dataReader.Read()) { model = ReaderBind(dataReader); } } return(model); }
/// <summary> /// ����ʵ������� /// </summary> public NoName.NetShop.Model.RelaProductModel ReaderBind(IDataReader dataReader) { NoName.NetShop.Model.RelaProductModel model=new NoName.NetShop.Model.RelaProductModel(); object ojb; ojb = dataReader["ProductId"]; if(ojb != null && ojb != DBNull.Value) { model.ProductId=(int)ojb; } ojb = dataReader["RelaProductId"]; if(ojb != null && ojb != DBNull.Value) { model.RelaProductId=(int)ojb; } return model; }
private void ShowInfo(int ProductId, int RelaProductId) { NoName.NetShop.BLL.RelaProductModelBll bll = new NoName.NetShop.BLL.RelaProductModelBll(); NoName.NetShop.Model.RelaProductModel model = bll.GetModel(ProductId, RelaProductId); }