/// <summary> /// 保存Cash Drawer信息 /// </summary> private void SaveCashDrawer() { TaCashDrawSetInfo taCashDrawSetInfo = new TaCashDrawSetInfo(); taCashDrawSetInfo.IsUseCashDraw = chkCashDrawSet.Checked ? "Y" : "N"; taCashDrawSetInfo.CashDrawPwd = chkCashDrawSet.Checked ? txtPwd.Text : ""; taCashDrawSetInfo.ReportPrinter = luePrtOpRptPrt.EditValue.ToString(); taCashDrawSetInfo.A4ReportPrinter = luePrtOpA4.EditValue.ToString(); taCashDrawSetInfo.RoundUpDecimal = txtPrtOpRoundUpDecimal.Text; new SystemData().GetTaCashDrawSet(); try { if (CommonData.TaCashDrawSet.Any()) { taCashDrawSetInfo.ID = CommonData.TaCashDrawSet.FirstOrDefault().ID; _control.UpdateEntity(taCashDrawSetInfo); } else { _control.AddEntity(taCashDrawSetInfo); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } }
private void btnSave_Click(object sender, EventArgs e) { TaCashDrawSetInfo taCashDrawSetInfo = new TaCashDrawSetInfo(); taCashDrawSetInfo.IsUseCashDraw = chkCashDrawSet.Checked ? "Y" : "N"; taCashDrawSetInfo.CashDrawPwd = chkCashDrawSet.Checked ? txtPwd.Text : ""; new SystemData().GetTaCashDrawSet(); try { if (CommonData.TaCashDrawSet.Any()) { taCashDrawSetInfo.ID = CommonData.TaCashDrawSet.FirstOrDefault().ID; _control.UpdateEntity(taCashDrawSetInfo); } else { _control.AddEntity(taCashDrawSetInfo); } } catch (Exception ex) { LogHelper.Error(this.Name, ex); } CommonTool.ShowMessage("Save successful!"); }
/// <summary> /// 获得Cash Drawer信息 /// </summary> private void GetCashDrawer() { new SystemData().GetTaCashDrawSet(); TaCashDrawSetInfo taCashDrawSetInfo = CommonData.TaCashDrawSet.FirstOrDefault(); if (taCashDrawSetInfo != null) { chkCashDrawSet.Checked = taCashDrawSetInfo.IsUseCashDraw.Equals("Y"); if (chkCashDrawSet.Checked) { txtPwd.Enabled = true; txtPwd.Text = taCashDrawSetInfo.CashDrawPwd; } else { txtPwd.Enabled = false; txtPwd.Text = ""; } luePrtOpRptPrt.EditValue = taCashDrawSetInfo.ReportPrinter; luePrtOpA4.EditValue = taCashDrawSetInfo.A4ReportPrinter; txtPrtOpRoundUpDecimal.Text = taCashDrawSetInfo.RoundUpDecimal; } else { chkCashDrawSet.Checked = false; txtPwd.Enabled = false; txtPwd.Text = ""; } }
private void btnDrawer_Click(object sender, EventArgs e) { new SystemData().GetTaCashDrawSet(); TaCashDrawSetInfo taCashDrawSetInfo = CommonData.TaCashDrawSet.FirstOrDefault(); if (taCashDrawSetInfo != null) { if (taCashDrawSetInfo.IsUseCashDraw.Equals("Y")) { FrmCashDraw frmCashDraw = new FrmCashDraw(); frmCashDraw.ShowDialog(); } else { string strPrtName = taCashDrawSetInfo.ReportPrinter; OpenDriverCash2(27, 112, 48, 55, 121, strPrtName); } } }