private void button_2_Click(object sender, EventArgs e) { if (MessageBox.Show("发送当前采购单数据到服务器?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) != DialogResult.Yes) { return; } DataSet ds; string msg; ShowWait("正读取采购单...请稍候..."); if (!CgBillDAL.GetSendCgBill(out ds, out msg)) { HideWait(); MessageBox.Show("提取采购单失败:" + msg); return; } if (!Comm.Comm.RecvCgBill(ds, PubGlobal.OrgCode, PubGlobal.User.UserCode, PubGlobal.User.Password, out msg)) { HideWait(); MessageBox.Show("发送采购单失败:" + msg); return; } HideWait(); MessageBox.Show("发送采购单成功"); if (!CgBillDAL.RemoveCgBill(out msg)) { MessageBox.Show("删除采购单失败"); } cgBill.Clear(); cgBillBindingSource.ResetBindings(true); button_4_Click(null, null); }
private void FrmCgBill_Load(object sender, EventArgs e) { ShowWait("正在读取采购明细...\r\n请稍候..."); string msg; if (!CgBillDAL.ListBill(out cgBill, out msg)) { MessageBox.Show("查询采购单明细失败:" + msg); HideWait(); return; } HideWait(); cgBillBindingSource.DataSource = cgBill; }
private void FrmKcQuery_Load(object sender, EventArgs e) { cSideBtn1.Init(); cSideBtn1.Open(); cScanner1.Open(); string msg; if (!CgBillDAL.GetMasSerialNo(out PubGlobal.CgSerialNo, out msg)) { MessageBox.Show("当前明细序号读取失败:" + msg); PubGlobal.CgSerialNo = 0; } ReFlush(); }
private void button_2_Click(object sender, EventArgs e) { if (dgBillMx.CurrentRowIndex >= 0) { DBCgBill bill = (DBCgBill)cgBillBindingSource.Current; StringBuilder strBuilder = new StringBuilder(); strBuilder.AppendFormat("是否删除【{0}】{1}", new string[] { bill.Barcode, bill.PluName }); if (MessageBox.Show(strBuilder.ToString(), "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { string msg; if (!CgBillDAL.DeleteBill(bill, out msg)) { MessageBox.Show("删除失败:" + msg); } else { cgBill.RemoveAt(cgBill.FindIndex(a => a.ID == bill.ID)); cgBillBindingSource.ResetBindings(true); } } } }
private void button_4_Click(object sender, EventArgs e) { if (cgBill.Count > 0) { if (MessageBox.Show("采购单未发送至后台。是否要删除此采购单?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { if (MessageBox.Show("采购单清空后将无法恢复。确认清空采购单?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.Yes) { return; } string msg; if (!CgBillDAL.RemoveCgBill(out msg)) { MessageBox.Show("清空失败:" + msg); return; } cgBill.Clear(); cgBillBindingSource.Clear(); } } cgBill = null; this.DialogResult = DialogResult.OK; }