private void btnAdd2List_Click(object sender, EventArgs e) { Goods goods = autxtNSupplyGoods.SelectedObj as Goods; if (null == goods) { if (!StringUtil.isEmpty(autxtNSupplyGoods.Term)) { DialogResult rslt = MessageBox.Show("无此商品!是否新增?", "操作结果", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (rslt == DialogResult.OK) { Usr usr = MainForm.usr; GoodsForm gForm = new GoodsForm(null, goodsManager, InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr)); gForm.ShowDialog(); } } return; } foreach (DataGridViewRow row in dtgvStockin.Rows) { long gId = StringUtil.Obj2Long(row.Cells[colGID.Name].Value); if (gId == goods.GID__PK) { MainForm.Warn("此商品已添加,请重新选择!"); autxtNSupplyGoods.clear(); return; } } int index = dtgvStockin.Rows.Add(); InitRow(index, goods); autxtNSupplyGoods.clear(); }
private void btnAdd_Click(object sender, EventArgs e) { GoodsForm gForm = new GoodsForm(null, manager, subCatgManager); DialogResult result = gForm.ShowDialog(); if (result == DialogResult.OK) { BindData(); } }
private void btnAddGoods_Click(object sender, EventArgs e) { GoodsForm gForm = new GoodsForm(null, goodsManager, subCatgManager); DialogResult result = gForm.ShowDialog(); if (result == DialogResult.OK) { btnQuery.PerformClick(); } }
private void btnOK_Click(object sender, EventArgs e) { if (pm.ProductID1 == -1) { //新增 string name = txtName.Text.Trim(); string jp = txtJp.Text.Trim(); string type = (cmdType.SelectedIndex + 1).ToString(); double price = Convert.ToDouble(txtPrice.Text.Trim()); ProductsModel pm2 = new ProductsModel(name, type, jp, price); int result = ProductsBLL.getAddGoods(pm2); if (result > 0) { MessageBox.Show("OK"); this.Close(); GoodsForm gf = new GoodsForm(); gf.Show(); } else { MessageBox.Show("NO"); } } else { //修改 string name = txtName.Text.Trim(); string jp = txtJp.Text.Trim(); string type = (cmdType.SelectedIndex + 1).ToString(); double price = Convert.ToDouble(txtPrice.Text.Trim()); ProductsModel pm2 = new ProductsModel(pm.ProductID1, name, type, jp, price); int result = ProductsBLL.getUpdateGoods(pm2); if (result > 0) { MessageBox.Show("OK"); this.Close(); GoodsForm gf = new GoodsForm(); gf.Show(); } else { MessageBox.Show("NO"); } } }
private void btnOK_Click(object sender, EventArgs e) { if (ptype.PTID1 == -1) { //新增 string name = txtType.Text.Trim(); ProductTypeModel ptype2 = new ProductTypeModel(); ptype2.PTName1 = name; int result = ProductsBLL.getAddType(ptype2); if (result > 0) { MessageBox.Show("OK"); this.Close(); GoodsForm gf = new GoodsForm(); gf.Show(); } else { MessageBox.Show("NO"); } } else { //修改 string name = txtType.Text.Trim(); ProductTypeModel ptype2 = new ProductTypeModel(ptype.PTID1, name); int result = ProductsBLL.getUpdateType(ptype2); if (result > 0) { MessageBox.Show("OK"); this.Close(); GoodsForm gf = new GoodsForm(); gf.Show(); } else { MessageBox.Show("NO"); } } }
private void dtgvMGoods_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow curRow = dtgvMGoods.CurrentRow; if (null != curRow) { Goods goods = new Goods(); goods.GID__PK = StringUtil.Obj2Int(curRow.Cells[colGId.Name].Value); goods.GName = StringUtil.Obj2Str(curRow.Cells[colGName.Name].Value); goods.Specs = StringUtil.Obj2Str(curRow.Cells[colSpecs.Name].Value); goods.Abbr = StringUtil.Obj2Str(curRow.Cells[colAbbr.Name].Value); goods.ShelfLife = StringUtil.Obj2Str(curRow.Cells[colShelfLife.Name].Value); goods.SubCatgID = StringUtil.Obj2Short(curRow.Cells[colSubCatgId.Name].Value); goods.Remark = StringUtil.Obj2Str(curRow.Cells[colRemark.Name].Value); goods.St = StringUtil.Obj2Str(curRow.Cells[colStEnum.Name].Value); GoodsForm gForm = new GoodsForm(goods, manager, subCatgManager); DialogResult result = gForm.ShowDialog(); if (result == DialogResult.OK) { BindData(); } } }