From 0ba70af88c5942d2b7942788c0d20a2b8af967dd Mon Sep 17 00:00:00 2001 From: "hao.jin" Date: Sun, 29 May 2022 17:41:43 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=94=9F=E6=88=90VDA=E6=97=B6=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=9C=A8=E9=80=94=E6=95=B0=E9=87=8F=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=9D=A1=E4=BB=B6=E7=BB=93=E6=9E=9C=E7=9A=84?= =?UTF-8?q?bug=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Stone.WinModule/Standard/frmJISVDA.cs | 19 ++++++++++++++- .../Standard/frmMessageQuestion.cs | 23 +++++++++++++++---- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs index c824a71..bea8d86 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs +++ b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs @@ -289,10 +289,17 @@ namespace Stone.WinModule.Standard bool quantity_new = false; //是否采用新的数量来计算 if (msg2 != "") { - if (MyMessageBox.ShowQuestionPop("以下询问是否继续?\r\n" + msg2)) + var dr = ShowQuestionPopDr("以下询问是否继续?\r\n" + msg2); + if(dr == DialogResult.Cancel) + return; + if (dr==DialogResult.OK) { quantity_new = true; } + else + { + quantity_new = false; + } } CreateVDA(dtData, quantity_new); @@ -732,5 +739,15 @@ namespace Stone.WinModule.Standard string partcode; int qty; } + + public static DialogResult ShowQuestionPopDr(string MessageInfo) + { + var dr = new DialogResult(); + + frmMessageQuestion frm = new frmMessageQuestion(1); + frm.ShowQuestion(MessageInfo); + dr = frm.DialogResult; + return dr; + } } } diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmMessageQuestion.cs b/Stone.WinForm/Stone.WinModule/Standard/frmMessageQuestion.cs index 051adfb..397ed5b 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmMessageQuestion.cs +++ b/Stone.WinForm/Stone.WinModule/Standard/frmMessageQuestion.cs @@ -10,31 +10,46 @@ namespace Stone.WinModule.Standard { public partial class frmMessageQuestion : Form { + private int BillType = 0; public frmMessageQuestion() { InitializeComponent(); } + public frmMessageQuestion(int billType) + { + InitializeComponent(); + BillType = billType; + } public DialogResult ShowQuestion(string msg) { this.lblMessage.Text = msg; + this.DialogResult = DialogResult.None; return this.ShowDialog(); } private void btnOK_Click(object sender, EventArgs e) { - frmPasswordVerify frm = new frmPasswordVerify(); - frm.UserName = User.UserInfo.UserName; - if (frm.ShowDialog() == DialogResult.OK) + if (BillType == 0) + { + frmPasswordVerify frm = new frmPasswordVerify(); + frm.UserName = User.UserInfo.UserName; + if (frm.ShowDialog() == DialogResult.OK) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + } + else { this.DialogResult = DialogResult.OK; this.Close(); } - } private void btnCancel_Click(object sender, EventArgs e) { + DialogResult = DialogResult.No; this.Close(); } }