Esempio n. 1
0
        private void sbtnOk_Click(object sender, System.EventArgs e)
        {
            switch (label2.Text.Trim())
            {
            case "Again":
                if (txtCardID.Text.Trim() == "" || txtCardID.Text.Trim().Length != 5)
                {
                    MessageBox.Show("会员卡号不可为空且为5位,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    txtCardID.Focus();
                    return;
                }

                Exception  err = null;
                CommAccess cs  = new CommAccess(SysInitial.ConString);
                if (!cs.ChkCardIDDup(txtCardID.Text.Trim(), out err))
                {
                    SysInitial.strTmp = txtCardID.Text.Trim();
                }
                else
                {
                    MessageBox.Show("该卡号已经被其他会员使用过,不能再使用,请重新输入!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    if (err != null)
                    {
                        clog.WriteLine(err);
                    }
                    txtCardID.Focus();
                    return;
                }
                break;

            default:
                break;
            }
            this.Close();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        private void sbtnSet_Click(object sender, System.EventArgs e)
        {
            CMSMData.CMSMStruct.CommStruct cos = new CMSMData.CMSMStruct.CommStruct();
            if (txtFee.Text.Trim() == "")
            {
                cos.strCommName = "0";
            }
            else if (double.Parse(txtFee.Text.Trim()) < 0)
            {
                MessageBox.Show("消费金额不能小于0!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                cos.strCommName = txtFee.Text.Trim();
            }

            if (txtIg.Text.Trim() == "")
            {
                cos.strCommCode = "0";
            }
            else if (double.Parse(txtIg.Text.Trim()) < 0)
            {
                MessageBox.Show("赠送积分分值不能小于0!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                cos.strCommCode = txtIg.Text.Trim();
            }
            cos.strCommSign = "IG";
            cos.strComments = "积分赠送";
            CommAccess cs  = new CommAccess(SysInitial.ConString);
            Exception  err = null;

            cs.UpdateIgComm(cos, out err);
            if (err == null)
            {
                MessageBox.Show("消费积分设置成功!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                err = null;
                SysInitial.CreatDS(out err);
                if (err != null)
                {
                    MessageBox.Show("系统出错,将自动关闭,稍后请重新登录系统!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    Application.Exit();
                }
                return;
            }
            else
            {
                MessageBox.Show("消费积分设置失败!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
                return;
            }
        }
Esempio n. 4
0
        private void sbtnOk_Click(object sender, System.EventArgs e)
        {
            CMSMStruct.OperStruct opsnew = new CMSMData.CMSMStruct.OperStruct();
            opsnew.strLimit = SysInitial.CurOps.strLimit;
            string strpwdCon = "";

            if (txtPwd.Text.Trim() == "" || txtPwd.Text.Trim().Length > 6)
            {
                MessageBox.Show("密码小于等于6位字符!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                txtPwd.Focus();
                return;
            }
            else
            {
                opsnew.strPwd = txtPwd.Text.Trim();
            }
            if (txtPwdConf.Text.Trim() == "" || txtPwdConf.Text.Trim().Length > 6)
            {
                MessageBox.Show("密码小于等于6位字符!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                txtPwdConf.Focus();
                return;
            }
            else
            {
                strpwdCon = txtPwdConf.Text.Trim();
            }
            if (opsnew.strPwd != strpwdCon)
            {
                MessageBox.Show("两次输入的密码不一致,请重新输入!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                this.txtPwd.Text     = "";
                this.txtPwdConf.Text = "";
                this.txtPwd.Focus();
                return;
            }
            CommAccess cs  = new CommAccess(SysInitial.ConString);
            Exception  err = null;

            cs.UpdateOper(SysInitial.CurOps, opsnew, out err);
            if (err != null)
            {
                MessageBox.Show("修改密码失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
                this.Close();
            }
            else
            {
                MessageBox.Show("修改密码成功,新密码将于下次登录时生效!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                this.txtPwd.Text     = "";
                this.txtPwdConf.Text = "";
                this.txtPwd.Focus();
            }
        }
Esempio n. 5
0
        private void txtCardID_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar != 13)
            {
                if (e.KeyChar == 8 || e.KeyChar == 42)
                {
                    return;
                }
                if (e.KeyChar < 48 || e.KeyChar > 57)
                {
                    e.Handled = true;
                    return;
                }
            }
            else
            {
                switch (label2.Text.Trim())
                {
                case "Again":
                    if (txtCardID.Text.Trim() == "" || txtCardID.Text.Trim().Length > 10)
                    {
                        MessageBox.Show("会员卡号不可为空且小于10位,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        txtCardID.Focus();
                        return;
                    }

                    Exception  err = null;
                    CommAccess cs  = new CommAccess(SysInitial.ConString);
                    if (!cs.ChkCardIDDup(txtCardID.Text.Trim(), out err))
                    {
                        SysInitial.strTmp = txtCardID.Text.Trim();
                    }
                    else
                    {
                        MessageBox.Show("该卡已经有其他会员使用,请重新输入!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        if (err != null)
                        {
                            clog.WriteLine(err);
                        }
                        txtCardID.Focus();
                        return;
                    }
                    break;

                default:
                    break;
                }
                this.Close();
            }
        }
Esempio n. 6
0
        // 当日结账
        protected void ChangeCheckPrint(CMSMData.CMSMStruct.DailyAccountStruct ffs, CommAccess cs, string strOperName, string strDeptName)
        {
            Exception err;

            CMSM.Print.PrintChangeCheck pBill = new CMSM.Print.PrintChangeCheck();
            pBill.cnvcDateType = "当日结账";
            pBill.cnvcOperName = ffs.strOper;
            DateTime dtnow = DateTime.Now;

            pBill.cnvcOperDate      = dtnow.ToShortDateString() + dtnow.ToShortTimeString();
            pBill.cnvcDeptName      = strDeptName;
            pBill.cnvcFillCount     = ffs.strFillCount;
            pBill.cnvcFillFee       = ffs.strFillFee;
            pBill.cnvcFillCountBank = ffs.strFillCountBank;
            pBill.cnvcFillFeeBank   = ffs.strFillFeeBank;
            pBill.cnvcConsCount     = ffs.strConsCount;
            pBill.cnvcRetail        = ffs.strRetail;
            pBill.cnvcRetailBank    = ffs.strRetailBank;
            pBill.cnvcAssCons       = ffs.strAssCons;
            pBill.cnvcRoll          = ffs.strRoll;
            pBill.cnvcRollSum       = ffs.strRollSum;
            pBill.cnvcLargCount     = ffs.strLargCount;
            pBill.cnvcCash          = ffs.strCash;

            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);
        }
Esempio n. 7
0
 static public void GetLocalDept(out Exception e)
 {
     try
     {
         CommAccess ca = new CommAccess(ConString);
         Exception  er = null;
         LocalDept = ca.GetLocalDept(out er);
         if (er != null)
         {
             e = er;
             return;
         }
         e = null;
     }
     catch (Exception err)
     {
         e = err;
     }
 }
Esempio n. 8
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);
        }
Esempio n. 9
0
        protected void FillFeePrint(CMSMData.CMSMStruct.FillFeeStruct ffs, CommAccess cs, string strAssName, string strOperName, string strDeptName)
        {
            Exception err;

            CMSM.Print.PrintedBill pBill = new CMSM.Print.PrintedBill();
            pBill.cnvcBillType     = "充值";
            pBill.cnvcMemberCardNo = ffs.strCardID;
            pBill.cnvcMemberName   = strAssName;
            pBill.cnnLastBalance   = Convert.ToDecimal(ffs.dFeeLast);
            pBill.cnnBalance       = Convert.ToDecimal(ffs.dFeeCur);
            pBill.cnnPrepay        = Convert.ToDecimal(ffs.dFillFee);
            pBill.cnnDonate        = Convert.ToDecimal(ffs.dFillProm);

            pBill.cnvcOperName = strOperName;
            pBill.cndOperDate  = Convert.ToDateTime(ffs.strFillDate);
            pBill.cnvcDeptName = 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);
        }
Esempio n. 10
0
 protected void ChangeCheckPrint(CMSMData.CMSMStruct.DailyAccountStruct ffs, CommAccess cs)
 {
     ChangeCheckPrint(ffs, cs, SysInitial.CurOps.strOperName, this.GetColCh(ffs.strDeptID, "MD"));
 }
Esempio n. 11
0
 protected void FillFeePrint(CMSMData.CMSMStruct.FillFeeStruct ffs, CommAccess cs, string strAssName)
 {
     FillFeePrint(ffs, cs, strAssName, SysInitial.CurOps.strOperName, this.GetColCh(ffs.strDeptID, "MD"));
 }
Esempio n. 12
0
        private void sbtnProm_Click(Object sender, System.EventArgs e)
        {
            CMSMData.CMSMStruct.CommStruct cos = new CMSMData.CMSMStruct.CommStruct();
            Hashtable htpar = new Hashtable();

            if (txtPromRate1.Text.Trim() == "")
            {
                cos.strCommCode = "0";
            }
            else if (double.Parse(txtPromRate1.Text.Trim()) < 0)
            {
                MessageBox.Show("充值赠款比例不能小于0!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                cos.strCommCode = txtPromRate1.Text.Trim();
            }
            cos.strCommName = "充值赠款100-500";
            cos.strCommSign = "FP1";
            cos.strComments = "充值赠款";
            htpar.Add("FP1", cos);

            CMSMData.CMSMStruct.CommStruct cos2 = new CMSMData.CMSMStruct.CommStruct();
            if (txtPromRate2.Text.Trim() == "")
            {
                cos2.strCommCode = "0";
            }
            else if (double.Parse(txtPromRate2.Text.Trim()) < 0)
            {
                MessageBox.Show("充值赠款比例不能小于0!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                cos2.strCommCode = txtPromRate2.Text.Trim();
            }
            cos2.strCommName = "充值赠款500-1000";
            cos2.strCommSign = "FP2";
            cos2.strComments = "充值赠款";
            htpar.Add("FP2", cos2);

            CMSMData.CMSMStruct.CommStruct cos3 = new CMSMData.CMSMStruct.CommStruct();
            if (txtPromRate3.Text.Trim() == "")
            {
                cos3.strCommCode = "0";
            }
            else if (double.Parse(txtPromRate3.Text.Trim()) < 0)
            {
                MessageBox.Show("充值赠款比例不能小于0!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                cos3.strCommCode = txtPromRate3.Text.Trim();
            }
            cos3.strCommName = "充值赠款1000以上";
            cos3.strCommSign = "FP3";
            cos3.strComments = "充值赠款";
            htpar.Add("FP3", cos3);

            CommAccess cs  = new CommAccess(SysInitial.ConString);
            Exception  err = null;

//			cs.UpdateFillPromComm(htpar,out err);
            if (err == null)
            {
                MessageBox.Show("充值赠款比例设置成功!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                err = null;
                SysInitial.CreatDS(out err);
                if (err != null)
                {
                    MessageBox.Show("系统出错,将自动关闭,稍后请重新登录系统!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    clog.WriteLine(err);
                    Application.Exit();
                }
                return;
            }
            else
            {
                MessageBox.Show("充值赠款比例设置失败!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                clog.WriteLine(err);
                return;
            }
        }
Esempio n. 13
0
        static public void CreatDS(out Exception e)
        {
            try
            {
                e = null;
                string FileName = "comset.bet";
                string filePath = Environment.CurrentDirectory;
                if (!System.IO.File.Exists(filePath + @"\" + FileName))
                {
                    intCom = 0;
                }
                else
                {
                    StreamReader fReader = new StreamReader(filePath + @"\" + FileName);
                    string       strline = "";
                    if ((strline = fReader.ReadLine()) == null)
                    {
                        intCom = 0;
                    }
                    else
                    {
                        intCom = Int16.Parse(strline.Substring(8, strline.Length - 8));
                    }
                }
                CommAccess ca = new CommAccess(ConString);
                Exception  er = null;
                LocalDeptName = ca.GetLocalDept(out LocalDeptName, out er);
                if (er != null)
                {
                    e = er;
                    return;
                }
                CommAccess ca1 = new CommAccess(ConString);
                LocalDeptID = ca1.GetLocalDept1(out LocalDeptID, out er);
                if (er != null)
                {
                    e = er;
                    return;
                }
                if (LocalDeptID == "")
                {
                    LocalDeptIDTmp   = "";
                    LocalDeptNameTmp = "";
                }
                else
                {
                    LocalDeptIDTmp   = LocalDeptID.Substring(0, 4);
                    LocalDeptNameTmp = LocalDeptName.Substring(0, 2);
                }

                con.ConnectionString = ConString;
                dsSys.Tables.Clear();
                string sql;

                int recount = 0;
                sql     = "select cnvcDeptID as cnvcCommCode,cnvcDeptName as cnvcCommName from tbDept where (cnvcLocalFlag is null or cnvcLocalFlag<>'LOCAL') and cnvcDeptID like '" + LocalDeptIDTmp + "%'";
                daTmp   = new SqlDataAdapter(sql, con);
                recount = daTmp.Fill(dsSys, "Dept");

                recount = 0;
                sql     = "select cnvcDeptID as cnvcCommCode,cnvcDeptName as cnvcCommName from tbDept where cnvcLocalFlag is null or cnvcLocalFlag<>'LOCAL' ";
                daTmp1  = new SqlDataAdapter(sql, con);
                recount = daTmp1.Fill(dsSys, "DeptTmp");

                recount = 0;
                sql     = "select cnvcDeptID as cnvcCommCode,cnvcDeptName as cnvcCommName from tbDept where cnvcDeptID like '" + LocalDeptID + "%'";
                daTmp   = new SqlDataAdapter(sql, con);
                recount = daTmp.Fill(dsSys, "AllDept");
                if (recount == 0)
                {
                    e = new Exception("参数不全");
                    return;
                }

                recount = 0;
                sql     = "select * from tbOper where cnbValidate=1 and cnvcDeptID=(select top 1 cnvcDeptID from tbDept where cnvcLocalFlag='LOCAL')";
                daTmp   = new SqlDataAdapter(sql, con);
                daTmp.Fill(dsSys, "Oper");

                sql   = "select * from tbCommCode where cnvcCommSign='MemState'";
                daTmp = new SqlDataAdapter(sql, con);
                daTmp.Fill(dsSys, "MemState");

                sql   = "select * from tbCommCode where cnvcCommSign='OPType'";
                daTmp = new SqlDataAdapter(sql, con);
                daTmp.Fill(dsSys, "OPType");

                sql   = "select distinct a.cnvcCommName as cnvcGoodsName,b.cnvcCommName as cnvcGoodsType from tbCommCode a,tbCommCode b where a.cnvcCommSign='GoodsName' and b.cnvcCommSign like 'GoodsType%' and b.cnvcCommSign='GoodsType'+a.cnvcCommCode";
                daTmp = new SqlDataAdapter(sql, con);
                daTmp.Fill(dsSys, "Goods");

                sql   = "select cnvcCompanyID,cnvcCompanyName,cnvcDeptID,cnvcDeptName from tbMebCompanyPrepay where cnbValidate=1 and cnvcDeptname like '" + LocalDeptNameTmp + "%' ";
                daTmp = new SqlDataAdapter(sql, con);
                daTmp.Fill(dsSys, "MebComp");

                sql   = "select cnvcDeliveryCompany from tbSpecialOilDept  where cnvcDeliveryComPany like '" + LocalDeptNameTmp + "%' order by cnvcDeliveryCompany";
                daTmp = new SqlDataAdapter(sql, con);
                daTmp.Fill(dsSys, "SpecDelivery");

                sql   = "select * from tbCommCode where cnvcCommSign='TRANLOSE'";
                daTmp = new SqlDataAdapter(sql, con);
                daTmp.Fill(dsSys, "TRANLOSE");

                sql   = "select * from tbCommCode where cnvcCommSign='OFFSET'";
                daTmp = new SqlDataAdapter(sql, con);
                daTmp.Fill(dsSys, "OFFSET");

                htSpecOilDept = null;
                htSpecOilDept = new Hashtable();
                DataTable dttmp = new DataTable();
                sql   = "select cnvcContractNo,cnvcDeliveryCompany from tbSpecialOilDept where cnvcDeliveryComPany like '" + LocalDeptNameTmp + "%' order by cnvcDeliveryCompany";
                daTmp = new SqlDataAdapter(sql, con);
                daTmp.Fill(dttmp);
                if (dttmp.Rows.Count > 0)
                {
                    string    strDeliName    = "";
                    ArrayList alContractList = null;
                    for (int i = 0; i < dttmp.Rows.Count; i++)
                    {
                        if (strDeliName == dttmp.Rows[i]["cnvcDeliveryCompany"].ToString())
                        {
                            alContractList.Add(dttmp.Rows[i]["cnvcContractNo"].ToString());
                            if (i == dttmp.Rows.Count - 1)
                            {
                                htSpecOilDept.Add(strDeliName, alContractList);
                            }
                        }
                        else
                        {
                            if (strDeliName != "" && alContractList.Count > 0)
                            {
                                htSpecOilDept.Add(strDeliName, alContractList);
                            }

                            alContractList = new ArrayList();
                            alContractList.Add(dttmp.Rows[i]["cnvcContractNo"].ToString());
                            strDeliName = dttmp.Rows[i]["cnvcDeliveryCompany"].ToString();
                            if (i == dttmp.Rows.Count - 1)
                            {
                                htSpecOilDept.Add(strDeliName, alContractList);
                            }
                        }
                    }
                }
            }
            catch (Exception err)
            {
                e = err;
            }
        }
Esempio n. 14
0
        static public void CreatDS(out Exception e)
        {
            try
            {
                string FileName = "comset.bet";
                string filePath = Environment.CurrentDirectory;
                if (!System.IO.File.Exists(filePath + @"\" + FileName))
                {
                    intCom = 0;
                }
                else
                {
                    StreamReader fReader = new StreamReader(filePath + @"\" + FileName);
                    string       strline = "";
                    if ((strline = fReader.ReadLine()) == null)
                    {
                        intCom = 0;
                    }
                    else
                    {
                        intCom = Int16.Parse(strline.Substring(8, strline.Length - 8));
                    }
                }
                CommAccess ca10 = new CommAccess(ConString);
                Exception  er   = null;
                LocalDeptName = ca10.GetLocalDept(out LocalDeptName, out er);
                if (er != null)
                {
                    e = er;
                    return;
                }

                con.ConnectionString = ConString;
                dsSys.Tables.Clear();
                string sql;

                sql    = "select * from tbCommCode where vcCommSign='AT' order by vcCommCode";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "AT");

                sql    = "select * from tbCommCode where vcCommSign='AT' and substring(vcComments,1,1)='Y' order by vcCommCode";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "AT1");

                sql    = "select * from tbCommCode where vcCommSign='AS'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "AS");

                sql    = "select * from tbCommCode where vcCommSign='ERR'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "ERR");

                sql    = "select * from tbCommCode where vcCommSign='GT'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "GoodsGT");

                sql    = "select * from tbCommCode where vcCommSign='OP'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "OP");

                sql    = "select distinct vcAssName,vcSpell from tbAssociator";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "AssSpell");

                sql    = "select distinct vcGoodsName,vcSpell from tbGoods";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "GoodsSpell");

                sql    = "select * from tbGoods";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "Goods");

                sql    = "select vcOperID,vcOperName,vcLimit,vcDeptID,IsDiscount from tbOper";// "select * from tbOper";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "Oper");

                sql    = "select * from tbCommCode where vcCommSign='LM' ";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "LM");

                sql    = "select * from tbCommCode where vcCommCode='LM003' and vcCommSign='LM'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "LM2");

                sql    = "select * from tbCommCode where vcCommCode<>'LM003' and vcCommSign='LM'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "LM3");

                sql    = "select * from tbCommCode where vcCommSign='IG'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "IG");

                //sql="select * from tbCommCode where vcCommSign='FP1'";
                sql = "if exists (select * from tbCommCode where vcCommSign=(select 'FP1-'+vcCommCode from tbCommCode where vcCommSign='local')) "
                      + " select * from tbCommCode where vcCommSign=(select 'FP1-'+vcCommCode from tbCommCode where vcCommSign='local') else select * from tbCommCode where vcCommSign='FP1'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "FP1");

                //sql="select * from tbCommCode where vcCommSign='FP2'";
                sql = "if exists (select * from tbCommCode where vcCommSign=(select 'FP2-'+vcCommCode from tbCommCode where vcCommSign='local')) "
                      + " select * from tbCommCode where vcCommSign=(select 'FP2-'+vcCommCode from tbCommCode where vcCommSign='local') else select * from tbCommCode where vcCommSign='FP2'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "FP2");

                //sql="select * from tbCommCode where vcCommSign='FP3'";
                sql = "if exists (select * from tbCommCode where vcCommSign=(select 'FP3-'+vcCommCode from tbCommCode where vcCommSign='local')) "
                      + " select * from tbCommCode where vcCommSign=(select 'FP3-'+vcCommCode from tbCommCode where vcCommSign='local') else select * from tbCommCode where vcCommSign='FP3'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "FP3");

                //sql="select * from tbCommCode where vcCommSign='FP4'";
                sql = "if exists (select * from tbCommCode where vcCommSign=(select 'FP4-'+vcCommCode from tbCommCode where vcCommSign='local')) "
                      + " select * from tbCommCode where vcCommSign=(select 'FP4-'+vcCommCode from tbCommCode where vcCommSign='local') else select * from tbCommCode where vcCommSign='FP4'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "FP4");

                //sql="select * from tbCommCode where vcCommSign='FP5'";
                sql = "if exists (select * from tbCommCode where vcCommSign=(select 'FP5-'+vcCommCode from tbCommCode where vcCommSign='local')) "
                      + " select * from tbCommCode where vcCommSign=(select 'FP5-'+vcCommCode from tbCommCode where vcCommSign='local') else select * from tbCommCode where vcCommSign='FP5'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "FP5");

                sql    = "select * from tbCommCode where vcCommSign='FP6'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "FP6");

                sql    = "select * from tbCommCode where vcCommSign='GT' order by vcCommCode ";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "GT");

                sql    = "select * from tbCommCode where vcCommSign='PT'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "PT");

                sql    = "select * from tbCommCode where vcCommSign='MD' and vcCommCode<>'CEN00'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "MD");

                sql    = "select * from tbCommCode where vcCommSign='BF'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "BF");

                sql    = "select * from tbCommCode where vcCommSign='DE'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "DE");

                sql    = "select * from tbCommCode where vcCommSign='ES'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "ES");

                sql    = "select * from tbCommCode where vcCommSign='OF'";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "OF");

                sql    = "select * from tbCommCode where vcCommSign='SFlag' and vcCommCode not in('1','2')";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dsSys, "SFlag");

                DataTable dtoperfunc = new DataTable();
                //sql="select * from tbOperFunc where vcFuncAddress in(select cnvcFuncAddress from tbFunc where cnvcFuncType='CS') order by vcOperID,vcFuncAddress";
                sql    = "select * from tbOperFunc  order by vcOperID,vcFuncAddress";
                daptmp = new SqlDataAdapter(sql, con);
                daptmp.Fill(dtoperfunc);
                ArrayList aloperfunc = new ArrayList();
                hsOperFunc = new Hashtable();
                foreach (DataRow dr in dtoperfunc.Rows)
                {
                    if (hsOperFunc.ContainsKey(dr["vcOperID"].ToString()))
                    {
                        aloperfunc = (ArrayList)hsOperFunc[dr["vcOperID"].ToString()];
                        CMSMStruct.OperFuncStruct ops = new CMSMData.CMSMStruct.OperFuncStruct();
                        ops.strOperID      = dr["vcOperID"].ToString();
                        ops.strFuncName    = dr["vcFuncName"].ToString();
                        ops.strFuncAddress = dr["vcFuncAddress"].ToString();
                        aloperfunc.Add(ops);
                    }
                    else
                    {
                        aloperfunc = new ArrayList();
                        CMSMStruct.OperFuncStruct ops = new CMSMData.CMSMStruct.OperFuncStruct();
                        ops.strOperID      = dr["vcOperID"].ToString();
                        ops.strFuncName    = dr["vcFuncName"].ToString();
                        ops.strFuncAddress = dr["vcFuncAddress"].ToString();
                        aloperfunc.Add(ops);
                        hsOperFunc.Add(dr["vcOperID"].ToString(), aloperfunc);
                    }
                }

                con.Open();
                sql = "select vcCommName from tbCommCode where vcCommSign='SPF' and vcCommCode='Q1'";
                SqlCommand    cmd = new SqlCommand(sql, con);
                SqlDataReader drr = cmd.ExecuteReader();
                drr.Read();
                string strQLTime = drr[0].ToString();
                drr.Close();
                con.Close();
                dtQLTime = new DateTime(int.Parse(strQLTime.Substring(0, 4)), int.Parse(strQLTime.Substring(5, 2)), int.Parse(strQLTime.Substring(8, 2)));

                CommAccess ca1 = new CommAccess(ConString);
                LocalDept = ca1.GetLocalDept(out er);
                if (er != null)
                {
                    e = er;
                    return;
                }

                CommAccess ca11 = new CommAccess(ConString);
                er = null;
                CP = ca11.GetCP(out er);
                if (er != null)
                {
                    e = er;
                    return;
                }


                CommAccess ca2 = new CommAccess(ConString);
                er   = null;
                Card = ca2.GetCard(out er);
                if (er != null)
                {
                    e = er;
                    return;
                }

                CommAccess ca3 = new CommAccess(ConString);
                er  = null;
                Tel = ca3.GetTel2(out er);
                if (er != null)
                {
                    e = er;
                    return;
                }

                CommAccess ca4 = new CommAccess(ConString);
                er = null;
                TP = ca4.GetTP(out er);
                if (er != null)
                {
                    e = er;
                    return;
                }

                er       = null;
                MainDept = ca4.GetMainDept(out er);
                if (er != null)
                {
                    e = er;
                    return;
                }


                e = null;
            }
            catch (Exception err)
            {
                e = err;
            }
        }
Esempio n. 15
0
 protected void BusiPrint(CMSMData.CMSMStruct.BusiStruct ffs, CommAccess cs)
 {
     BusiPrint(ffs, cs, ffs.strOperName, ffs.strOperName);
 }
Esempio n. 16
0
        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);
        }
Esempio n. 17
0
        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;
            }
        }