Ejemplo n.º 1
0
 private void sbtnPrint_Click(object sender, System.EventArgs e)
 {
     try
     {
         string strDateZoom = this.label1.Text.Trim();
         err = null;
         DataTable dt = ca.GetBusiQuery(strDateZoom, out err);
         if (dt == null || dt.Rows.Count <= 0)
         {
             MessageBox.Show("没有数据可以打印!", "系统提示", MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
             return;
         }
         CMSMData.CMSMStruct.BusiStruct cis = new CMSMData.CMSMStruct.BusiStruct();
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             cis.strNewAssCount  = dt.Rows[i]["新增会员数"].ToString();
             cis.strLostAssCount = dt.Rows[i]["挂失会员数"].ToString();
             cis.strFillFeeCount = dt.Rows[i]["充值次数"].ToString();
             cis.strFIllFee      = dt.Rows[i]["充值金额"].ToString();
             cis.strBankFillFee  = dt.Rows[i]["银联卡充值"].ToString();
             cis.strAssConsCount = dt.Rows[i]["会员消费次数"].ToString();
             cis.strAssCons      = dt.Rows[i]["会员消费金额"].ToString();
             cis.strRetailCount  = dt.Rows[i]["零售次数"].ToString();
             cis.strRetail       = dt.Rows[i]["零售金额"].ToString();
             cis.strSum          = dt.Rows[i]["现金总额"].ToString();
             cis.strDeptname     = this.cmbDept.Text;
             cis.strOperName     = SysInitial.CurOps.strOperName;
             DateTime dtNow = DateTime.Now;
             cis.strOperDate = dtNow.ToShortDateString() + " " + dtNow.ToLongTimeString();
         }
         System.Windows.Forms.DialogResult diaRes1 = MessageBox.Show("是否打印当日结账?", "请确认", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
         if (diaRes1.Equals(System.Windows.Forms.DialogResult.Yes))
         {
             this.BusiPrint(cis, ca);
             this.OpenDrawer();
         }
     }
     catch (Exception er)
     {
         MessageBox.Show("打印机设置有误,无法打印!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
         clog.WriteLine(er.ToString());
     }
 }
Ejemplo n.º 2
0
        protected void BusiPrint(CMSMData.CMSMStruct.BusiStruct ffs, CommAccess cs, string strOperName, string strDeptName)
        {
            Exception err;

            CMSM.Print.PrintBusi pBill = new CMSM.Print.PrintBusi();
            pBill.strDateType     = "业务量报表";
            pBill.strNewAssCount  = ffs.strNewAssCount;
            pBill.strLostAssCount = ffs.strLostAssCount;
            pBill.strFillFeeCount = ffs.strFillFeeCount;
            pBill.strFIllFee      = ffs.strFIllFee;
            pBill.strBankFillFee  = ffs.strBankFillFee;
            pBill.strAssConsCount = ffs.strAssConsCount;
            pBill.strAssCons      = ffs.strAssCons;
            pBill.strRetailCount  = ffs.strRetailCount;
            pBill.strRetail       = ffs.strRetail;
            pBill.strSum          = ffs.strSum;
            pBill.strOperName     = ffs.strOperName;
            DateTime dtnow = DateTime.Now;

            pBill.strOperDate = dtnow.ToShortDateString() + dtnow.ToShortTimeString();
            pBill.strDeptName = ffs.strDeptname;

            string strEn = cs.GetEnterpriseName(out err);

            if (err != null)
            {
                MessageBox.Show("查询企业名称出错,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
                strEn = "道讯收银";
            }

            string strTel = cs.GetTel2(out err);

            if (err != null)
            {
                MessageBox.Show("查询服务电话出错,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
                strTel = "";
            }
            pBill.cnvcTel = strTel;
            Print(strEn, pBill);
        }
Ejemplo n.º 3
0
 protected void BusiPrint(CMSMData.CMSMStruct.BusiStruct ffs, CommAccess cs)
 {
     BusiPrint(ffs, cs, ffs.strOperName, ffs.strOperName);
 }