コード例 #1
0
ファイル: FrmCgBillSend.cs プロジェクト: wpmyj/HS-M60
        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);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
ファイル: FrmKcQuery.cs プロジェクト: wpmyj/HS-M60
        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();
        }
コード例 #4
0
 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);
             }
         }
     }
 }
コード例 #5
0
ファイル: FrmCgBillSend.cs プロジェクト: wpmyj/HS-M60
 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;
 }