Beispiel #1
0
 private void btChangeCheckPrint_Click(object sender, EventArgs e)
 {
     CMSMData.CMSMStruct.DailyAccountStruct ffs = new CMSMData.CMSMStruct.DailyAccountStruct();
     ffs.strOper          = this.cmbOper.Text.ToString();
     ffs.strFillCount     = this.txtFillCount.Text.ToString();
     ffs.strFillFee       = this.txtFillFee.Text.ToString();
     ffs.strFillCountBank = this.txtFillCountBank.Text.ToString();
     ffs.strFillFeeBank   = this.txtFillFeeBank.Text.ToString();
     ffs.strConsCount     = this.txtConsCount.Text.ToString();
     ffs.strRetail        = this.txtRetail.Text.ToString();
     ffs.strRetailBank    = this.txtRetailBank.Text.ToString();
     ffs.strAssCons       = this.txtAssCons.Text.ToString();
     ffs.strRoll          = this.txtRoll.Text.ToString();
     ffs.strRollSum       = this.txtRollSum.Text.ToString();
     ffs.strLargCount     = this.txtLargCount.Text.ToString();
     ffs.strCash          = this.txtCash.Text.ToString();
     ffs.strDeptID        = SysInitial.CurOps.strDeptID;
     //ffs.strOperDate=SysInitial.
     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.ChangeCheckPrint(ffs, cs);
         this.OpenDrawer();
     }
 }
        private static FileProperties GetFileProperties()
        {
            try {
                FileProperties fileprops = new FileProperties();
                while (true)
                {
                    SaveFileDialog savedialog = new SaveFileDialog()
                    {
                        CheckFileExists = false, DefaultExt = ".txt", Filter = "Text Files | *.txt", Title = "BOTW Randomized Splits"
                    };
                    savedialog.FileName = "botw_randomized_splits";

                    System.Windows.Forms.DialogResult response = savedialog.ShowDialog();
                    if (response.Equals(System.Windows.Forms.DialogResult.OK))
                    {
                        fileprops.Name = Path.GetFileName(savedialog.FileName);
                        fileprops.Path = Path.GetDirectoryName(savedialog.FileName) + "\\";
                    }
                    else
                    {
                        return(null);
                    }
                    if (CheckFileLock(savedialog.FileName) == true)
                    {
                        System.Windows.Forms.MessageBox.Show("Selected file open for editing" + System.Environment.NewLine + "Close file or select new filename", "BastianCAD Extract", MessageBoxButtons.OK);
                    }
                    else
                    {
                        return(fileprops);
                    }
                }
            }
            catch (System.Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }
            return(null);
        }
Beispiel #3
0
        private void sbtnExit_Click(object sender, System.EventArgs e)
        {
            string strCardID = txtCardID.Text.Trim();

            if (strCardID == "" || strCardID.Length != 5)
            {
                MessageBox.Show("会员卡号不可为空且为5位,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                txtCardID.Focus();
                return;
            }
            System.Windows.Forms.DialogResult diaRes = MessageBox.Show("是否确定该会员卡退卡?", "请确认", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
            if (diaRes.Equals(System.Windows.Forms.DialogResult.Yes))
            {
                err = null;
                cs.CardExit(strCardID, out err);
                if (err != null)
                {
                    MessageBox.Show("退卡失败,请重试!", "系统提示", 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.Information);
                    this.ClearText();
                    txtCardID.ReadOnly = false;
                    sbtnExit.Enabled   = false;
                }
            }
        }
Beispiel #4
0
        private void sbtnToGold_Click(object sender, System.EventArgs e)
        {
            string strCardID = txtCardID.Text.Trim();

            if (strCardID == "")
            {
                MessageBox.Show("会员卡号不可为空且小于10位,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                txtCardID.Focus();
                return;
            }

            System.Windows.Forms.DialogResult diaRes = MessageBox.Show("是否确定升级至银卡会员?", "请确认", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
            if (diaRes.Equals(System.Windows.Forms.DialogResult.Yes))
            {
                int ilastig = int.Parse(this.txtIg.Text.Trim());
                int icurig  = 0;
                if (this.txtAssTypeCode.Text.Trim() == "AT001")
                {
                    icurig = ilastig - 2000;
                }
                else
                {
                    icurig = ilastig - 1500;
                }
                err = null;
                string strresult = cs.AssUpToGoldType(this.txtAssTypeCode.Text.Trim(), this.txtAssID.Text.Trim(), strCardID, icurig, ilastig, out err);
                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("升级至金卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                            clog.WriteLine("card:" + strCardID + " " + strresult);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("升级至金卡成功!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                }
                this.ClearText();
                this.sbtnToSilver.Enabled = false;
                this.sbtnToGold.Enabled   = false;
            }
        }
Beispiel #5
0
        private void sbtnUnlose_Click(object sender, System.EventArgs e)
        {
            if (dataGrid1.CurrentRowIndex < 0)
            {
                MessageBox.Show("没有选中已挂失的会员!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                return;
            }
            System.Windows.Forms.DialogResult diaRes = MessageBox.Show("是否确定解挂该会员卡?", "请确认", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
            if (diaRes.Equals(System.Windows.Forms.DialogResult.Yes))
            {
                string strCardID = dataGrid1[dataGrid1.CurrentRowIndex, 0].ToString();

                err = null;
                cs.CardUnlose(strCardID, out err);
                if (err != null)
                {
                    MessageBox.Show("会员卡解挂失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    clog.WriteLine(err);
                    this.DgBind();
                }
                else
                {
                    MessageBox.Show("会员卡解挂成功!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                    this.DgBind();
                }
            }
        }
Beispiel #6
0
        private void btnGetFiles_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog folderPath = new FolderBrowserDialog();

            System.Windows.Forms.DialogResult dr = folderPath.ShowDialog();
            if (dr.Equals(DialogResult.OK))
            {
                txtDirectoryPath.Text = folderPath.SelectedPath;
            }
        }
Beispiel #7
0
        private void btnBrowseDocExportP1_Click(object sender, EventArgs e)
        {
            SaveFileDialog filePath = new SaveFileDialog();

            System.Windows.Forms.DialogResult dr = filePath.ShowDialog();
            if (dr.Equals(DialogResult.OK))
            {
                txtExportPath.Text = filePath.FileName;
            }
        }
Beispiel #8
0
 private void buttonOpenModifiedFile_Click(object sender, EventArgs e)
 {
     this.openFileDialog.Filter = "Sega Genesis ROM Images (*.bin)|*.bin";
     this.openFileDialog.Title  = "Open modified ROM Image";
     System.Windows.Forms.DialogResult result = this.openFileDialog.ShowDialog(this);
     if (result.Equals(System.Windows.Forms.DialogResult.OK))
     {
         this.textBoxModifiedFilePath.Text = this.openFileDialog.FileName;
     }
     this.validateCreateButtonEnabled();
 }
Beispiel #9
0
 private void buttonOpenIPSFileToCreate_Click(object sender, EventArgs e)
 {
     if (this.textBoxIPSFileToCreatePath.Text.Length > 0)
     {
         this.saveFileDialog.FileName = this.textBoxIPSFileToCreatePath.Text;
     }
     System.Windows.Forms.DialogResult result = this.saveFileDialog.ShowDialog(this);
     if (result.Equals(System.Windows.Forms.DialogResult.OK))
     {
         this.textBoxIPSFileToCreatePath.Text = this.saveFileDialog.FileName;
     }
     this.validateCreateButtonEnabled();
 }
        public void BrowseForDestinationFolder()
        {
            WinForms.FolderBrowserDialog fbd = new WinForms.FolderBrowserDialog
            {
                Description = "Select output folder."
            };

            WinForms.DialogResult folderBrowseResult = fbd.ShowDialog();
            if (folderBrowseResult.Equals(WinForms.DialogResult.OK))
            {
                _destinationFolderPath.Value = fbd.SelectedPath;
            }
        }
        private void TmpSceneDirectoryBtn_Click(object sender, RoutedEventArgs e)
        {
            var folderDialog = new WinForms.FolderBrowserDialog
            {
                ShowNewFolderButton = true,
                Description         = Properties.GUI.CurrentScene
            };

            WinForms.DialogResult result = folderDialog.ShowDialog();
            if (result.Equals(WinForms.DialogResult.OK))
            {
                TmpSceneDirectoryTxt.Text = folderDialog.SelectedPath;
            }
        }
Beispiel #12
0
 /// <summary>
 /// 打开文件
 /// </summary>
 /// <param name="FilePath"></param>
 /// <param name="text"></param>
 /// <param name="caption"></param>
 public static void OpenFile(string FilePath, bool WithDialog = false)
 {
     if (WithDialog is true)
     {
         Forms.DialogResult dialogResult = Forms.MessageBox.Show("是否打开文件?", "打开文件", Forms.MessageBoxButtons.YesNo, Forms.MessageBoxIcon.Question);
         if (dialogResult.Equals(Forms.DialogResult.Yes))
         {
             Process.Start(FilePath);
         }
     }
     else
     {
         Process.Start(FilePath);
     }
 }
Beispiel #13
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());
     }
 }
Beispiel #14
0
 /// <summary>
 /// 获取文件保存路径
 /// </summary>
 /// <returns></returns>
 public static string GetFilePath(string Extention)
 {
     Forms.SaveFileDialog saveFileDialog = new Forms.SaveFileDialog
     {
         InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory),
         FileName         = "坐标表-" + Utils.NamedObjectDictionary.ReadFromNOD(lib.AppConfig.ProjectInfoName[1]),//默认文件名
         Filter           = Extention + "|*." + Extention,
         //Filter = "所有文件(*.*)|*.*|Excel 2007 工作簿(*.xlsx)|*.xlsx|Word 2007 文档(*.docx)|*.docx",
         RestoreDirectory = false,
         OverwritePrompt  = false,
     };
     Forms.DialogResult dialogResult = saveFileDialog.ShowDialog();
     saveFileDialog.Dispose();
     if (dialogResult.Equals(Forms.DialogResult.OK))
     {
         return(saveFileDialog.FileName);
     }
     return(null);
 }
Beispiel #15
0
        private void sbtnRelease_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连接!");
                this.ClearText();
                txtCardID.ReadOnly  = false;
                sbtnRelease.Enabled = false;
                return;
            }

            string strCardID = txtCardID.Text.Trim();

            if (strCardID == "")
            {
                MessageBox.Show("会员卡号不可为空,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                txtCardID.Focus();
                return;
            }
            System.Windows.Forms.DialogResult diaRes = MessageBox.Show("是否确定解挂该会员卡?", "请确认", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
            if (diaRes.Equals(System.Windows.Forms.DialogResult.Yes))
            {
                err = null;
                cs.CardRelease(txtAssID.Text.Trim(), strCardID, out err);
                if (err != null)
                {
                    MessageBox.Show("解挂失败,请重试!", "系统提示", 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.Information);
                    this.ClearText();
                    txtCardID.ReadOnly  = false;
                    sbtnRelease.Enabled = false;
                }
            }
        }
Beispiel #16
0
        private void sbtnFill_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连接!");
                this.ClearText();
                txtCardID.ReadOnly       = true;
                this.txtFillFee.ReadOnly = true;
                this.sbtnFill.Enabled    = false;
                this.sbtnRead.Enabled    = true;
                this.chkIsBank.Checked   = false;
                return;
            }

            string strCardID = txtCardID.Text.Trim();

            if (strCardID == "")
            {
                MessageBox.Show("会员卡号不可为空且小于10位,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                txtCardID.Focus();
                return;
            }
            if (txtFillFee.Text.Trim() == "")
            {
                MessageBox.Show("充值金额不可为空,请重新输入!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            double dFee = Double.Parse(txtFillFee.Text.Trim());

            if (dFee <= 0)
            {
                MessageBox.Show("充值金额应大于0,请重新输入!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                System.Windows.Forms.DialogResult diaRes = MessageBox.Show("是否确定充值" + dFee.ToString() + "元?", "请确认", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
                if (diaRes.Equals(System.Windows.Forms.DialogResult.Yes))
                {
                    err = null;
                    double dFeeLast = double.Parse(txtCharge.Text.Trim());
                    int    iIgLast  = int.Parse(this.txtIg.Text.Trim());
                    CMSMStruct.FillFeeStruct ffs = new CMSMData.CMSMStruct.FillFeeStruct();
                    ffs.strAssID  = txtAssID.Text.Trim();
                    ffs.strCardID = strCardID;
                    ffs.dFillFee  = dFee;
                    string strAssType = this.txtAssType.Text.Trim();
                    string promrate   = "0";
                    promrate = this.GetPromrate(ffs.dFillFee).ToString();

                    int cc = (int)decimal.Parse(txtFillFee.Text.Trim());
                    int dd = ((int)decimal.Parse(txtFillFee.Text.Trim()) * (int.Parse(promrate)) / 100);
                    ffs.dFillProm = ((int)decimal.Parse(txtFillFee.Text.Trim()) * (int.Parse(promrate)) / 100);
                    ffs.dFeeLast  = dFeeLast;
                    ffs.dFeeCur   = System.Math.Round((dFee + dFeeLast), 2) + System.Math.Round((ffs.dFillProm), 0);
                    double bb = System.Math.Round((ffs.dFillProm), 0);
                    double aa = ffs.dFeeCur;
                    ffs.strDeptID = SysInitial.CurOps.strDeptID;
                    DateTime dtNow = DateTime.Now;
                    ffs.strFillDate = dtNow.ToShortDateString() + " " + dtNow.ToLongTimeString();
                    ffs.iSerial     = Int64.Parse(dtNow.ToString("yyyyMMddHHmmss"));
                    //ffs.iSerial = Int64.Parse(ffs.strFillDate.Substring(0, 4) + ffs.strFillDate.Substring(5, 2) + ffs.strFillDate.Substring(8, 2) + ffs.strFillDate.Substring(11, 2) + ffs.strFillDate.Substring(14, 2) + ffs.strFillDate.Substring(17, 2));
                    if (chkIsBank.Checked)
                    {
                        ffs.strComments = "银行卡";
                    }
                    else
                    {
                        ffs.strComments = "";
                    }

                    double dChargeBak = System.Math.Round((Double.Parse(txtCharge.Text.Trim()) + Double.Parse(txtFillFee.Text.Trim()) + Double.Parse(txtPromFee.Text.Trim())), 2);
                    if (ffs.dFeeCur != dChargeBak)
                    {
                        MessageBox.Show("充值失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        clog.WriteLine("充值备份值与计算值不等:备份值-" + dChargeBak.ToString() + " 计算值" + ffs.dFeeCur.ToString());
                        return;
                    }

                    string strresult = cs.FillFee(ffs, int.Parse(this.txtIg.Text.Trim()), dChargeBak, this.txtZeroFlag.Text.Trim(), out err);
                    if (strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK) || strresult.Substring(0, 3) == "CMT")
                    {
                        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.FillFeePrint(ffs, cs, this.txtAssName.Text);
                            this.OpenDrawer();
                        }

                        //zhh 20100311
                        clog.WriteLine(strresult);
                    }
                    else
                    {
                        MessageBox.Show("充值失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        lblerr.Text    = "充值失败,本次充值无效,请检查余额是否正确!";
                        lblerr.Visible = true;
                        clog.WriteLine(err);
                        clog.WriteLine(strresult);
                    }
                    this.ClearText();
                    txtCardID.ReadOnly       = true;
                    this.txtFillFee.ReadOnly = true;
                    this.sbtnFill.Enabled    = false;
                    this.sbtnRead.Enabled    = true;
                    this.chkIsBank.Checked   = false;
                }
            }
        }
Beispiel #17
0
        private void sbtnFill_Click(object sender, System.EventArgs e)
        {
            promrate = double.Parse(SysInitial.dsSys.Tables["FP6"].Rows[0]["vcCommCode"].ToString());
            if (promrate == 0)
            {
                promrate = 100;
            }
            string strCardID   = txtCardID.Text.Trim();
            string strCharge   = txtCharge.Text.Trim();
            string strAssID    = txtAssID.Text.Trim();
            int    iIG         = int.Parse(txtIG.Text.Trim());
            string strOperDate = System.DateTime.Now.ToShortDateString() + " " + System.DateTime.Now.ToLongTimeString();

            if (strCardID == "")
            {
                MessageBox.Show("会员卡号不可为空且小于10位,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                txtCardID.Focus();
                return;
            }
            if (strCardID != "")
            {
                System.Windows.Forms.DialogResult diaRes = MessageBox.Show("是否确定回收,卡号为:" + strCardID + ",回收金额为: " + strCharge + " 元", "请确认", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
                if (diaRes.Equals(System.Windows.Forms.DialogResult.Yes))
                {
                    string strresult = cs.CardRollback(strCardID, strCharge, strAssID, strOperDate, promrate, iIG, out err);
                    if (strresult != "")
                    {
                        if (strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK) || strresult.Substring(0, 3) == "000")
                        {
                            MessageBox.Show("回收会员卡成功!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                            this.txtCardID.Text    = "";
                            this.txtCharge.Text    = "";
                            this.txtAssName.Text   = "";
                            this.txtLinkPhone.Text = "";
                            this.sbtnFill.Enabled  = false;
                            this.sbtnRead.Enabled  = true;
                            clog.WriteLine(strresult);
                        }
                        else
                        {
                            MessageBox.Show("回收会员卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                            lblerr.Text            = "回收会员卡失败,本次回收无效,请检查余额是否正确!";
                            this.txtCardID.Text    = "";
                            this.txtCharge.Text    = "";
                            this.txtAssName.Text   = "";
                            this.txtLinkPhone.Text = "";
                            lblerr.Visible         = true;
                            clog.WriteLine(err);
                            clog.WriteLine(strresult);
                        }
                    }
                    else
                    {
                        MessageBox.Show("回收会员卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        lblerr.Text            = "回收会员卡失败,本次回收无效,请检查余额是否正确!";
                        this.txtCardID.Text    = "";
                        this.txtCharge.Text    = "";
                        this.txtAssName.Text   = "";
                        this.txtLinkPhone.Text = "";
                        lblerr.Visible         = true;
                        sbtnFill.Enabled       = false;
                        sbtnRead.Enabled       = true;
                        clog.WriteLine(err);
                        clog.WriteLine(strresult);
                    }
                }
            }
            else
            {
                MessageBox.Show("回收会员卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                lblerr.Text    = "回收会员卡失败,本次回收无效,请检查余额是否正确!";
                lblerr.Visible = true;
                clog.WriteLine(err);
            }
        }
Beispiel #18
0
        private void sbtnFill_Click(object sender, System.EventArgs e)
        {
            string strCardID = txtCardID.Text.Trim();

            if (strCardID == "")
            {
                MessageBox.Show("会员卡号不可为空且小于10位,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                txtCardID.Focus();
                return;
            }
            if (txtFillFee.Text.Trim() == "")
            {
                MessageBox.Show("充值金额不可为空,请重新输入!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            double dFee = Double.Parse(txtFillFee.Text.Trim());

            if (dFee <= 0)
            {
                MessageBox.Show("充值金额应大于0,请重新输入!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                System.Windows.Forms.DialogResult diaRes = MessageBox.Show("是否确定充值" + dFee.ToString() + "元?", "请确认", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
                if (diaRes.Equals(System.Windows.Forms.DialogResult.Yes))
                {
                    err = null;
                    double dFeeLast = Double.Parse(txtCharge.Text.Trim());
                    CMSMStruct.FillFeeStruct ffs = new CMSMData.CMSMStruct.FillFeeStruct();
                    ffs.strAssID  = txtAssID.Text.Trim();
                    ffs.strCardID = strCardID;
                    ffs.dFillFee  = dFee;
                    string promrate = "0";
                    ffs.dFillProm = (double.Parse(txtFillFee.Text.Trim()) * (double.Parse(promrate)) / 100);
                    ffs.dFeeLast  = dFeeLast;
                    ffs.dFeeCur   = System.Math.Round((dFee + ffs.dFillProm + dFeeLast), 2);
                    ffs.strDeptID = SysInitial.CurOps.strDeptID;
                    DateTime dtNow = DateTime.Now;
                    ffs.iSerial     = Int64.Parse(dtNow.ToString("yyyyMMddHHmmss"));
                    ffs.strFillDate = dtNow.ToShortDateString() + " " + dtNow.ToLongTimeString();
                    double dChargeBak = Double.Parse(txtCharge.Text.Trim()) + Double.Parse(txtFillFee.Text.Trim()) + Double.Parse(txtPromFee.Text.Trim());
                    if (ffs.dFeeCur != dChargeBak)
                    {
                        MessageBox.Show("充值失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        clog.WriteLine("充值备份值与计算值不等:备份值-" + dChargeBak.ToString() + " 计算值" + ffs.dFeeCur.ToString());
                        return;
                    }

                    string strresult = cs.FillFeeError(ffs, chs.iCurIg, dChargeBak, out err);
                    if (strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK) || strresult.Substring(0, 3) == "CMT")
                    {
                        MessageBox.Show("充值成功!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                        clog.WriteLine(strresult);
                    }
                    else
                    {
                        MessageBox.Show("充值失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        lblerr.Text    = "充值失败,本次充值无效,请检查余额是否正确!";
                        lblerr.Visible = true;
                        clog.WriteLine(err);
                        clog.WriteLine(strresult);
                    }
                    this.ClearText();
                    txtCardID.ReadOnly    = true;
                    this.sbtnFill.Enabled = false;
                    this.sbtnRead.Enabled = true;
                }
            }
        }
Beispiel #19
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();
            }
        }
Beispiel #20
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;
            }
            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();
            }
        }