Esempio n. 1
0
        private void btnCardCancel_Click(object sender, EventArgs e)
        {
            try
            {
                string scope = this.txtScope.Text.Trim();
                string str   = Van.KICC.Cancel(Van.JobKind.CancelCard,
                                               Van.CashKind.None,
                                               this.txtTid.Text.Trim(),
                                               this.txtCardNo.Text.Trim(),
                                               scope,
                                               txtAmtSplit.Text.Trim(),
                                               txtAmt.Text.Trim(),
                                               this.txtOrgRegNo.Text.Trim(),
                                               this.txtOrgRegDate.Text.Trim());
                SendData(str);

                Van.RecivedData reqdata = new RecivedData();
                reqdata = _ReqData;

                if (reqdata.IsAgreeError)
                {
                    MessageBox.Show(reqdata.Message);
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// ํ˜„๊ธˆ์—ฐ์ˆ˜์ฆ ์ž๋™ ์Šน์ธ์ทจ์†Œ
        /// </summary>
        private void fnCashBillAutoCacel(bool cashbillyn
                                         , CashKind cashbillkind
                                         , string regno
                                         , string amt
                                         , string orgagreeno
                                         )
        {
            try
            {
                if (cashbillyn)
                {
                    //ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ๊ฑด์ด๋ผ๋ฉด
                    //ํ˜„๊ธˆ์˜์ˆ˜์ฆ์„ ์ทจ์†Œํ•œ๋‹ค.
                    /***********************************************************************************************************************************************/
                    Van.RecivedData CashCancelreq = new RecivedData();
                    using (BizVanComunication bizVan = new BizVanComunication())
                    {
                        CashCancelreq = bizVan.SendData("PROJECT_D",
                                                        JobKind.CancelCash,
                                                        cashbillkind,
                                                        regno,
                                                        "",
                                                        "",
                                                        amt,
                                                        "",
                                                        "",
                                                        "",
                                                        "", CashGbn.None);
                        bizVan.Dispose();
                    }

                    /***********************************************************************************************************************************************/
                    if (CashCancelreq.IsAgreeError)
                    {
                        //cashAgreeNo
                        Basic.ShowMessage(1, "ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ ํ›„ DB ์ €์žฅ์‹œ ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค.\n\r" +
                                          "ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ ์ทจ์†Œ์‹œ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๋กœ ์ทจ์†Œํ•˜์ง€ ๋ชปํ•˜์˜€์Šต๋‹ˆ๋‹ค.\n\r\n\r" +
                                          "์—๋Ÿฌ๋‚ด์šฉ:\n\r" +
                                          CashCancelreq.Message + "\n\r\n\r" +
                                          "์ „์‚ฐ์‹ค์— ๋ฌธ์˜ํ•˜์—ฌ ์ˆ˜๊ธฐ ์ทจ์†Œ๋ฐ”๋ž๋‹ˆ๋‹ค. \n\r\n\r" +
                                          "์Šน์ธ๋ฒˆํ˜ธ : " + orgagreeno);

                        Van.Log.Log.SaveLog("[ํ˜„๊ธˆ์˜์ˆ˜์ฆ์Šน์ธํ›„ - DB ์ €์žฅ์‹œ์—๋Ÿฌ - ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ์ทจ์†Œ์‹œ -์—๋Ÿฌ ] - ์Šน์ธ๋ฒˆํ˜ธ : " + orgagreeno);
                    }
                }

                return;
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Esempio n. 3
0
 public override BotNode Process(RecivedData recivedData)
 {
     if (recivedData.Message == Texts.Ago)
     {
         return(this.AgoNode);
     }
     else
     {
         this._text = "Please Select correct item";
     }
     return(this);
 }
 public override BotNode Process(RecivedData recivedData)
 {
     if (recivedData.Message == Texts.Ago)
     {
         return(new StartNode(String.Empty));
     }
     else
     {
         this.StartMessageText = "Please Select correct item";
     }
     return(this);
 }
 public override BotNode Process(RecivedData recivedData)
 {
     if (recivedData.Message == Texts.SelectNumber)
     {
         return(new NodeSelectNumber());
     }
     if (recivedData.Message == Texts.About)
     {
         return(new NodeAbout());
     }
     else
     {
         this.StartMessageText = "Please Select correct item";
     }
     return(this);
 }
        public override BotNode Process(RecivedData recivedData)
        {
            int tmp;

            if (int.TryParse(recivedData.Message, out tmp))
            {
                return(new NodeShowNumberSelected(tmp, this));
            }
            else if (recivedData.Message == Texts.Ago)
            {
                return(new StartNode(string.Empty));
            }
            else
            {
                this.StartMessageText = "Please Select correct item";
            }
            return(this);
        }
Esempio n. 7
0
        private void btnCardReg_Click(object sender, EventArgs e)
        {
            Van.RecivedData reqdata = new RecivedData();
            try
            {
                string scope = this.txtScope.Text.Trim();
                string str   = Van.KICC.Reg(Van.JobKind.RegCard,
                                            Van.CashKind.None,
                                            this.txtTid.Text.Trim(),
                                            this.txtCardNo.Text.Trim(),
                                            scope,
                                            txtAmtSplit.Text.Trim(),
                                            txtAmt.Text.Trim());

                if (chkSign.Checked)
                {
                    //*********************************************************************************
                    //์‹ธ์ธ์„ ๋ฐ›๋Š”๋‹ค.
                    if (this.pictureEdit1.Image != null)
                    {
                        pictureEdit1.Image.Dispose();
                        pictureEdit1.Image = null;
                    }



                    ReqClear();
                    Van.frmVanLoading fCash = new frmVanLoading("๊ณ ๊ฐ์‹ธ์ธ์š”์ฒญ",
                                                                VanType.KICC,
                                                                frmVanLoading.JobKind.Sign,
                                                                "GetRequest");

                    fCash.Amount         = 10000;
                    fCash.SignPadReqdata = str;
                    fCash.SignPort       = int.Parse(this.txtSignPadPort.Text.Trim());
                    fCash.SignSpeed      = 57600;
                    fCash.Owner          = this;
                    fCash.VanServerIP    = this.txtKiccIP.Text.Trim();
                    fCash.VanServerPort  = int.Parse(this.txtKiccPort.Text.Trim());
                    fCash.ShowDialog();


                    Application.DoEvents();

                    if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.PortError).ToString())
                    {
                        MessageBox.Show("์‹ธ์ธํŒจ๋“œ ์—ฐ๊ฒฐ์‹คํŒจ ์ž…๋‹ˆ๋‹ค.");
                        return;
                    }
                    else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.NotImage).ToString())
                    {
                        MessageBox.Show("์‹ธ์ธ์ด๋ฏธ์ง€๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
                        return;
                    }
                    else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.TimeOut).ToString())
                    {
                        MessageBox.Show("์ œํ•œ์‹œ๊ฐ„ ์ดˆ๊ณผ ์ž…๋‹ˆ๋‹ค.");
                        return;
                    }
                    else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.Communication).ToString())
                    {
                        MessageBox.Show("์‹ธ์ธํŒจ๋“œ์™€ ํ†ต์‹ ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.");
                        return;
                    }
                    else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.NotData).ToString())
                    {
                        MessageBox.Show("๋ฐ์ดํ„ฐ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค..");
                        return;
                    }
                    //*********************************************************************************

                    if (this.pictureEdit1.Image != null)
                    {
                        this.pictureEdit1.Image.Dispose();
                        this.pictureEdit1.Image = null;
                    }

                    Image imgs = mImage.ByteArrayToImage(_ReqData.SignData);

                    this.pictureEdit1.Image = mImage.ByteArrayToImage(_ReqData.SignData);

                    Van.SignViewer f = new SignViewer(imgs);
                    f.ShowDialog();
                }



                if (!_ReqData.IsSignPadAgree)
                {
                    SendData(str);
                }



                reqdata = _ReqData;

                if (reqdata.IsAgreeError)
                {
                    MessageBox.Show(reqdata.Message);
                    return;
                }


                if (_ReqData.IsSignPadAgree)
                {
                    if (this.gridSend.DataSource != null)
                    {
                        ((DataTable)this.gridSend.DataSource).Dispose();
                        this.gridSend.DataSource = null;
                    }

                    if (this.gridRecevie.DataSource != null)
                    {
                        ((DataTable)this.gridRecevie.DataSource).Dispose();
                        this.gridRecevie.DataSource = null;
                    }

                    this.gridSend.DataSource    = _ReqData.dsDoc.Tables[0].Copy();
                    this.gridRecevie.DataSource = _ReqData.dsDoc.Tables[1].Copy();

                    this.gridRecevie.Refresh();
                    this.gridSend.Refresh();


                    txtSendData.Text     = _ReqData.FullSendData;
                    txtReceviedData.Text = _ReqData.FullRequestData;
                }



                txtOrgRegNo.Text        = reqdata.AgreeNo;
                this.txtOrgRegDate.Text = reqdata.AgreeDate.Substring(0, 6);
                InvokeOnClick(btnCardCancel, new EventArgs());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        /// <summary>
        /// ํ˜„๊ธˆ๊ฒฐ์ œ์ฒ˜๋ฆฌ
        /// </summary>
        private void fnPay110_Reg()
        {
            try
            {
                bool IsAgreeCash = false;
                bool IsClose     = BizCommon.Gneral_D.IsRoomClose();
                if (PayInfo.useKind == UseKind.Room && IsClose)
                {
                    Basic.ShowMessage(1, "ํ˜„์žฌ ๋งˆ๊ฐ์ž‘์—…์ค‘์ž…๋‹ˆ๋‹ค. \n\r๋งˆ๊ฐ์ด ๋๋‚œํ›„ ์ž‘์—…์„ ๊ณ„์†ํ•˜์‹ญ์‹œ์š”");
                    return;
                }

                int amt = int.Parse(Basic.MaskReplace(txtCashAmt.Text.Trim()));
                if (amt <= 0)
                {
                    Basic.ShowMessage(1, "๊ฒฐ์ œ๊ธˆ์•ก์„ ์ž…๋ ฅํ•˜์—ฌ ์ฃผ์‹ญ์‹œ์š”.");
                    txtCashAmt.Focus();
                    return;
                }


                _Pay_UserCheck = "";
                //๋‹ด๋‹น์ž์ฒดํฌ๊ธฐ๋Šฅ //
                DAHAH05 f = new DAHAH05(Parm.CurrentUserInformation.roomTask.gsDFacility, "fn_Room_UserCheck");
                f.Owner = this;
                f.ShowDialog();

                if (_Pay_UserCheck == "")
                {
                    Basic.ShowMessage(1, "๋‹ด๋‹น์ž ํ™•์ธ์ด ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.");
                    return;
                }
                string empno = _Pay_UserCheck;



                if (Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo)).Trim() == "")
                {
                    Basic.ShowMessage(2, "Bill ๋ฒˆํ˜ธ๋ฅผ ์ƒ์„ฑ ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.\n\r\n\r๋™์ฝ”๋“œ:" + PayInfomation.RoomInfo.C_Facipart + "\r\n๊ฐ์‹ค๋ฒˆํ˜ธ:" + PayInfomation.RoomInfo.C_RoomNo);
                    return;
                }

                Van.RecivedData Cashreqdata = new RecivedData();
                //ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์„ ํƒ๋˜์—ˆ์„๋Œ€
                if (chkCashBillYn.Checked)
                {
                    /* if (lupCashBill_IdCode.EditValue.ToString() == "0")
                     * {
                     *   DataRow[] dr = Parm.mDataTable.dtZx010ms.Select("HEAD = 'Z0028' AND DETAIL = '0' AND USE_YN = 'Y' ");
                     *
                     *   if (dr.Length >= 0) txtCashBillRegNo.Text = dr[0]["ITEM1"].ToString();
                     * }
                     *
                     * if(lupCashBill_IdCode.EditValue.ToString() == "")
                     * {
                     *   //ํ˜„๊ธˆ์˜์ˆ˜์ฆ
                     *   Basic.ShowMessage(1, "ํ˜„๊ธˆ์˜์ˆ˜์ฆ ๊ตฌ๋ถ„์„ ์„ ํƒํ•˜์—ฌ ์ฃผ์‹ญ์‹œ์š”");
                     *   lupCashBill_IdCode.Focus();
                     *   return;
                     * }
                     * else if(!chkCashSignPad.Checked && txtCashBillRegNo.Text.Trim().Length < 7)
                     * {
                     *   //ํ˜„๊ธˆ์˜์ˆ˜์ฆ
                     *   Basic.ShowMessage(1, "์‹๋ณ„๋ฒˆํ˜ธ๋ฅผ ์ •ํ™•ํ•˜๊ฒŒ ์ž…๋ ฅํ•˜์—ฌ ์ฃผ์‹ญ์‹œ์š”");
                     *   txtCashBillRegNo.Focus();
                     *   return;
                     * }
                     */
                    Van.RecivedData reqdata = new RecivedData();
                    //์‹๋ณ„๋ฒˆํ˜ธ๋ฅผ ์‹ธ์ธํŒจ๋“œ๋กœ ๋ฐ›๋Š”๋‹ค๋ฉด
                    if (chkCashSignPad.Checked)
                    {
                        using (BizVanComunication regNumber = new BizVanComunication())
                        {
                            reqdata = regNumber.GetCashRegNumber("PROJECT_D",
                                                                 int.Parse(Basic.MaskReplace(txtCashAmt.Text.Trim()))
                                                                 );
                            regNumber.Dispose();
                        }
                        txtCashBillRegNo.Text = reqdata.CashRegNumber;
                    }

                    /* if(txtCashBillRegNo.Text.Trim().Length < 7)
                     * {
                     *   //ํ˜„๊ธˆ์˜์ˆ˜์ฆ
                     *   Basic.ShowMessage(1, "์‹๋ณ„๋ฒˆํ˜ธ๋ฅผ ์ •ํ™•ํ•˜๊ฒŒ ์ž…๋ ฅํ•˜์—ฌ ์ฃผ์‹ญ์‹œ์š”");
                     *   txtCashBillRegNo.Focus();
                     *   return;
                     * }
                     */
                    //ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ์š”์ฒญ
                    /***********************************************************************************************************************************************/
                    // if(BizCommon.CheckVan.CheckMode() == DialogResult.No) return;

                    using (BizVanComunication bizVan = new BizVanComunication())
                    {
                        Cashreqdata = bizVan.SendData("PROJECT_D",
                                                      JobKind.RegCash,
                                                      optCashBillKind.SelectedIndex < 1 ? Van.CashKind.Persnal :Van.CashKind.Company,
                                                      txtCashBillRegNo.Text.Trim(),
                                                      "",
                                                      "",
                                                      Basic.MaskReplace(txtCashAmt.Text.Trim()),
                                                      "",
                                                      "",
                                                      "",
                                                      "",
                                                      lupCashBill_IdCode.EditValue.ToString() == "1" ? CashGbn.Card : CashGbn.None);
                        bizVan.Dispose();
                    }

                    /***********************************************************************************************************************************************/

                    if (Cashreqdata.IsAgreeError)
                    {
                        Basic.ShowMessage(1, Cashreqdata.Message);
                        return;
                    }

                    //์Šน์ธ์—ฌ๋ถ€
                    //DB ์ž‘์—… ์‹คํŒจ์‹œ ์‚ญ์ œํ•˜๊ธฐ์œ„ํ•ด์„œ
                    IsAgreeCash = true;
                }
                else
                {
                    if (cAutoReg.Checked)
                    {
                        DataRow[] dr        = Parm.mDataTable.dtZx010ms.Select("HEAD = 'Z0028' AND DETAIL = '0' AND USE_YN = 'Y' ");
                        Int32     _intInput = 0;
                        Int32     _intZ0028 = 0;
                        try
                        {
                            _intInput = Convert.ToInt32(txtCashAmt.Text.Replace(",", ""));
                        }
                        catch (Exception ex)
                        {
                            _intInput = -1;
                        }

                        try
                        {
                            _intZ0028 = Convert.ToInt32(dr[0]["ITEM2"].ToString());
                        }
                        catch (Exception)
                        {
                            _intZ0028 = 0;
                        }

                        if (_intInput >= _intZ0028)
                        {
                            using (BizVanComunication bizVan = new BizVanComunication())
                            {
                                Cashreqdata = bizVan.SendData("PROJECT_D",
                                                              JobKind.RegCash,
                                                              optCashBillKind.SelectedIndex < 1 ? Van.CashKind.Persnal : Van.CashKind.Company,
                                                              dr[0]["ITEM1"].ToString(),
                                                              "",
                                                              "",
                                                              Basic.MaskReplace(txtCashAmt.Text.Trim()),
                                                              "",
                                                              "",
                                                              "",
                                                              "", CashGbn.None);
                                bizVan.Dispose();
                            }

                            /***********************************************************************************************************************************************/

                            if (Cashreqdata.IsAgreeError)
                            {
                                Basic.ShowMessage(1, Cashreqdata.Message);
                                return;
                            }

                            //์Šน์ธ์—ฌ๋ถ€
                            //DB ์ž‘์—… ์‹คํŒจ์‹œ ์‚ญ์ œํ•˜๊ธฐ์œ„ํ•ด์„œ
                            IsAgreeCash = true;
                        }
                    }
                }

                string cashAgreeNo = Cashreqdata.AgreeNo;
                this.Cursor = Cursors.WaitCursor;
                //ํ˜„๊ธˆ๊ฒฐ์ œ ๋ฃจํ‹ด์„ ํƒœ์šด๋‹ค.

                string v_ret = fn_110(amt.ToString(), IsAgreeCash, BizCommon.Parm_Pay.PAY_CODE_CASH, cashAgreeNo, empno, PayInfomation.RoomInfo.C_Reference);
                this.Cursor = Cursors.Default;
                if (v_ret != "OK")
                {
                    Basic.ShowMessage(1, v_ret);

                    if (IsAgreeCash)
                    {
                        //ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ๊ฑด์ด๋ผ๋ฉด
                        //ํ˜„๊ธˆ์˜์ˆ˜์ฆ์„ ์ทจ์†Œํ•œ๋‹ค.
                        /***********************************************************************************************************************************************/

                        Van.RecivedData CashCancelreq = new RecivedData();
                        using (BizVanComunication bizVan = new BizVanComunication())
                        {
                            CashCancelreq = bizVan.SendData("PROJECT_D",
                                                            JobKind.CancelCash,
                                                            optCashBillKind.SelectedIndex < 1 ? Van.CashKind.Persnal :Van.CashKind.Company,
                                                            txtCashBillRegNo.Text.Trim(),
                                                            "",
                                                            "",
                                                            Basic.MaskReplace(txtCashAmt.Text.Trim()),
                                                            "",
                                                            "",
                                                            "",
                                                            "",
                                                            lupCashBill_IdCode.EditValue.ToString() == "1" ? CashGbn.Card : CashGbn.None);
                            bizVan.Dispose();
                        }

                        /***********************************************************************************************************************************************/

                        if (CashCancelreq.IsAgreeError)
                        {
                            //cashAgreeNo
                            Basic.ShowMessage(1, "ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ ํ›„ DB ์ €์žฅ์‹œ ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค.\n\r" +
                                              "ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ ์ทจ์†Œ์‹œ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๋กœ ์ทจ์†Œํ•˜์ง€ ๋ชปํ•˜์˜€์Šต๋‹ˆ๋‹ค.\n\r\n\r" +
                                              "์—๋Ÿฌ๋‚ด์šฉ:\n\r" +
                                              CashCancelreq.Message + "\n\r\n\r" +
                                              "์ „์‚ฐ์‹ค์— ๋ฌธ์˜ํ•˜์—ฌ ์ˆ˜๊ธฐ ์ทจ์†Œ๋ฐ”๋ž๋‹ˆ๋‹ค. \n\r\n\r" +
                                              "์Šน์ธ๋ฒˆํ˜ธ : " + cashAgreeNo);

                            Van.Log.Log.SaveLog("[ํ˜„๊ธˆ์˜์ˆ˜์ฆ์Šน์ธํ›„ - DB ์ €์žฅ์‹œ์—๋Ÿฌ - ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ์ทจ์†Œ์‹œ -์—๋Ÿฌ ] - ์Šน์ธ๋ฒˆํ˜ธ : " + cashAgreeNo);
                        }
                    }
                    return;
                }

                txtCashAmt.Text       = "0";
                txtCashBillRegNo.Text = "";
                Basic.ShowMessage(1, "์ €์žฅ ํ•˜์˜€์Šต๋‹ˆ๋‹ค.");
                RaiseDataReflashEvent(true);
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        private void fn_120(DataRow r, string emp, string memo)
        {
            try
            {
                #region DataRow ์ •๋ณด

                /*
                 *  dt.Columns.Add("FACILITY_CODE"     );
                 *  dt.Columns.Add("MNG_NO"            );
                 *  dt.Columns.Add("MNG_SEQ"           ,typeof(decimal));
                 *  dt.Columns.Add("TASK_DATE"         );
                 *  dt.Columns.Add("KEY_SEQ"           ,typeof(decimal));
                 *  dt.Columns.Add("RAISE_CODE"        );
                 *  dt.Columns.Add("RAISE_CODE_NAME");
                 *  dt.Columns.Add("PAY_CODE"          );
                 *  dt.Columns.Add("PAY_CODE_NAME");
                 *  dt.Columns.Add("PAY_AMT"           ,typeof(decimal));
                 *  dt.Columns.Add("RMRK"              );
                 *  dt.Columns.Add("REFERENCE"         );
                 *  dt.Columns.Add("SEQ_NO"            ,typeof(decimal));
                 *  dt.Columns.Add("TRACK_TWO"         );
                 *  dt.Columns.Add("CARD_NO"           );
                 *  dt.Columns.Add("VALID_THRU"        );
                 *  dt.Columns.Add("AGREE_NO"          );
                 *  dt.Columns.Add("AGREE_DATE"        );
                 *  dt.Columns.Add("INSTALLMENT_CNT"   ,typeof(decimal));
                 *  dt.Columns.Add("EASY_YN"           );
                 *
                 *  dt.Columns.Add("CO_FACILITY_CODE"  );
                 *  dt.Columns.Add("CO_MNG_NO"         );
                 *  dt.Columns.Add("CO_MNG_SEQ"        ,typeof(decimal));
                 *  dt.Columns.Add("CO_TASK_DATE"      );
                 *  dt.Columns.Add("CO_KEY_SEQ"        ,typeof(decimal));
                 */
                #endregion

                //๊ฐ์‹ค์ผ๋•Œ ๋งˆ๊ฐ์—ฌ๋ถ€ ํ™•์ธ
                bool IsClose = BizCommon.Gneral_D.IsRoomClose();
                if (info.useKind == DAZAZ02.UseKind.Room && IsClose)
                {
                    Basic.ShowMessage(1, "ํ˜„์žฌ ๋งˆ๊ฐ์ž‘์—…์ค‘์ž…๋‹ˆ๋‹ค. \n\r๋งˆ๊ฐ์ด ๋๋‚œํ›„ ์ž‘์—…์„ ๊ณ„์†ํ•˜์‹ญ์‹œ์š”");
                    return;
                }


                //์นด๋“œ์ •๋ณด๋ฅผ ์ฝ์–ด์˜จ๋‹ค.
                DataTable dtParm1 = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtParm1.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtParm1.Rows.Add(new object[] { "V_AGREE_NO", r["AGREE_NO"].ToString().Trim() });
                DataSet dsCardinfo = DataLayer.ExecuteSpDataset("PKG_DAZAZ02.PR_CARD_INFO", dtParm1, DataLayer.MessageEncoding.Default);

                if (dsCardinfo.Tables[0].Rows.Count <= 0)
                {
                    Basic.ShowMessage(1, "์นด๋“œ์ •๋ณด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
                    return;
                }

                /**********************************************************************************************/
                //์ทจ์†Œ์Šน์ธ
                /**********************************************************************************************/
                // if(BizCommon.CheckVan.CheckMode() == DialogResult.No) return;



                string str             = "";
                string strcancelcardno = "";

                if (dsCardinfo.Tables[0].Rows[0]["TRACK_TWO"].ToString().Trim() == "")
                {
                    strcancelcardno = dsCardinfo.Tables[0].Rows[0]["CARD_NO"].ToString().Trim();
                }
                else
                {
                    strcancelcardno = dsCardinfo.Tables[0].Rows[0]["TRACK_TWO"].ToString().Trim();
                }


                if (strcancelcardno == "")
                {
                    Basic.ShowMessage(1, "์นด๋“œ์ •๋ณด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
                    return;
                }


                Van.RecivedData reqdata = new RecivedData();

                using (BizVanComunication bizAgree = new BizVanComunication())
                {
                    reqdata = bizAgree.SendData("PROJECT_D",
                                                JobKind.CancelCard,
                                                CashKind.None,
                                                strcancelcardno,
                                                dsCardinfo.Tables[0].Rows[0]["VALID_THRU"].ToString().Trim(),
                                                dsCardinfo.Tables[0].Rows[0]["INSTALLMENT_CNT"].ToString().Trim(),
                                                dsCardinfo.Tables[0].Rows[0]["SALE_AMT"].ToString().Trim(),
                                                "",
                                                "",
                                                dsCardinfo.Tables[0].Rows[0]["AGREE_NO"].ToString().Trim(),
                                                DateTime.Parse(uDate.GetDateFromYYYY_MM_DD(dsCardinfo.Tables[0].Rows[0]["AGREE_DATE"].ToString().Trim())).ToString("yyyyMMdd"),
                                                CashGbn.None);
                    bizAgree.Dispose();
                }


                if (reqdata.IsAgreeError)
                {
                    Basic.ShowMessage(3, "์นด๋“œ ์Šน์ธ์„ ์ทจ์†Œํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.  - \n\r" + reqdata.Message);
                    return;
                }

                this.Cursor = Cursors.WaitCursor;

                try{
                    //์Šน์ธ ์ดํ›„ ์—๋Ÿฌ๊ฑด์— ๋Œ€ํ•œ ๋ฉ”์„ธ์ง€ ์ฒ˜๋ฆฌ๋ฅผ ๋ฌด์กฐ๊ฑดํ•œ๋‹ค.

                    string AgreeDates = reqdata.AgreeDate.Substring(0, 4) + "-" +
                                        reqdata.AgreeDate.Substring(4, 2) + "-" +
                                        reqdata.AgreeDate.Substring(6, 2);

                    AgreeDates = DateTime.Parse(AgreeDates).ToString("yyyyMMdd");

                    string saledate      = Parm.CurrentUserInformation.roomTask.gsTaskDate;
                    string bizcode       = Parm.CurrentUserInformation.BizInfo.BizCode;
                    string facilitycode  = r["FACILITY_CODE"].ToString().Trim();
                    string billno        = Basic.MaskReplace(Num.GetNumberOnly(Faci)) + Basic.MaskReplace(Num.GetNumberOnly(RoomNo));
                    string saleyn        = "Y";
                    string payseq        = "์ผ๋ จ๋ฒˆํ˜ธํ˜„๊ธˆ์˜ seqno ์—๋„Ž๋Š”๋‹ค";
                    string agreeyn       = "N";
                    string saleamt       = (int.Parse(r["PAY_AMT"].ToString().Trim()) * -1).ToString().Trim();
                    string cardno        = r["CARD_NO"].ToString().Trim();
                    string validthru     = r["VALID_THRU"].ToString().Trim();
                    string installentcnt = r["INSTALLMENT_CNT"].ToString().Trim();
                    string agreeno       = reqdata.AgreeNo;
                    string orgagreeno    = r["AGREE_NO"].ToString().Trim();
                    string card_co_code  = reqdata.CardCoCode;
                    string card_co_name  = reqdata.CardCoName;
                    string issu_co_code  = reqdata.ISSUCoCode;
                    string issu_co_name  = reqdata.ISSUCoName;
                    string card_join_no  = reqdata.CardJoinNo;
                    string agreedate     = AgreeDates;
                    //string agreetime     = reqdata.AgreeDate.Substring(6,4);
                    string agreetime = reqdata.AgreeDate.Length > 6 ? reqdata.AgreeDate.Substring(6, 4) : DateTime.Now.ToString("hhmm");
                    string track_Two = dsCardinfo.Tables[0].Rows[0]["TRACK_TWO"].ToString().Trim();
                    string easyyn    = "N";
                    string tid       = Parm.CurrentUserInformation.roomTask.gsCardTerminalID;
                    string empno     = Parm.CurrentUserInformation.id;
                    string ip        = Parm.CurrentUserInformation.ip;


                    //์ฑ„๋ฒˆํ•œ๋‹ค.
                    DataTable dtParm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtParm.Rows.Add(new object[] { "V_SALE_DATE", saledate });
                    dtParm.Rows.Add(new object[] { "V_BIZ_CODE", bizcode });
                    dtParm.Rows.Add(new object[] { "V_FACILITY_CODE", facilitycode });
                    dtParm.Rows.Add(new object[] { "V_POS_NO", "01" });
                    dtParm.Rows.Add(new object[] { "V_BILL_NO", billno });
                    dtParm.Rows.Add(new object[] { "V_SALE_YN", saleyn });

                    payseq = DataLayer.ExecuteSpScala("PKG_DAZAZ02.PR_IAA030MS_KEY_SEQ", dtParm, DataLayer.MessageEncoding.Default);


                    //์ผ๋‹จ ๋„˜๊ธธํ…Œ์ด๋ธ”์— ๋‹ด๋Š”๋‹ค.
                    DataTable dtCard = Pay.CreditCard(saledate,
                                                      bizcode,
                                                      facilitycode,
                                                      billno,
                                                      saleyn,
                                                      payseq,
                                                      agreeyn,
                                                      saleamt,
                                                      cardno,
                                                      validthru,
                                                      installentcnt,
                                                      agreeno,
                                                      orgagreeno,
                                                      card_co_code,
                                                      card_co_name,
                                                      issu_co_code,
                                                      issu_co_name,
                                                      card_join_no,
                                                      agreedate,
                                                      agreetime,
                                                      track_Two,
                                                      easyyn,
                                                      tid,
                                                      empno,
                                                      ip);

                    //์นด๋“œ์ •๋ณด๋Š” ๋‹ด์•˜๋‹ค
                    //ํ˜„๊ธˆ์ •๋ณด๋ฅผ ๋™๋ฐ˜ํ•ด์•ผ๋˜๊ธฐ๋•Œ๋ฌธ์— ํ˜„๊ธˆ์ •๋ณด๋ฅผ ๋‹ด๋Š”๋‹ค.


                    string mngno     = r["MNG_NO"].ToString().Trim();                             //๊ด€๋ฆฌ๋ฒˆํ˜ธ
                    string mngseq    = r["MNG_SEQ"].ToString().Trim();                            //๊ด€๋ฆฌ์ˆœ๋ฒˆ
                    string taskdate  = Appdate;                                                   //์ž‘์—…์ผ์ž
                    string keyseq    = "์ผ๋ จ๋ฒˆํ˜ธ";                                                    //์ผ๋ จ๋ฒˆํ˜ธ
                    string rasiecode = r["RAISE_CODE"].ToString().Trim();                         //๋ฐœ์ƒ์ฝ”๋“œ
                    string paycode   = r["PAY_CODE"].ToString().Trim();                           //๊ฒฐ์ œ์ฝ”๋“œ
                    string payamt    = r["PAY_AMT"].ToString().Trim();                            //๊ฒฐ์ œ๊ธˆ์•ก
                    string itemstat  = "D";                                                       //์ƒํƒœ
                    string facipart  = Faci;                                                      //๋™์ฝ”๋“œ
                    string reference = reqdata.AgreeNo;                                           //์ฐธ๊ณ (์นด๋“œ๋ฒˆํ˜ธ,์Šน์ธ๋ฒˆํ˜ธ/๋ฝ์นด๋ฒˆํ˜ธ/์—ฐํšŒ๋ฒˆํ˜ธ/์ƒํ’ˆ๊ถŒ๋ฒˆํ˜ธ/ํšŒ์›๋ฒˆํ˜ธ)
                    string seqno     = payseq;                                                    //์ˆœ๋ฒˆ
                    string rmrk      = "[์Šน์ธ๋ฒˆํ˜ธ:" + reqdata.AgreeNo + "] ์‚ฌ์œ :" + memo;               //๋น„๊ณ 

                    string co_facilitycode = "";                                                  //์ด์ฒด์˜์—…์žฅ์ฝ”๋“œ
                    string co_mngcode      = "";                                                  //์ด์ฒด๊ด€๋ฆฌ๋ฒˆํ˜ธ
                    string co_mngseq       = "";                                                  //์ด์ฒด๊ด€๋ฆฌ์ˆœ๋ฒˆ
                    string co_taskdate     = "";                                                  //์ด์ฒด์˜์—…์ผ์ž
                    string co_keyseq       = "";                                                  //์ด์ฒด์ผ๋ จ๋ฒˆํ˜ธ

                    string st_facilitycode = facilitycode;                                        //์ตœ์ดˆ์˜์—…์žฅ์ฝ”๋“œ
                    string st_mngno        = mngno;                                               //์ตœ์ดˆ๊ด€๋ฆฌ๋ฒˆํ˜ธ
                    string st_mngseq       = mngseq;                                              //์ตœ์ดˆ๊ด€๋ฆฌ์ˆœ๋ฒˆ
                    string st_taskdate     = Basic.MaskReplace(r["TASK_DATE"].ToString().Trim()); //์ตœ์ดˆ์˜์—…์ผ์ž
                    string st_keyseq       = r["KEY_SEQ"].ToString().Trim();                      //์ตœ์ดˆ์ผ๋ จ๋ฒˆํ˜ธ
                    string editstatus      = "3";                                                 //์ž‘์—…๊ตฌ๋ถ„


                    //seqno ์ˆœ๋ฒˆ์„ ๊ฐ€์ ธ์™€์„œ ํ• ๋‹นํ•œ๋‹ค.
                    //์ž…๊ธˆํ…Œ์ด๋ธ” [DCA030MS]
                    // ์‚ฌ์—…์žฅ์ฝ”๋“œ // ์˜์—…์žฅ์ฝ”๋“œ //๊ด€๋ฆฌ๋ฒˆํ˜ธ //๊ด€๋ฆฌ์ˆœ๋ฒˆ// ์˜์—…์ผ์ž // == ์ผ๋ จ๋ฒˆํ˜ธ//
                    // ์ˆœ๋ฒˆ์„ ๊ฐ€์ ธ์˜จ๋‹ค
                    //PR_KEY_SEQ
                    DataTable dtParm3 = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                    dtParm3.Rows.Add(new object[] { "V_BIZ_CODE", bizcode });
                    dtParm3.Rows.Add(new object[] { "V_FACILITY_CODE", facilitycode });
                    dtParm3.Rows.Add(new object[] { "V_MNG_NO", mngno });
                    dtParm3.Rows.Add(new object[] { "V_MNG_SEQ", mngseq });
                    dtParm3.Rows.Add(new object[] { "V_TASK_DATE", taskdate });

                    keyseq = DataLayer.ExecuteSpScala("PKG_DAZAZ02.PR_DCA030MS_KEY_SEQ", dtParm3, DataLayer.MessageEncoding.Default);


                    DataTable dtcash = Pay.Room_110(bizcode,
                                                    facilitycode,
                                                    mngno,
                                                    mngseq,
                                                    taskdate,
                                                    keyseq,
                                                    rasiecode,
                                                    paycode,
                                                    payamt,
                                                    itemstat,
                                                    facipart, reference,
                                                    seqno,
                                                    rmrk,
                                                    co_facilitycode,
                                                    co_mngcode,
                                                    co_mngseq,
                                                    co_taskdate,
                                                    co_keyseq,
                                                    st_facilitycode,
                                                    st_mngno,
                                                    st_mngseq,
                                                    st_taskdate,
                                                    st_keyseq,
                                                    empno,
                                                    ip,
                                                    editstatus);

                    DataSet dsTmp = DataLayer.AddProdedcure(new DataTable[] { dtcash, dtCard });

                    string v_ret = DataLayer.ExecuteSpScalaTransaction(dsTmp, "OK", DataLayer.MessageEncoding.Default);

                    if (v_ret != "OK")
                    {
                        Basic.ShowMessage(1, v_ret);
                        Basic.ShowMessage(1, "[์ „์‹ ์‹ค์— ๋ฌธ์˜ํ•˜์„ธ์š”] \n\r์นด๋“œ ์Šน์ธ์€ ์ทจ์†Œ ๋˜์—ˆ์œผ๋‚˜ ์ž๋ฃŒ๊ฐฑ์‹ ์‹œ ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค.\n\tr" +
                                          "์ทจ์†Œ ์Šน์ธ๋ฒˆํ˜ธ : " + reqdata.AgreeNo + "\n\r" +
                                          "\n\r์—๋Ÿฌ๋‚ด์šฉ : " + v_ret);
                        Van.Log.Log.SaveLog("์นด๋“œ ์Šน์ธ ์ทจ์†Œ ํ›„ - DB ๊ฐฑ์‹ ์—๋Ÿฌ - ์ทจ์†Œ์Šน์ธ๋ฒˆํ˜ธ : " + reqdata.AgreeNo + " / mngno:" + r["MNG_NO"].ToString().Trim() + " / mngseq:" + r["MNG_SEQ"].ToString().Trim() + "  ERR:" + v_ret);
                    }

                    //์˜์ˆ˜์ฆ์ถœ๋ ฅ
                    bill_Print_Card(taskdate, bizcode, facilitycode, billno, keyseq, mngno, mngseq);
                }
                catch (Exception ex)
                {
                    Basic.ShowMessage(1, "[์ „์‹ ์‹ค์— ๋ฌธ์˜ํ•˜์„ธ์š”] \n\r์นด๋“œ ์Šน์ธ์€ ์ทจ์†Œ ๋˜์—ˆ์œผ๋‚˜ ์ž๋ฃŒ๊ฐฑ์‹ ์‹œ ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค.\n\tr" +
                                      "์ทจ์†Œ ์Šน์ธ๋ฒˆํ˜ธ : " + reqdata.AgreeNo + "\n\r" +
                                      "\n\r์—๋Ÿฌ๋‚ด์šฉ : " + ex.Message);
                    Van.Log.Log.SaveLog("์นด๋“œ ์Šน์ธ ์ทจ์†Œ ํ›„ - DB ๊ฐฑ์‹ ์—๋Ÿฌ - ์ทจ์†Œ์Šน์ธ๋ฒˆํ˜ธ : " + reqdata.AgreeNo + " / mngno:" + r["MNG_NO"].ToString().Trim() + " / mngseq:" + r["MNG_SEQ"].ToString().Trim() + "  ERR:" + ex.Message);
                }


                fnSelect();

                Basic.ShowMessage(1, "์ทจ์†Œ ํ•˜์˜€์Šต๋‹ˆ๋‹ค.");
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Esempio n. 10
0
        /// <summary>
        /// ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ
        /// </summary>
        private bool fnCashBill(bool cashbillyn
                                , bool cashsignpadyn
                                , string amt
                                , CashKind cashbillkind
                                , string cashbillregno
                                , ref string refcashbillregno
                                , ref string refIdNoCode
                                , ref Van.RecivedData cashreqdata
                                )
        {
            try
            {
                bool IsClose = BizCommon.Gneral_D.IsRoomClose();

                refIdNoCode = "";


                //ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์„ ํƒ๋˜์—ˆ์„๋Œ€
                if (cashbillyn)
                {
                    Van.RecivedData reqdata = new RecivedData();
                    refcashbillregno = cashbillregno;

                    //์‹๋ณ„๋ฒˆํ˜ธ๋ฅผ ์‹ธ์ธํŒจ๋“œ๋กœ ๋ฐ›๋Š”๋‹ค๋ฉด
                    if (cashsignpadyn)
                    {
                        using (BizVanComunication regNumber = new BizVanComunication())
                        {
                            reqdata = regNumber.GetCashRegNumber("PROJECT_D",
                                                                 int.Parse(Basic.MaskReplace(amt))
                                                                 );
                            regNumber.Dispose();
                        }
                        refcashbillregno = reqdata.CashRegNumber;
                    }

                    if (cashbillregno.Length < 7)
                    {
                        //ํ˜„๊ธˆ์˜์ˆ˜์ฆ
                        Basic.ShowMessage(1, "์‹๋ณ„๋ฒˆํ˜ธ๋ฅผ ์ •ํ™•ํ•˜๊ฒŒ ์ž…๋ ฅํ•˜์—ฌ ์ฃผ์‹ญ์‹œ์š”");
                        return(false);
                    }

                    //ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ์š”์ฒญ
                    /***********************************************************************************************************************************************/

                    using (BizVanComunication bizVan = new BizVanComunication())
                    {
                        cashreqdata = bizVan.SendData("PROJECT_D",
                                                      JobKind.RegCash,
                                                      cashbillkind,
                                                      refcashbillregno.Trim(),
                                                      "",
                                                      "",
                                                      Basic.MaskReplace(amt),
                                                      "",
                                                      "",
                                                      "",
                                                      "", lupCashBill_IdCode.EditValue.ToString() == "1" ? CashGbn.Card : CashGbn.None);
                        bizVan.Dispose();
                    }

                    /***********************************************************************************************************************************************/

                    if (cashreqdata.IsAgreeError)
                    {
                        Basic.ShowMessage(1, cashreqdata.Message);
                        return(false);
                    }

                    //์Šน์ธ์—ฌ๋ถ€
                    //DB ์ž‘์—… ์‹คํŒจ์‹œ ์‚ญ์ œํ•˜๊ธฐ์œ„ํ•ด์„œ
                    //IsAgreeCash = true;
                }
                //์ž์ง„ ๋ฐœ๊ธ‰
                else
                {
                    DataRow[] dr        = Parm.mDataTable.dtZx010ms.Select("HEAD = 'Z0028' AND DETAIL = '0' AND USE_YN = 'Y' ");
                    int       _intInput = 0;
                    int       _intZ0028 = 0;

                    refcashbillregno = dr[0]["ITEM1"].ToString();
                    _intInput        = int.Parse(amt.Replace(",", ""));

                    refIdNoCode = dr[0]["DETAIL"].ToString();

                    try
                    {
                        _intZ0028 = int.Parse(dr[0]["ITEM2"].ToString());
                    }
                    catch (Exception)
                    {
                        _intZ0028 = 0;
                    }

                    if (_intInput >= _intZ0028)
                    {
                        using (BizVanComunication bizVan = new BizVanComunication())
                        {
                            cashreqdata = bizVan.SendData("PROJECT_D",
                                                          JobKind.RegCash,
                                                          cashbillkind,
                                                          dr[0]["ITEM1"].ToString(),
                                                          "",
                                                          "",
                                                          Basic.MaskReplace(amt.Trim()),
                                                          "",
                                                          "",
                                                          "",
                                                          "", CashGbn.None);
                            bizVan.Dispose();
                        }


                        if (cashreqdata.IsAgreeError)
                        {
                            Basic.ShowMessage(1, cashreqdata.Message);
                            return(false);
                        }

                        //์Šน์ธ์—ฌ๋ถ€
                        //DB ์ž‘์—… ์‹คํŒจ์‹œ ์‚ญ์ œํ•˜๊ธฐ์œ„ํ•ด์„œ
                        //IsAgreeCash = true;
                    }
                }

                //cashAgreeNo = Cashreqdata.AgreeNo;
                //cashAgreeDate = Cashreqdata.AgreeDate;
                this.Cursor = Cursors.WaitCursor;
                this.Cursor = Cursors.Default;
                return(true);
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
                return(false);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Esempio n. 11
0
        private void fnCashBillReg(bool cashbillyn)
        {
            try
            {
                Van.RecivedData CashReqData = new RecivedData();

                string CashBillRegNo = "";
                string IdNoCode      = "";

                if (!fnCashBill(cashbillyn
                                , chkCashSignPad.Checked
                                , Basic.MaskReplace(dtSelect.Rows[0]["RSV_AMT"].ToString())
                                , optCashBillKind.SelectedIndex < 1 ? Van.CashKind.Persnal : Van.CashKind.Company
                                , txtCashBillRegNo.Text.Trim()
                                , ref CashBillRegNo
                                , ref IdNoCode
                                , ref CashReqData
                                )
                    )
                {
                    return;  // ํ˜„๊ธˆ์˜์ˆ˜์ฆ ์Šน์ธ
                }
                string   tmp        = CashReqData.AgreeDate.Substring(0, 6);
                DateTime dt         = DateTime.ParseExact(tmp, "yyMMdd", null);
                string   _agreedate = dt.ToString("yyyyMMdd");

                DataTable dtparmInsert = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmInsert.Rows.Add(new object[] { "V_RSV_NO", P_RSV_NO });
                dtparmInsert.Rows.Add(new object[] { "V_MNG_NO", P_MNG_NO });
                dtparmInsert.Rows.Add(new object[] { "V_SALE_DATE", Parm.CurrentUserInformation.roomTask.gsTaskDate });
                dtparmInsert.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtparmInsert.Rows.Add(new object[] { "V_SALE_AMT", Basic.MaskReplace(txtAmt.Text.Trim()) });
                dtparmInsert.Rows.Add(new object[] { "V_PE_CO_CODE", optCashBillKind.SelectedIndex < 1 ? "P" : "C" });
                dtparmInsert.Rows.Add(new object[] { "V_ID_NO_CODE", IdNoCode.Length < 1 ? lupCashBill_IdCode.EditValue.ToString() : IdNoCode });
                dtparmInsert.Rows.Add(new object[] { "V_ID_NO", CashBillRegNo });
                dtparmInsert.Rows.Add(new object[] { "V_AGREE_NO", CashReqData.AgreeNo });
                dtparmInsert.Rows.Add(new object[] { "V_AGREE_DATE", _agreedate });
                dtparmInsert.Rows.Add(new object[] { "V_EASY_YN", chkCashSignPad.Checked?"Y":"N" });
                dtparmInsert.Rows.Add(new object[] { "V_U_EMP_NO", Parm.CurrentUserInformation.id });
                dtparmInsert.Rows.Add(new object[] { "V_U_IP", Parm.CurrentUserInformation.ip });

                string Result = DataLayer.ExecuteSpScala("PKG_DAHAH25.PR_10", dtparmInsert, DataLayer.MessageEncoding.Default);

                if (Result != "OK")
                {
                    fnCashBillAutoCacel(cashbillyn
                                        , optCashBillKind.SelectedIndex < 1 ? Van.CashKind.Persnal : Van.CashKind.Company
                                        , CashBillRegNo
                                        , Basic.MaskReplace(txtAmt.Text.Trim())
                                        , CashReqData.AgreeNo
                                        );
                    return;
                }

                P_REG_YN = true; // ์Šน์ธ์™„๋ฃŒ

                if (cashbillyn)
                {
                    fnBill_Cash("Y"
                                , P_GUEST_NAME
                                , CashReqData.Amt
                                , CashBillRegNo
                                , DateTime.Now.ToString("yyyy-MM-dd")
                                , CashReqData.AgreeNo
                                );
                }

                this.Close();
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
        }
Esempio n. 12
0
        /// <summary>
        /// ์‹ ์šฉ์นด๋“œ ์Šน์ธ
        /// </summary>
        private void fnPay120_Reg()
        {
            try
            {
                int amt = int.Parse(Basic.MaskReplace(txtCreditAmt.Text.Trim()));


                /*if(this.txtCreditCardNo.Text.Trim().Length < 13)
                 * {
                 *
                 *  Basic.ShowMessage(1, "์นด๋“œ๋ฒˆํ˜ธ๋ฅผ ์ •ํ™•ํ•˜๊ฒŒ ์ž…๋ ฅํ•˜์—ฌ ์ฃผ์‹ญ์‹œ์š”.");
                 *  txtCreditCardNo.Focus();
                 *  return;
                 * }
                 * else */if (amt <= 0)
                {
                    Basic.ShowMessage(1, "๊ฒฐ์ œ๊ธˆ์•ก์„ ์ž…๋ ฅํ•˜์—ฌ ์ฃผ์‹ญ์‹œ์š”.");
                    txtCreditAmt.Focus();
                    return;
                }
                else if (Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo)).Trim() == "")
                {
                    Basic.ShowMessage(2, "Bill ๋ฒˆํ˜ธ๋ฅผ ์ƒ์„ฑ ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.\n\r\n\r๋™์ฝ”๋“œ:" + PayInfomation.RoomInfo.C_Facipart + "\r\n๊ฐ์‹ค๋ฒˆํ˜ธ:" + PayInfomation.RoomInfo.C_RoomNo);
                    return;
                }


                //๊ฐ์‹ค์ด ๋งˆ๊ฐ๋˜์—ˆ๋Š”์ง€ ์ฒดํฌํ•œ๋‹ค.
                bool IsClose = BizCommon.Gneral_D.IsRoomClose();
                if (PayInfo.useKind == UseKind.Room && IsClose)
                {
                    Basic.ShowMessage(1, "ํ˜„์žฌ ๋งˆ๊ฐ์ž‘์—…์ค‘์ž…๋‹ˆ๋‹ค. \n\r๋งˆ๊ฐ์ด ๋๋‚œํ›„ ์ž‘์—…์„ ๊ณ„์†ํ•˜์‹ญ์‹œ์š”");
                    return;
                }


                string SendCardNo = "";
                _TrackTowInfo = "";

                /* if(txtCreditCardNo.Text.Trim().IndexOf("=") < 0)
                 * {
                 *
                 *   SendCardNo = txtCreditCardNo.Text.Trim();
                 *
                 *   if(  this.txtCreditCardScope.Text.Trim() == "" &&
                 *           this.txtCreditCardNo.Text.Trim().IndexOf("=") < 0  )
                 *       {
                 *           Basic.ShowMessage(1, "ํ‚ค์ธ ์ž…๋ ฅ์ž…๋‹ˆ๋‹ค - ์œ ํšจ๊ธฐ๊ฐ„์„ ์ž…๋ ฅํ•˜์„ธ์š”.");
                 *           txtCreditCardScope.Focus();
                 *           return;
                 *       }
                 *
                 * }
                 * else
                 * {
                 *   if (txtCreditCardNo.Text.ToUpper().StartsWith("C"))
                 *       txtCreditCardNo.Text = txtCreditCardNo.Text.Remove(0, 1);
                 *   _TrackTowInfo = txtCreditCardNo.Text.Trim();
                 *   SendCardNo = txtCreditCardNo.Text.Trim();
                 *
                 *   string str1 = this.txtCreditCardNo.Text.Trim().Split('=')[0];
                 *   string str2 = this.txtCreditCardNo.Text.Trim().Split('=')[1];
                 *
                 *   this.txtCreditCardNo.Text = str1;
                 *
                 *   if(str2.Trim().Length < 4)
                 *   {
                 *       Basic.ShowMessage(1, "MSR ์ž…๋ ฅ - ์นด๋“œ๋ฒˆํ˜ธ๊ฐ€ ์ž˜๋ชป๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
                 *       return;
                 *   }
                 *   string strscope = str2.Trim().Substring(0,4);
                 *   this.txtCreditCardScope.EditValue   = strscope ;
                 *
                 * }
                 */
                //์œ ํšจ๊ธฐ๊ฐ„
                string scope = Basic.MaskReplace(txtCreditCardScope.Text.Trim());

                if (scope.Length < 4)
                {
                    scope = "9999";
                }



                #region ์„œ๋ช…๋ชจ๋“œ
                /******************************************************************************/
                // ์‹ธ์ธํŒจ๋“œ๊ฐ€ ์ฒดํฌ ๋˜์–ด ์žˆ๋‹ค๋ฉด ์„œ๋ช…๋ชจ๋“œ ์‹œ์ž‘
                /******************************************************************************/

                byte[] b = null;
                string SignDataString = "";

                /*
                 * Van.RecivedData rvcSign = new RecivedData();
                 * bool  IsSucess = true;
                 * if(this.chkCreditSignPad.Checked)
                 * {
                 *  using(BizVanComunication bizVan = new BizVanComunication())
                 *  {
                 *
                 *      string reqdatas = bizVan.GetVanMakeCardProtocol( "PROJECT_D" ,
                 *                                                        JobKind.RegCard,
                 *                                                        CashKind.None,
                 *                                                        SendCardNo ,
                 *                                                        scope,
                 *                                                        Basic.MaskReplace(txtCreditAmtSplit.Text.Trim()),
                 *                                                        Basic.MaskReplace(txtCreditAmt.Text.Trim()) ,
                 *                                                        "1" ,
                 *                                                        "","","", CashGbn.None );
                 *
                 *
                 *      IsSucess =  bizVan.GetSign( "PROJECT_D",
                 *                                  int.Parse(Basic.MaskReplace(txtCreditAmt.Text.Trim())) ,
                 *                                  ref rvcSign,
                 *                                  reqdatas);
                 *      bizVan.Dispose();
                 *  }
                 *
                 * }
                 * if(!IsSucess) return;
                 */
                /******************************************************************************/
                // ์„œ๋ช…๋ชจ๋“œ ์ข…๋ฃŒ
                /******************************************************************************/
                #endregion

                /*
                 * SignDataString = rvcSign.SignStringData;
                 * b = rvcSign.SignData;
                 */
                //์นด๋“œ์Šน์ธ์ฒ˜๋ฆฌ ์‹œ์ž‘
                /***********************************************************************************************************************************************/

                Van.RecivedData reqdata = new RecivedData();

                /*
                 * if(rvcSign.IsSignPadAgree)
                 * {
                 *  reqdata = rvcSign;
                 *  if(reqdata.IsAgreeError)
                 *  {
                 *      MessageBox.Show(reqdata.Message);
                 *      return;
                 *  }
                 * }
                 * else
                 *
                 */
                {
                    using (BizVanComunication bizAgree = new BizVanComunication())
                    {
                        reqdata = bizAgree.SendData("PROJECT_D",
                                                    JobKind.RegCard,
                                                    CashKind.None,
                                                    SendCardNo,
                                                    scope,
                                                    Basic.MaskReplace(txtCreditAmtSplit.Text.Trim()),
                                                    Basic.MaskReplace(txtCreditAmt.Text.Trim()),
                                                    "1",
                                                    SignDataString, "", "", CashGbn.None);


                        bizAgree.Dispose();
                    }

                    /***********************************************************************************************************************************************/

                    if (reqdata.IsAgreeError)
                    {
                        MessageBox.Show(reqdata.Message);
                        return;
                    }
                }

                this.Cursor = Cursors.WaitCursor;
                // ์Šน์ธ์ด ๋‚ฌ๋‹ค.
                //DB์ฒ˜๋ฆฌ
                string AgreeDate = reqdata.AgreeDate.Substring(0, 4) + "-" +
                                   reqdata.AgreeDate.Substring(4, 2) + "-" +
                                   reqdata.AgreeDate.Substring(6, 2);

                AgreeDate = DateTime.Parse(AgreeDate).ToString("yyyyMMdd");

                string outSeq = "";

                string v_ret = fn_Card(Basic.MaskReplace(txtCreditAmt.Text.Trim()),
                                       //     txtCreditCardNo.Text.Trim(),
                                       Basic.MaskReplace(reqdata.CashRegNumber),
                                       Basic.MaskReplace(scope),
                                       reqdata.CardCoCode,
                                       reqdata.CardCoName,
                                       reqdata.ISSUCoCode,
                                       reqdata.ISSUCoName,
                                       reqdata.CardJoinNo,
                                       reqdata.AgreeNo,
                                       this.txtCreditAmtSplit.Text.Trim() == "" ? "0" : this.txtCreditAmtSplit.Text.Trim(),
                                       AgreeDate,
                                       reqdata.AgreeDate.Length > 6 ? reqdata.AgreeDate.Substring(6, 4) : DateTime.Now.ToString("hhmm"),
                                       _TrackTowInfo,
                                       "N",
                                       Parm.CurrentUserInformation.roomTask.gsCardTerminalID,
                                       Parm.CurrentUserInformation.id,
                                       ref outSeq);

                //DB ์ฒ˜๋ฆฌ์—๋Ÿฌ์‹œ ์ทจ์†Œ์Šน์ธ์„
                //๋”ด๋‹ค.
                if (v_ret != "OK")
                {
                    Van.RecivedData reqdataCancel = new RecivedData();

                    using (BizVanComunication bizAgree = new BizVanComunication())
                    {
                        reqdataCancel = bizAgree.SendData("PROJECT_D",
                                                          JobKind.CancelCard,
                                                          CashKind.None,
                                                          _TrackTowInfo,
                                                          scope,
                                                          Basic.MaskReplace(txtCreditAmtSplit.Text.Trim()),
                                                          Basic.MaskReplace(txtCreditAmt.Text.Trim()),
                                                          "",
                                                          "",
                                                          reqdata.AgreeNo,
                                                          reqdata.AgreeDate.Substring(0, 6),
                                                          CashGbn.None);

                        bizAgree.Dispose();
                    }


                    /***********************************************************************************************************************************************/


                    if (reqdataCancel.IsAgreeError)
                    {
                        Basic.ShowMessage(3, "์Šน์ธ ํ›„ DB ์ €์žฅ์‹œ ์—๋Ÿฌ ์ž…๋‹ˆ๋‹ค." + System.Environment.NewLine +
                                          "์Šน์ธ๋ฒˆํ˜ธ๋Š” : " + reqdata.AgreeNo + " ์ž…๋‹ˆ๋‹ค." + System.Environment.NewLine +
                                          "ํ˜„์žฌ ๋‚ด์šฉ์„ CTL + C ๋กœ ๋ณต์‚ฌํ•˜์—ฌ ๋ฉ”๋ชจ์žฅ์— ๋ถ™์—ฌ ๋„ฃ์œผ์„ธ์š” - ๋ถ™์—ฌ๋„ฃ์œผ์‹  ๋‚ด์šฉ์œผ๋กœ ์ „์‚ฐ์‹ค์— ๋ฌธ์˜ํ•˜์„ธ์š”" + System.Environment.NewLine +
                                          "์ „์‚ฐ์‹ค์— ๋ฌธ์˜ํ•˜์—ฌ ์ˆ˜๊ธฐ๋กœ ์Šน์ธ ์ทจ์†Œ๋ฅผ ํ•˜์‹ญ์‹œ์š”" + System.Environment.NewLine + System.Environment.NewLine +
                                          "์Šน์ธ์ทจ์†Œ ์—๋Ÿฌ ๋‚ด์šฉ" + System.Environment.NewLine +
                                          reqdata.Message + System.Environment.NewLine + System.Environment.NewLine +
                                          "DB ์ฒ˜๋ฆฌ ์—๋Ÿฌ๋‚ด์šฉ :" + System.Environment.NewLine +
                                          v_ret);

                        Van.Log.Log.SaveLog("[์Šน์ธํ›„ DB ์ €์žฅ์—๋Ÿฌ - ์Šน์ธ์ทจ์†Œ์‹คํŒจ] ์—๋Ÿฌ๋‚ด์šฉ -  " + reqdataCancel.Message);
                        Van.Log.Log.SaveLog("[์Šน์ธํ›„ DB ์ €์žฅ์—๋Ÿฌ - ์Šน์ธ์ทจ์†Œ์‹คํŒจ] ์ทจ์†Œ์ „๋ฌธ - $" + reqdataCancel.FullSendData + "$");
                        return;
                    }

                    Basic.ShowMessage(2, v_ret);
                    return;
                }

                //๋ฉ”์ธ๋ฐ์ดํ„ฐ๊ฐ€ ๋“ค์–ด๊ฐ”๋‹ค๋ฉด ์‹ธ์ธ๋ฐ์ดํ„ฐ๋„ ๋„ฃ์–ด์ค€๋‹ค.
                //์‹ธ์ธ๋ฐ์ดํ„ฐ๊ฐ€ ์žˆ๋‹ค๋ฉด

                if (b != null)
                {
                    string Query = @"INSERT INTO IAA030DT(
                                                         SALE_DATE     , 
                                                         BIZ_CODE      , 
                                                         FACILITY_CODE , 
                                                         POS_NO        , 
                                                         BILL_NO       , 
                                                         SALE_YN       , 
                                                         PAY_SEQ       , 
                                                         SIGN_IMG      , 
                                                         U_EMP_NO      , 
                                                         U_IP         
                                                    ) VALUES (
                                                                   :V_SALE_DATE     , 
                                                                   :V_BIZ_CODE      , 
                                                                   :V_FACILITY_CODE , 
                                                                   :V_POS_NO        , 
                                                                   :V_BILL_NO       , 
                                                                   :V_SALE_YN       , 
                                                                   :V_PAY_SEQ       , 
                                                                   :V_SIGN_IMG      , 
                                                                   :V_U_EMP_NO      , 
                                                                   :V_U_IP         
                                                               )";

                    DataTable dtParm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtParm.Rows.Add(":V_SALE_DATE", PayInfomation.SaleDate);
                    dtParm.Rows.Add(":V_BIZ_CODE", PayInfomation.RoomInfo.C_Bizcode);
                    dtParm.Rows.Add(":V_FACILITY_CODE", PayInfomation.RoomInfo.C_Facilitycode);
                    dtParm.Rows.Add(":V_POS_NO", "01");
                    dtParm.Rows.Add(":V_BILL_NO", Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo)));
                    dtParm.Rows.Add(":V_SALE_YN", "Y");
                    dtParm.Rows.Add(":V_PAY_SEQ", outSeq);
                    dtParm.Rows.Add(":V_SIGN_IMG", "#");
                    dtParm.Rows.Add(":V_U_EMP_NO", Parm.CurrentUserInformation.id);
                    dtParm.Rows.Add(":V_U_IP", Parm.CurrentUserInformation.ip);


                    //bill_Print_Card();

                    try
                    {
                        int ret = DataLayer.ExecuteNonQuery(Query, dtParm, b, DataLayer.MessageEncoding.Default);
                    }
                    catch (Exception ex)
                    {
                        Basic.ShowMessage(2, "์นด๋“œ์Šน์ธ์€ ์ •์ƒ์Šน์ธ ์ฒ˜๋ฆฌ๋˜์—ˆ์œผ๋ฉฐ ์ž๋ฃŒ๋„ ์ •์ƒ์ €์žฅ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. \n\r์‹ธ์ธ ์ด๋ฏธ์ง€๋งŒ DB ์— ์ €์žฅํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค.\n\r" + ex.Message);
                    }

                    try
                    {
                        string _strBillNo = Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo));
                        bill_Print_Card(outSeq, _strBillNo);
                    }
                    catch (Exception ex)
                    {
                        Basic.ShowMessage(2, "์˜์ˆ˜์ฆ ์ถœ๋ ฅ์ค‘ ์—๋Ÿฌ!");
                    }
                }
                else     // ์‚ฌ์ธ๋ฐ์ดํ„ฐ๊ฐ€ ์—†์–ด๋„ ์˜์ˆ˜์ฆ ์ถœ๋ ฅ์€ ํ•ด์ค€๋‹ค๋กœ ๋ณ€๊ฒฝํ•จ. (2015.07.15 ์ •์ˆ˜ํ™˜)
                {
                    string _strBillNo = Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo));
                    bill_Print_Card(outSeq, _strBillNo);
                }

                Basic.ShowMessage(1, "์ €์žฅ ํ•˜์˜€์Šต๋‹ˆ๋‹ค.");


                txtCreditCardNo.Text    = "";
                txtCreditCardScope.Text = "";
                txtCreditAmtSplit.Text  = "0";
                txtCreditAmt.Text       = "0";
                _TrackTowInfo           = "";
                RaiseDataReflashEvent(true);
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }