private void btnExit_Click(object sender, EventArgs e) { if (AppUtil.ShowQuestion("你确认要退出吗?") == DialogResult.Yes) { this.ParentForm.Close(); } }
private void btnLogout_Click(object sender, EventArgs e) { if (AppUtil.ShowQuestion("你确认要注销吗?") == DialogResult.Yes) { this.ParentForm.LoadView(typeof(FrmLogin), false, true); } }
private void btnFinish_Click(object sender, EventArgs e) { try { if (AppUtil.ShowQuestion("是否要保存当前设置?") != DialogResult.Yes) { return; } Cursor.Current = Cursors.WaitCursor; AppUtil.SetXmlNodeValue(QSConstValue.SERVERIP_NODE, AppUtil.EncryptString(txtserverip.Text, "")); AppUtil.SetXmlNodeValue(QSConstValue.SERVERNAME_NODE, AppUtil.EncryptString(txtdbname.Text, "")); AppUtil.SetXmlNodeValue(QSConstValue.COM_NODE, AppUtil.EncryptString(txtCOM.Text, "")); AppUtil.ShowInformation("设置成功!"); CloseView(); } catch (Exception ex) { AppUtil.ShowWarning("设置失败!原因:" + ex.ToString()); logger.ErrorException("FrmConnSetting窗体btnFinish_Click事件:" + ex.Message, ex); } finally { Cursor.Current = Cursors.Default; } }
private void btnClose_Click(object sender, EventArgs e) { try { if (AppUtil.ShowQuestion("是否要放弃当前设置?") != DialogResult.Yes) { return; } Cursor.Current = Cursors.WaitCursor; CloseView(); } catch (Exception ex) { logger.ErrorException("FrmConnSetting窗体btnClose_Click事件:" + ex.Message, ex); } finally { Cursor.Current = Cursors.Default; } }
private void btnFinish_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; DataTable dt = dgScan.DataSource as DataTable; if (dt == null || dt.Rows.Count == 0) { AppUtil.ShowError("请至少扫描一条记录!"); return; } dt = WebAPIUtil.GetAPIByJsonToGeneric <DataTable>(string.Format("/api/scan/GetTempScanCy/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.operModule)); DataView dv = new DataView(dt); dv.RowFilter = "CYQTY <> 0"; if (dv.Count > 0 && AppUtil.ShowQuestion("仍有货品未扫描完毕,是否确认完成?") != DialogResult.Yes) { return; } WebAPIUtil.GetToAPIByJsonToAPIResult(string.Format("/api/scan/TempScanFinish/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.operModule)); AppUtil.ShowInformation("操作完成!"); this.ParentForm.LoadView(typeof(FrmHead), false, true); } catch (Exception ex) { logger.ErrorException("FrmScan窗体txtorderNo_KeyDown事件:" + ex.Message, ex); AppUtil.ShowError("操作失败!原因:" + ex.Message); } finally { Cursor.Current = Cursors.Default; txtbarcode.Focus(); txtbarcode.Text = string.Empty; } }
/// <summary> /// 取消事件 /// 如果用户名或者密码有值,则清空文本,否则退出程序 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnCancel_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; if (txtUserId.Text.Trim() == string.Empty && txtUserPwd.Text.Trim() == string.Empty && AppUtil.ShowQuestion("是否确认要退出系统?") == DialogResult.Yes) { this.ParentForm.Close(); } else { Initialize(); } } catch (Exception ex) { logger.ErrorException("FrmLogin:btnCancel_Click:" + ex.Message, ex); } finally { Cursor.Current = Cursors.Default; } }