1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Text;
- namespace LYFZ.Software.MainBusiness.ReportPrint
- {
- public class FrmPrintInitialValue : Software.UI.ReportPrint.FrmPrintInitialValue
- {
- public string companyCode = "";
- public FrmPrintInitialValue()
- {
- this.btn_Cancel.Click += btn_Cancel_Click;
- this.btn_Ok.Click += btn_Ok_Click;
- this.Load += FrmPrintInitialValue_Load;
- }
- void FrmPrintInitialValue_Load(object sender, EventArgs e)
- {
-
- }
- public bool CheckSetingPrintSerialNo()
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- DataTable dt = orbll.GetView_Custom("tb_ErpSystemConfigure", StrWhere: "Sconfig_Code = 'PrintReceiptSerial_" + companyCode + "'", ShowColumnName: "*").Tables[0];
- return dt.Rows.Count > 0;
- }
- void btn_Ok_Click(object sender, EventArgs e)
- {
- if(string.IsNullOrEmpty(companyCode))
- {
- MessageBoxCustom.Show("企业编号不能为空!");
- return;
- }
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- DataTable dt = orbll.GetView_Custom("tb_ErpSystemConfigure", StrWhere: "Sconfig_Code = 'PrintReceiptSerial_" + companyCode + "'", ShowColumnName: "*").Tables[0];
- if (dt.Rows.Count == 0)
- {
- LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
- LYFZ.Model.Model_ErpSystemConfigure model = new Model.Model_ErpSystemConfigure();
- model.Sconfig_Code = "PrintReceiptSerial_" + companyCode;
- model.Sconfig_Name = "收款单打印时候的序号";
- model.Sconfig_Value = string.Format("{0:0000000}", (Convert.ToDecimal(this.nud_ValueData.Value - 1)));
- model.Sconfig_IsEnabled = true;
- model.Sconfig_Remark = "收款单打印时候的序号(每张的号码重覆,每打一张这里垒加一)";
- model.Sconfig_Type = "";
- model.Sconfig_Order = 1;
- model.Sconfig_CreateDatetime = DateTime.Now;
- model.Sconfig_CreateName = "";
- sgbll.Add(model);
- }
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- this.Close();
- }
- void btn_Cancel_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
|