private void button1_Click(object sender, EventArgs e) { try { if (this.txtPInfo.Tag == null) { throw new MessageException("请先选择供应商!"); } frmSelectSInfo fss = new frmSelectSInfo(); StockInfoData sid = fss.showSelect((PurveyInfoData)this.txtPInfo.Tag); addStoctInfo(sid, 1); } catch (MessageException ex) { if (ex.Message != "") { MessageBox.Show(ex.Message); } } }
private void button3_Click(object sender, EventArgs e) { try { ListViewItem lvi = this.lvSInfo.SelectedItems[0]; if (lvi == null) { throw new MessageException("请选择要修改的项目!"); } frmSelectSInfo fss = new frmSelectSInfo(); StockInfoData sid = fss.showSelect((PurveyInfoData)this.txtPInfo.Tag, (MerchandiseInfoData)lvi.Tag, lvi.SubItems[1].Text, lvi.SubItems[2].Text); addStoctInfo(sid, 2); } catch (MessageException ex) { if (ex.Message != "") { MessageBox.Show(ex.Message); } } }