问个问题?
当我点击结账下机 yes时 问什么不执行 if 里面的代码 而是直接跳过去了
MessageBox.Show("要结账下机吗", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk);
if ( dialogResult == DialogResult.Yes)
{
int id = MemberHelper.id;
int payment = MemberHelper.payment;
int currentMoney = Convert.ToInt32(MemberHelper.CurrentMoney);
int originalMoney = Convert.ToInt32(MemberHelper.CurrentMoney); ;
string memberOffTime = string.Format(DateTime.Now.ToString());
string states = "下机";
bool flag = false;
flag = new SystemManager().IsUpdateCurrentMoney(id, memberOffTime, payment, originalMoney, currentMoney, states);
System.Diagnostics.Process mp = new System.Diagnostics.Process();
mp.StartInfo.FileName = "cmd.exe";
mp.StartInfo.RedirectStandardInput = true;
mp.StartInfo.RedirectStandardOutput = true;
mp.StartInfo.RedirectStandardError = true;
mp.StartInfo.UseShellExecute = false;
mp.StartInfo.CreateNoWindow = true;
mp.Start();//启动进程
mp.StandardInput.WriteLine("shutdown -s -t 0");//关机
}