/// <summary> /// Insert a ProductClassifyDetail. /// </summary> public void Insert(Model.ProductClassifyDetail productClassifyDetail) { // // todo:add other logic here // accessor.Insert(productClassifyDetail); }
/// <summary> /// Update a ProductClassifyDetail. /// </summary> public void Update(Model.ProductClassifyDetail productClassifyDetail) { // // todo: add other logic here. // accessor.Update(productClassifyDetail); }
private void btn_Add_Click(object sender, EventArgs e) { ChooseProductForm f = new ChooseProductForm(); if (f.ShowDialog(this) == DialogResult.OK) { foreach (Model.Product item in ChooseProductForm.ProductList) { if (this._productClassify.Details.Any(D => D.ProductId == item.ProductId)) { MessageBox.Show("商品:" + item.ProductName + " 已添加", this.Text, MessageBoxButtons.OK); continue; } else { Model.ProductClassifyDetail detail = this._detailManager.GetByProductId(item.ProductId); if (detail == null) { detail = new Book.Model.ProductClassifyDetail(); detail.ProductClassifyDetailId = Guid.NewGuid().ToString(); detail.ProductClassifyId = this._productClassify.ProductClassifyId; detail.ProductId = item.ProductId; detail.Product = item; detail.Inumber = (this._productClassify.Details.Count + 1).ToString(); this._productClassify.Details.Add(detail); } else { MessageBox.Show("商品:" + item.ProductName + " 已属于关键字 " + detail.ProductClassify.KeyWord, this.Text, MessageBoxButtons.OK); continue; } } } this.gridControl1.RefreshDataSource(); } }
public void Update(Model.ProductClassifyDetail e) { this.Update <Model.ProductClassifyDetail>(e); }
public void Insert(Model.ProductClassifyDetail e) { this.Insert <Model.ProductClassifyDetail>(e); }