コード例 #1
0
ファイル: frmBase.cs プロジェクト: zhenghua75/CMSM
        protected void AssIgPrint(CMSMData.CMSMStruct.CardHardStruct chs, CMSMData.CMSMStruct.ConsItemStruct cis, CommAccess cs, string strSerialok, DataTable dtIgItem, double dTolCharge)
        {
            Exception err;
            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 = "道讯收银";
            }

            DataTable dtNewItem = cs.GetNewGoods(out err);

            if (err != null)
            {
                MessageBox.Show("查询推荐新品出错,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
                dtNewItem = new DataTable();
            }
            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 = "";
            }
            DataTable dtConsItem = new DataTable();

            CMSM.Print.ConsTicket pBill = new CMSM.Print.ConsTicket(strSerialok, this.GetColCh(cis.strDeptID, "MD"), cis.strCardID, "当前余额",
                                                                    cis.dChargeLast, chs.dCurCharge,
                                                                    dtConsItem, dTolCharge, 0, "积分兑换", dTolCharge, 0, dtNewItem, strTel, dtIgItem, 0, cis.strOperDate);
            Print(strEn, pBill);
        }
コード例 #2
0
        private void sbtnOk_Click(object sender, System.EventArgs e)
        {
            if (dtConsItem.Rows.Count <= 0)
            {
                MessageBox.Show("没有进行任何消费!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                return;
            }

            CMSMData.CMSMStruct.ConsItemStruct cis = new CMSMData.CMSMStruct.ConsItemStruct();
            cis.strOperDate = dtpCheckDate.Text;
            cis.strOperName = SysInitial.CurOps.strOperName;
            cis.dtItem      = dtConsItem;
            cis.strDeptID   = SysInitial.CurOps.strDeptID;
            cis.strTolCount = txtTolCount.Text;
            err             = null;
            cs.SaleCheck(cis, out err);
            if (err != null)
            {
                MessageBox.Show("盘点失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
            }
            else
            {
                cmbGoodsName.Text = "请输入...";
                txtGoodsID.Text   = "";
                cmbGoodsName.Items.Clear();
                cmbGoodsName.Refresh();
                txtPrice.Text    = "";
                txtCount.Text    = "";
                txtTolCount.Text = "0";
                InitConsItemDataTable(dtConsItem);
                this.DgBind();
            }
        }
コード例 #3
0
ファイル: frmBase.cs プロジェクト: zhenghua75/CMSM
        protected void RetailConsPrint(CMSMData.CMSMStruct.ConsItemStruct cis, CommAccess cs, string strSerialok, DataTable dtConsItem, double dTolCharge, double dPay, double dBalance, double dDiscount)
        {
            Exception err;
            string    strConsTypeTmp = cis.strConsType;

            switch (cis.strConsType)
            {
            case "PT002":
                strConsTypeTmp = "支付现金";
                break;

            case "PT005":
                strConsTypeTmp = "门店报损";
                break;

            case "PT006":
                strConsTypeTmp = "门店品尝";
                break;

            case "PT007":
                strConsTypeTmp = "门店退货";
                break;

            case "PT008":
                strConsTypeTmp = "银行卡";
                break;
            }
            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 = "道讯收银";
            }
            DataTable dtNewItem = cs.GetNewGoods(out err);

            if (err != null)
            {
                MessageBox.Show("查询推荐新品出错,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
                dtNewItem = new DataTable();
            }
            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 = "";
            }
            DataTable dtIgItem = new DataTable();

            CMSM.Print.ConsTicket pBill = new CMSM.Print.ConsTicket(strSerialok, this.GetColCh(cis.strDeptID, "MD"), "", "", 0, 0, dtConsItem, dTolCharge, dDiscount, strConsTypeTmp, dPay, dBalance, dtNewItem, strTel, dtIgItem, 0, cis.strOperDate);
            Print(strEn, pBill);
        }
コード例 #4
0
ファイル: frmSpecialCons.cs プロジェクト: zhenghua75/CMSM
        private void sbtnOk_Click(object sender, System.EventArgs e)
        {
            if (dtConsItem.Rows.Count <= 0)
            {
                MessageBox.Show("没有进行任何消费!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                return;
            }
            double dPay       = 0;
            double dTolCharge = 0;

            if (SysInitial.TP == "1")
            {
                dPay       = double.Parse(txtPay.Text.Trim());
                dTolCharge = double.Parse(txtTolCharge.Text.Trim());
            }


            double dBalance = dPay - dTolCharge;

            if (dPay < dTolCharge)
            {
                MessageBox.Show("付款金额不能小于总消费金额!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }

            string strOperType     = this.GetColEn(this.cmbSepcialType.Text, "OP");
            string strConsBillType = "";

            CMSMData.CMSMStruct.ConsItemStruct cis = new CMSMData.CMSMStruct.ConsItemStruct();
            if (strOperType == null || strOperType == "")
            {
                MessageBox.Show("操作类型代码转换错误!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                switch (strOperType)
                {
                case "OP010":
                    //门店报损
                    strConsBillType = "PT005";
                    cis.strComments = "门店报损";
                    break;

                case "OP011":
                    //门店品尝
                    strConsBillType = "PT006";
                    cis.strComments = "门店品尝";
                    break;

                case "OP012":
                    //门店退货
                    strConsBillType = "PT007";
                    cis.strComments = "门店退货";
                    break;
                }
            }
            double dDiscount = 1;

            cis.strAssID    = txtAssID.Text.Trim();
            cis.strCardID   = txtCardID.Text.Trim();
            cis.dChargeLast = 0;
            cis.dTolCharge  = dTolCharge;
            DateTime dtNow = DateTime.Now;

            cis.strOperDate = dtNow.ToShortDateString() + " " + dtNow.ToLongTimeString();
            cis.iSerial     = Int64.Parse(dtNow.ToString("yyyyMMddHHmmss"));
            //cis.iSerial = Int64.Parse(cis.strOperDate.Substring(0, 4) + cis.strOperDate.Substring(5, 2) + cis.strOperDate.Substring(8, 2) + cis.strOperDate.Substring(11, 2) + cis.strOperDate.Substring(14, 2) + cis.strOperDate.Substring(17, 2));
            cis.strOperName = SysInitial.CurOps.strOperName;
            cis.dTRate      = 0;
            cis.dPay        = dPay;
            cis.dBalance    = dBalance;
            cis.strConsType = strConsBillType;
            cis.dtItem      = dtConsItem;
            cis.strDeptID   = SysInitial.CurOps.strDeptID;
            err             = null;
            string strSerialok = cs.SpecialCons(cis, strOperType, out err);

            strSerialok = cis.iSerial.ToString();
            if (err != null)
            {
                MessageBox.Show("特殊商品消耗失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
            }
            else
            {
                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))
                {
                    if (strSerialok == "")
                    {
                        MessageBox.Show("打印小票出错,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        this.Close();
                    }
                    else
                    {
                        this.RetailConsPrint(cis, cs, strSerialok, dtConsItem, dTolCharge, dPay, dBalance, dDiscount);
                    }
                }

                cmbGoodsName.Text = "请输入...";
                txtGoodsID.Text   = "";
                cmbGoodsName.Items.Clear();
                cmbGoodsName.Refresh();
                txtPrice.Text     = "0";
                txtCount.Text     = "";
                txtPay.Text       = "";
                txtBalance.Text   = "";
                txtTolCount.Text  = "0";
                txtTolCharge.Text = "0";
                dtConsItem        = new DataTable();
                dtConsItem.Columns.Add("GoodsID");
                dtConsItem.Columns.Add("GoodsName");
                dtConsItem.Columns.Add("Price");
                dtConsItem.Columns.Add("Count");
                dtConsItem.Columns.Add("Rate");
                dtConsItem.Columns.Add("Fee");
                dtConsItem.Columns.Add("Comments");
                dtConsItem.Columns["Comments"].DefaultValue = "";
                SpecTypeIndex = -10;
                this.cmbSepcialType.Enabled       = true;
                this.cmbSepcialType.SelectedIndex = 0;
                this.DgBind();
            }
        }
コード例 #5
0
        private void sbtnOk_Click(object sender, System.EventArgs e)
        {
            Ping      ping = new Ping();
            PingReply pr   = ping.Send("10.10.10.203");

            if (pr.Status != IPStatus.Success)
            {
                MessageBox.Show("童鞋,刷卡失败!vpn掉线了或者网速太慢!,请检查vpn连接!");
                return;
            }

            if (dtIgItem.Rows.Count <= 0)
            {
                MessageBox.Show("没有进行任何兑换操作!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                return;
            }
            int dTolCharge = int.Parse(txtTolCharge.Text.Trim());

            if (double.Parse(txtIgCur.Text.Trim()) < dTolCharge)
            {
                MessageBox.Show("当前积分不足,不能兑换!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            CMSMData.CMSMStruct.ConsItemStruct cis = new CMSMData.CMSMStruct.ConsItemStruct();
            cis.strAssID    = txtAssID.Text.Trim();
            cis.strCardID   = txtCardID.Text.Trim();
            cis.dChargeLast = double.Parse(txtIgCur.Text.Trim());
            cis.dTolCharge  = (double)dTolCharge;
            string   strIG     = (cis.dChargeLast - dTolCharge).ToString() + "分";
            string   strCharge = this.txtCharge.Text.Trim() + "元";
            DateTime dtNow     = DateTime.Now;

            cis.iSerial     = Int64.Parse(dtNow.ToString("yyyyMMddHHmmss"));
            cis.strOperDate = dtNow.ToShortDateString() + " " + dtNow.ToLongTimeString();
            //cis.iSerial = Int64.Parse(cis.strOperDate.Substring(0, 4) + cis.strOperDate.Substring(5, 2) + cis.strOperDate.Substring(8, 2) + cis.strOperDate.Substring(11, 2) + cis.strOperDate.Substring(14, 2) + cis.strOperDate.Substring(17, 2));
            cis.strOperName = SysInitial.CurOps.strOperName;
            cis.dTRate      = 0;
            cis.dPay        = dTolCharge;
            cis.dBalance    = 0;
            cis.strConsType = "PT003";
            cis.dtItem      = dtIgItem;
            cis.iIgLast     = int.Parse(txtIgCur.Text.Trim());
            cis.strIgType   = "IGT02";
            cis.strDeptID   = SysInitial.CurOps.strDeptID;
            DataTable dtIG = SysInitial.dsSys.Tables["IG"];

            cis.iIgValue = -dTolCharge;
            chs.iCurIg   = cis.iIgLast + cis.iIgValue;

            string strSerialok = "";

            err = null;
            string strresult = cs.IntegralChange(cis, chs, out err, out strSerialok);

            strSerialok = cis.iSerial.ToString();
            if (err != null || (!strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK)))
            {
                if (err != null)
                {
                    if (strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK))
                    {
                        MessageBox.Show("积分兑换失败,请重试!\n" + err.Message, "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        clog.WriteLine(err);
                    }
                    else
                    {
                        MessageBox.Show("积分兑换失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        clog.WriteLine(err + " " + strresult);
                    }
                }
                else
                {
                    if (strresult != "")
                    {
                        strresult = this.GetColCh(strresult, "ERR");
                        MessageBox.Show("积分兑换失败,请重试!\n", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        clog.WriteLine("card:" + cis.strCardID + " " + strresult);
                    }
                }
            }
            else
            {
                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))
                {
                    if (strSerialok == "")
                    {
                        MessageBox.Show("打印小票出错,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        this.Close();
                    }
                    else
                    {
                        //this.PrintBill(chs.strCardID,strSerialok,strCharge,strIG,this.GetColCh(cis.strDeptID,"MD"),cis.strDeptID);
                        this.AssIgPrint(chs, cis, cs, strSerialok, dtIgItem, dTolCharge);
                    }
                }
                this.ClearText();
                txtGoodsID.ReadOnly  = true;
                cmbGoodsName.Enabled = false;
                txtCount.ReadOnly    = true;
                sbtnRead.Enabled     = true;
                txtTolCount.Text     = "0";
                txtTolCharge.Text    = "0";
                dtIgItem             = new DataTable();
                dtIgItem.Columns.Add("GoodsID");
                dtIgItem.Columns.Add("GoodsName");
                dtIgItem.Columns.Add("IgValue");
                dtIgItem.Columns.Add("Count");
                dtIgItem.Columns.Add("IgPay");
                this.DgBind();
            }
        }
コード例 #6
0
ファイル: frmRepeatPrint.cs プロジェクト: zhenghua75/CMSM
        private void RepeatPrint(string strSerial)
        {
            CommAccess cs = new CommAccess(SysInitial.ConString);
            Exception  err;
            DataTable  dtConsItem = cs.GetConsItemBySerial(out err, strSerial);

            if (err != null)
            {
                MessageBox.Show("查询消费明细出错,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
                dtConsItem = new DataTable();
            }

            DataTable dtBill = cs.GetBillBySerial(out err, strSerial);

            if (err != null)
            {
                MessageBox.Show("查询小票信息出错,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
                dtBill = new DataTable();
            }
            DataRow dr = dtBill.Rows[0];

            CMSMData.CMSMStruct.ConsItemStruct cis = new CMSMData.CMSMStruct.ConsItemStruct();
            cis.strCardID = dr["vcCardId"].ToString();
            string strConsType = dr["vcConsType"].ToString();

            cis.strConsType = strConsType;
            cis.dTRate      = Convert.ToDouble(dr["nTRate"].ToString());
            cis.dFee        = Convert.ToDouble(dr["nFee"].ToString());
            cis.dPay        = Convert.ToDouble(dr["nPay"].ToString());
            cis.dBalance    = Convert.ToDouble(dr["nBalance"].ToString());
            cis.iIgValue    = Convert.ToInt32(dr["iIgValue"].ToString());
            cis.strOperName = dr["vcOperName"].ToString();
            cis.strOperDate = dr["dtConsDate"].ToString();
            cis.strDeptID   = dr["vcDeptId"].ToString();

            CMSMData.CMSMStruct.CardHardStruct chs = new CMSMData.CMSMStruct.CardHardStruct();

            switch (strConsType)
            {
            case "PT001":                    //会员刷卡
                this.AssConsPrint(chs, cis, cs, strSerial, dtConsItem, cis.dFee);
                break;

            case "PT002":                    //支付现金
                this.RetailConsPrint(cis, cs, strSerial, dtConsItem, cis.dFee, cis.dPay, cis.dBalance, cis.dTRate);
                break;

            case "PT003":                    //积分兑换
                dtConsItem.Columns["Price"].ColumnName = "IgValue";
                dtConsItem.Columns["Fee"].ColumnName   = "IgPay";
                this.AssIgPrint(chs, cis, cs, strSerial, dtConsItem, cis.dFee);
                break;

            case "PT004":                    //赠送商品
                this.AssGiftPrint(chs, cis, cs, strSerial, dtConsItem, cis.dFee);
                break;

            case "PT005":
                this.RetailConsPrint(cis, cs, strSerial, dtConsItem, cis.dFee, cis.dPay, cis.dBalance, cis.dTRate);
                break;

            case "PT006":
                this.RetailConsPrint(cis, cs, strSerial, dtConsItem, cis.dFee, cis.dPay, cis.dBalance, cis.dTRate);
                break;

            case "PT007":
                this.RetailConsPrint(cis, cs, strSerial, dtConsItem, cis.dFee, cis.dPay, cis.dBalance, cis.dTRate);
                break;

            case "PT008":
                this.RetailConsPrint(cis, cs, strSerial, dtConsItem, cis.dFee, cis.dPay, cis.dBalance, cis.dTRate);
                break;
            }
        }