/// <summary>
        /// 현금결제처리
        /// </summary>
        /// <param name="amt">금액</param>
        /// <param name="IsCheckBill">현금영수증<c>true</c> [is check bill].</param>
        /// <param name="paycodeInput">입금코드</param>
        /// <param name="agreeno">현금영수증승인번호</param>
        /// <param name="empNo">The emp no.</param>
        /// <returns></returns>
        /// <remarks>
        /// 현금결제인데도 불구하고 현금영수증 여부나 입금코드를 받는 이유는
        /// 객실 선수금일때 카드결제시에도 현금 로직을 태워야되기때문이다.
        /// </remarks>
        private string  fn_110(string amt, bool IsCheckBill, string paycodeInput, string agreeno, string empNo, string references)
        {
            string strReturn = "";
            /*-------------------------------------------------------------------------------------------------------*/
            // 현금영수증
            /*-------------------------------------------------------------------------------------------------------*/
            string bill_saledate     = "";      //영업일자
            string bill_bizcode      = "";      //사업장코드
            string bill_facilitycode = "";      //영업장코드
            string bill_posno        = "";      //포스번호
            string bill_biilno       = "";      //전표번호
            string bill_saleyn       = "";      //판매여부
            string bill_payseq       = "0";     //순번 // 현금영수증이 있으면 체번한 값을 없으면 Default 0 값이 들어간다.
            string bill_agreeyn      = "";      //승인번호
            string bill_saleamt      = "";      //판매금액
            string bill_pe_co_code   = "";      //법인개인구분
            string bill_id_no_code   = "";      //식별코드
            string bill_id_no        = "";      //식별번호
            string bill_agreeno      = "";      //승인번호
            string bill_keyinyn      = "";      //이지체여부
            string bill_date         = "";      //정의없음


            try
            {
                //현금영수증 체크
                if (IsCheckBill)
                {
                    if (Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo)).Trim() == "")
                    {
                        return("Bill 번호를 생성 할 수 없습니다.\n\r\n\r동코드:" + PayInfomation.RoomInfo.C_Facipart + "\r\n객실번호:" + PayInfomation.RoomInfo.C_RoomNo);
                    }



                    bill_saledate     = PayInfomation.RoomInfo.C_Taskdate;                                                                                                               //영업일자
                    bill_bizcode      = PayInfomation.RoomInfo.C_Bizcode;                                                                                                                //사업장코드
                    bill_facilitycode = PayInfomation.RoomInfo.C_Facilitycode;                                                                                                           //영업장코드
                    bill_posno        = "01";                                                                                                                                            //포스번호
                    bill_biilno       = Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo)); //전표번호
                    bill_saleyn       = "Y";                                                                                                                                             //판매여부
                    bill_payseq       = "일련번호-체번한다.";                                                                                                                                    //순번
                    bill_agreeyn      = "Y";                                                                                                                                             //승인여부
                    switch (TabControl.SelectedTabPage.Name)
                    {
                    case "tp_1":                                                          //현금
                        bill_saleamt    = Basic.MaskReplace(txtCashAmt.Text.Trim());      //판매금액
                        bill_pe_co_code = optCashBillKind.SelectedIndex < 1 ? "P" : "C";  //법인C 개인구분 P
                        bill_id_no_code = lupCashBill_IdCode.EditValue.ToString().Trim(); //식별코드
                        bill_id_no      = txtCashBillRegNo.Text.Trim();                   //식별번호
                        break;

                    case "tp_10":                                                             // 예금
                        bill_saleamt    = Basic.MaskReplace(txtBankAmt.Text.Trim());          //판매금액
                        bill_pe_co_code = optBankCashBillKind.SelectedIndex < 1 ? "P" : "C";  //법인C 개인구분 P
                        bill_id_no_code = lupBankCashBill_IdCode.EditValue.ToString().Trim(); //식별코드
                        bill_id_no      = txtBankCashBillRegNo.Text.Trim();                   //식별번호
                        break;
                    }

                    if (bill_id_no.Length <= 0)
                    {
                        DataRow[] dr = Parm.mDataTable.dtZx010ms.Select("HEAD = 'Z0028' AND DETAIL = '0' AND USE_YN = 'Y' ");
                        if (dr.Length > 0 && int.Parse(dr[0]["ITEM2"].ToString()) < int.Parse(bill_saleamt))
                        {
                            bill_id_no_code = "0";
                            bill_id_no      = dr[0]["ITEM1"].ToString();
                        }
                    }



                    bill_agreeno = agreeno;  //승인번호
                    bill_keyinyn = "N";      //이지체크를 통해 들어왔는지
                    bill_date    = "";       //정의없음

                    DataTable dtParmBill = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtParmBill.Rows.Add(new object[] { "V_BIZ_CODE", bill_bizcode });
                    dtParmBill.Rows.Add(new object[] { "V_FACILITY_CODE", bill_facilitycode });
                    dtParmBill.Rows.Add(new object[] { "V_POS_NO", bill_posno });
                    dtParmBill.Rows.Add(new object[] { "V_SALE_DATE", bill_saledate });
                    dtParmBill.Rows.Add(new object[] { "V_BILL_NO", bill_biilno });
                    dtParmBill.Rows.Add(new object[] { "V_SALE_YN", "Y" });

                    string billSeq = DataLayer.ExecuteSpScala("PKG_DAZAZ02.PR_IAA031MS_PAYSEQ", dtParmBill, DataLayer.MessageEncoding.Default);
                    bill_payseq = billSeq;
                }

                if (PayInfomation.useKind == UseKind.Room)
                {
                    /*-------------------------------------------------------------------------------------------------------*/
                    //  Room 일때
                    /*-------------------------------------------------------------------------------------------------------*/
                    string bizcode      = "";    //사업장코드
                    string facilitycode = "";    //영업장코드
                    string mngno        = "";    //관리번호
                    string mngseq       = "";    //관리순번
                    string taskdate     = "";    //작업일자
                    string keyseq       = "";    //일련번호
                    string rasiecode    = "";    //발생코드
                    string paycode      = "";    //결제코드
                    string payamt       = "";    //결제금액
                    string itemstat     = "";    //상태
                    string facipart     = "";    //동코드
                    string reference    = "";    //참고(카드번호,승인번호/락카번호/연회번호/상품권번호/회원번호)
                    string seqno        = "";    //순번
                    string rmrk         = "";    //비고

                    string co_facilitycode = ""; //이체영업장코드
                    string co_mngcode      = ""; //이체관리번호
                    string co_mngseq       = ""; //이체관리순번
                    string co_taskdate     = ""; //이체영업일자
                    string co_keyseq       = ""; //이체일련번호

                    string st_facilitycode = ""; //최초영업장코드
                    string st_mngno        = ""; //최초관리번호
                    string st_mngseq       = ""; //최초관리순번
                    string st_taskdate     = ""; //최초영업일자
                    string st_keyseq       = ""; //최초일련번호

                    //string empno           = ""; //사원번호
                    string ip         = "";      //아이피
                    string editstatus = "";      //작업구분


                    bizcode      = PayInfomation.RoomInfo.C_Bizcode;
                    facilitycode = PayInfomation.RoomInfo.C_Facilitycode;
                    mngno        = PayInfomation.RoomInfo.C_Mngno;
                    mngseq       = PayInfomation.RoomInfo.C_Mngseq;
                    taskdate     = PayInfomation.RoomInfo.C_Taskdate;
                    keyseq       = "일련번호";
                    rasiecode    = ((int)PayInfomation.RaseCode).ToString();
                    paycode      = paycodeInput;
                    payamt       = amt;
                    itemstat     = "N";
                    facipart     = PayInfomation.RoomInfo.C_Facipart;
                    reference    = references;
                    seqno        = bill_payseq;
                    rmrk         = agreeno;

                    co_facilitycode = PayInfomation.RoomInfo.CO_Facilitycode;
                    co_mngcode      = PayInfomation.RoomInfo.CO_Mngcode;
                    co_mngseq       = PayInfomation.RoomInfo.CO_Mngseq;
                    co_taskdate     = PayInfomation.RoomInfo.CO_Taskdate;
                    co_keyseq       = PayInfomation.RoomInfo.CO_Keyseq;

                    st_facilitycode = PayInfomation.RoomInfo.ST_Facilitycode;
                    st_mngno        = PayInfomation.RoomInfo.ST_Mngno;
                    st_mngseq       = PayInfomation.RoomInfo.ST_Mngseq;
                    st_taskdate     = PayInfomation.RoomInfo.ST_Taskdate;
                    st_keyseq       = PayInfomation.RoomInfo.ST_Keyseq;

                    //empno           = Parm.CurrentUserInformation.id;
                    ip         = Parm.CurrentUserInformation.ip;
                    editstatus = "2";



                    //seqno 순번을 가져와서 할당한다.
                    //입금테이블 [DCA030MS]
                    // 사업장코드 // 영업장코드 //관리번호 //관리순번// 영업일자 // == 일련번호//
                    // 순번을 가져온다
                    //PR_KEY_SEQ
                    DataTable dtParm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

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

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

                    // 선수금일때 최초영업장과 //이체영업장을 설정한다.
                    if (PayInfomation.RaseCode == RaseCodeInfo.Deposit)
                    {
                        co_keyseq = co_keyseq == "" ? keyseq : co_keyseq;
                        st_keyseq = st_keyseq == "" ? keyseq : st_keyseq;
                    }
                    else
                    {
                        co_keyseq = keyseq;
                        st_keyseq = keyseq;
                    }

                    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);

                    DataTable[] dtArry = null;
                    //현금영수증이 없다면 // 현금내역만 담고
                    //그렇지 않으면 현금영수증 내역까지 담아서 트랜잭션처리한다.
                    if (!IsCheckBill)
                    {
                        dtArry = new DataTable[] { dtcash };
                    }
                    else
                    {
                        DataTable dtcashBill = Pay.PayAddBill(bill_saledate,
                                                              bill_bizcode,
                                                              bill_facilitycode,
                                                              bill_posno,
                                                              bill_biilno,
                                                              bill_saleyn,
                                                              bill_payseq,
                                                              bill_agreeyn,
                                                              bill_saleamt,
                                                              bill_pe_co_code,
                                                              bill_id_no_code,
                                                              bill_id_no,
                                                              bill_agreeno,
                                                              bill_saledate,
                                                              bill_keyinyn,   // 이지체크여부에 N을 넘긴다.
                                                              empNo,
                                                              bill_date,
                                                              ip);

                        dtArry = new DataTable[] { dtcash, dtcashBill };
                    }

                    //Application.DoEvents();
                    DataSet dsTmp = DataLayer.AddProdedcure(dtArry);
                    string  v_ret = DataLayer.ExecuteSpScalaTransaction(dsTmp, "OK", DataLayer.MessageEncoding.Default);

                    strReturn = v_ret;
                }
            }
            catch (Exception ex)
            {
                strReturn = ex.Message;
            }

            return(strReturn);
        }
        /// <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;
            }
        }
示例#4
0
        /// <summary>
        /// [현금]  항목 삭제
        /// </summary>
        /// <param name="r">입금정보</param>
        /// <param name="emp">사번.</param>
        /// <param name="memo">사유.</param>
        private void fn_110(DataRow r, string emp, string memo, string seqnos)
        {
            string _BenRegNo = "";

            try
            {
                //객실일때 마감여부 확인
                bool IsClose = BizCommon.Gneral_D.IsRoomClose();
                if (info.useKind == DAZAZ02.UseKind.Room && IsClose)
                {
                    Basic.ShowMessage(1, "현재 마감작업중입니다. \n\r마감이 끝난후 작업을 계속하십시요");
                    return;
                }


                if (Faci == "" || RoomNo == "")
                {
                    Basic.ShowMessage(1, "동코드와 객실번호는 전표번호를 생성하는 기초데이터 입니다.");
                    return;
                }

                #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


                string bizcode      = Parm.CurrentUserInformation.BizInfo.BizCode;            //사업장코드
                string facilitycode = r["FACILITY_CODE"].ToString().Trim();                   //영업장코드
                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     = "";                                                     //상태
                string facipart     = Faci;                                                   //동코드
                string reference    = r["REFERENCE"].ToString().Trim();                       //참고(카드번호,승인번호/락카번호/연회번호/상품권번호/회원번호)
                string seqno        = seqnos;                                                 //순번
                string rmrk         = 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 empno      = emp;                                                      //사원번호
                string ip         = Parm.CurrentUserInformation.ip;                           //아이피
                string editstatus = "3";                                                      //작업구분

                /**********************************************
                 * 현금영수증 처리
                 **********************************************
                 * 1. 현금 연수증을 사용하지 않은처리
                 * 3. 현금영수증을 밴승인을 통한 처리
                 *********************************************/

                string bill_saledate     = "";   //영업일자
                string bill_bizcode      = "";   //사업장코드
                string bill_facilitycode = "";   //영업장코드
                string bill_posno        = "";   //포스번호
                string bill_biilno       = "";   //전표번호
                string bill_saleyn       = "";   //판매여부
                string bill_payseq       = "순번"; //순번
                string bill_agreeyn      = "";   //승인번호
                string bill_saleamt      = "";   //판매금액
                string bill_pe_co_code   = "";   //법인개인구분
                string bill_id_no_code   = "";   //식별코드
                string bill_id_no        = "";   //식별번호
                string bill_agreeno      = "";   //승인번호
                string bill_easyyn       = "";   //이지체크여부
                string bill_date         = "";   //정의없음
                string bill_agreedate    = "";   //원승인일자


                bool      IsBillYn = false;
                DataTable dtBill   = null;

                //승인번호가 있다면 // 현금영수증이 승인된 데이터 이다.
                if (r["AGREE_NO"].ToString().Trim() != "")
                {
                    //현금영수증이 있다고 마킹한다.
                    IsBillYn = true;


                    //아무튼. 현금영수증인 승인된건이기때문에
                    //현금영수증 테이블에 담는다.

                    /*
                     * 채번한다.
                     */
                    bill_saledate     = Appdate;                                                                                   //영업일자
                    bill_bizcode      = Parm.CurrentUserInformation.BizInfo.BizCode;                                               //사업장코드
                    bill_facilitycode = r["FACILITY_CODE"].ToString().Trim();                                                      //영업장코드
                    bill_posno        = "01";                                                                                      //포스번호
                    bill_biilno       = Basic.MaskReplace(Num.GetNumberOnly(Faci)) + Basic.MaskReplace(Num.GetNumberOnly(RoomNo)); //전표번호
                    bill_saleyn       = "Y";                                                                                       //판매여부
                    bill_payseq       = "순번";                                                                                      //순번
                    bill_agreeyn      = "N";                                                                                       //승인번호
                    bill_saleamt      = (int.Parse(r["PAY_AMT"].ToString().Trim()) * -1).ToString();                               //판매금액
                    bill_pe_co_code   = r["INSTALLMENT_CNT"].ToString().Trim();                                                    //법인개인구분
                    bill_id_no_code   = r["VALID_THRU"].ToString().Trim();                                                         //식별코드
                    bill_id_no        = r["REFERENCE"].ToString().Trim();                                                          //식별번호
                    bill_agreeno      = "";                                                                                        // _BenRegNo; //승인번호
                    bill_easyyn       = r["EASY_YN"].ToString().Trim();                                                            //키인여부
                    bill_date         = "";                                                                                        //정의없음

                    bill_agreeno   = r["AGREE_NO"].ToString().Trim();
                    bill_agreedate = r["AGREE_DATE"].ToString().Trim();


                    //밴을 이용한 승인취소건이다.
                    //승인을 취소한다.
                    //Ben통신을 한다.
                    /*☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★*/
                    _BenRegNo = "밴승인번호";
                    _BenRegNo = "";
                    //if(BizCommon.CheckVan.CheckMode() == DialogResult.No) return;
                    /***********************************************************************************************************************************************/
                    string str = "";



                    Van.RecivedData RegCashreq = new Van.RecivedData();
                    using (BizVanComunication bizVans = new BizVanComunication())
                    {
                        RegCashreq = bizVans.SendData("PROJECT_D",
                                                      JobKind.CancelCash,
                                                      bill_pe_co_code == "0" ? Van.CashKind.Persnal : Van.CashKind.Company,
                                                      bill_id_no,
                                                      "",
                                                      "",
                                                      payamt,
                                                      "",
                                                      "",
                                                      bill_agreeno,
                                                      //bill_agreedate.Substring(2, 6),
                                                      bill_agreedate,
                                                      bill_id_no_code == "1" ? CashGbn.Card : CashGbn.None);
                        bizVans.Dispose();
                    }

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

                    if (RegCashreq.IsAgreeError)
                    {
                        //if(

                        Basic.ShowMessage(1, "승인을 취소하지 못했습니다. \n\r\n\r" +
                                          "오류내용 : \n\r" +
                                          RegCashreq.Message);
                        return;
                    }

                    _BenRegNo    = RegCashreq.AgreeNo;
                    bill_agreeno = _BenRegNo;

                    this.Cursor = Cursors.WaitCursor;

                    DataTable dtParmBill = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtParmBill.Rows.Add(new object[] { "V_BIZ_CODE", bill_bizcode });
                    dtParmBill.Rows.Add(new object[] { "V_FACILITY_CODE", bill_facilitycode });
                    dtParmBill.Rows.Add(new object[] { "V_POS_NO", bill_posno });
                    dtParmBill.Rows.Add(new object[] { "V_SALE_DATE", bill_saledate });
                    dtParmBill.Rows.Add(new object[] { "V_BILL_NO", bill_biilno });
                    dtParmBill.Rows.Add(new object[] { "V_SALE_YN", "Y" });

                    string billSeq = DataLayer.ExecuteSpScala("PKG_DAZAZ02.PR_IAA031MS_PAYSEQ", dtParmBill, DataLayer.MessageEncoding.Default);
                    bill_payseq = billSeq;
                    seqno       = bill_payseq;

                    dtBill = Pay.PayAddBill(bill_saledate,
                                            bill_bizcode,
                                            bill_facilitycode,
                                            bill_posno,
                                            bill_biilno,
                                            bill_saleyn,
                                            bill_payseq,
                                            bill_agreeyn,
                                            bill_saleamt,
                                            bill_pe_co_code,
                                            bill_id_no_code,
                                            bill_id_no,
                                            bill_agreeno,
                                            bill_saledate,
                                            bill_easyyn,
                                            empno,
                                            bill_date,
                                            ip);
                }

                this.Cursor = Cursors.WaitCursor;

                //seqno 순번을 가져와서 할당한다.
                //입금테이블 [DCA030MS]
                // 사업장코드 // 영업장코드 //관리번호 //관리순번// 영업일자 // == 일련번호//
                // 순번을 가져온다
                //PR_KEY_SEQ
                DataTable dtParm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

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

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

                string deleteMemo = "";
                if (r["AGREE_NO"].ToString().Trim() != "")
                {
                    deleteMemo = "[승인번호:" + r["AGREE_NO"].ToString().Trim() + "]  사유: ";
                }
                DataTable dtcash = Pay.Room_110(bizcode,
                                                facilitycode,
                                                mngno,
                                                mngseq,
                                                taskdate,
                                                keyseq,
                                                rasiecode,
                                                paycode,
                                                payamt,
                                                itemstat,
                                                facipart, reference,
                                                seqno,
                                                deleteMemo + memo,  //원승인번호 + 삭제 사유
                                                co_facilitycode,
                                                co_mngcode,
                                                co_mngseq,
                                                co_taskdate,
                                                co_keyseq,
                                                st_facilitycode,
                                                st_mngno,
                                                st_mngseq,
                                                st_taskdate,
                                                st_keyseq,
                                                empno,
                                                ip,
                                                editstatus);

                string v_ret = "실행정보 없음";

                try{
                    if (IsBillYn)    //현금영수증 건이 있다면
                    {
                        DataSet dsTmp = DataLayer.AddProdedcure(new DataTable[] { dtcash, dtBill });
                        v_ret = DataLayer.ExecuteSpScalaTransaction(dsTmp, "OK", DataLayer.MessageEncoding.Default);
                    }
                    else     // 현금건만 있다면
                    {
                        v_ret = DataLayer.ExecuteSpScala("PKG_DAZAZ02_DEV.PR_ROOM_110", dtcash, DataLayer.MessageEncoding.Default);
                    }
                }catch (Exception ex)
                {
                    // 현금 영수증 승인취소건이 있다면
                    // 현금영수증 승인을 시킨다.원복
                    MessageBox.Show(ex.Message);
                    goto _lblRegCash;
                }

                if (v_ret != "OK")
                {
                    Basic.ShowMessage(1, v_ret);
                    goto _lblRegCash;
                }

                fnSelect();

                Basic.ShowMessage(1, "취소 하였습니다.");


                /*********************************************************/
                return;

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



_lblRegCash:
                if (IsBillYn)  //현금 승인취소건이 있다 다시 현금영수증을 승인한다.
                {
                    //현금영수증 승인요청
                    /***********************************************************************************************************************************************/


                    Van.RecivedData Regregreq = new Van.RecivedData();
                    using (BizVanComunication bizVanreg = new BizVanComunication())
                    {
                        Regregreq = bizVanreg.SendData("PROJECT_D",
                                                       JobKind.RegCash,
                                                       bill_pe_co_code == "P" ? Van.CashKind.Persnal : Van.CashKind.Company,
                                                       bill_id_no,
                                                       "",
                                                       "",
                                                       payamt,
                                                       "",
                                                       "",
                                                       "",
                                                       "",
                                                       bill_id_no_code == "1" ? CashGbn.Card : CashGbn.None);
                        bizVanreg.Dispose();
                    }


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

                    if (Regregreq.IsAgreeError)
                    {
                        Basic.ShowMessage(3, "[전산담당자에게 문의하세요]\n\r\n\r" +
                                          "현금영수증 승인 취소후 자료갱신시 에러가 있었습니다.. \n\nr" +
                                          "취소된 현금영수증 금액을 다시 승인처리 하는 도중 \n\r" +
                                          "아래와 같이 에러가 발생하엿습니다.\n\r\n\r" +
                                          "에러내용 : " + Regregreq.Message + "\n\r" +
                                          "식별코드 : " + bill_id_no_code == "P"  ? "개인(P)" : "법인(C) \n\r" +
                                          "식별번호 : " + bill_id_no + "\n\r" +
                                          "금    액 : " + int.Parse(payamt).ToString("n0"));

                        Van.Log.Log.SaveLog("현금영수증 취소 후 DB에러 - 현금영수 재 승인시 에러 - " + "식별코드 - " + bill_id_no_code +
                                            " / 식별번호 -" + bill_id_no + " / 금액 -" + payamt);
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        /// <summary>
        ///125 - [이지체크] 항목삭제
        /// </summary>
        /// <param name="r">The r.</param>
        /// <param name="emp">The emp.</param>
        /// <param name="memo">The memo.</param>
        private void fn_125(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;
                }

                //원승인번호를 받는다.
                _Pay_UserMemo = "";
                DAHAH06 f = new DAHAH06("이지체크", "승인번호", "GetReturnFunction");
                f.Owner = this;
                f.ShowDialog();
                if (_Pay_UserMemo.Trim() == "")
                {
                    Basic.ShowMessage(1, "승인번호가 없습니다.");
                    return;
                }
                string checkregno = _Pay_UserMemo;


                //카드정보를 읽어온다.
                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;
                }


                // 같은 승인 번호의 여러 결제건 처리
                string filter = " SALE_DATE = " + Basic.MaskReplace(r["TASK_DATE"].ToString().Trim())
                                + " AND BIZ_CODE = " + Parm.CurrentUserInformation.BizInfo.BizCode
                                + " AND FACILITY_CODE = " + r["FACILITY_CODE"].ToString().Trim()
                                + " AND POS_NO = " + "01"
                                + " AND BILL_NO = " + Basic.MaskReplace(Num.GetNumberOnly(Faci)) + Basic.MaskReplace(Num.GetNumberOnly(RoomNo))
                                + " AND PAY_SEQ = " + r["SEQ_NO"].ToString().Trim();
                DataRow[] drCardInfo = dsCardinfo.Tables[0].Select(filter);

                if (drCardInfo == null || drCardInfo.Length <= 0)
                {
                    Basic.ShowMessage(1, "해당 카드 결제 정보가 없습니다.");
                    return;
                }

                string saledate      = Appdate;
                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       = checkregno;
                string orgagreeno    = r["AGREE_NO"].ToString().Trim();

                string card_co_code = drCardInfo[0]["CARD_CO_CODE"].ToString().Trim();
                string card_co_name = drCardInfo[0]["CARD_CO_NAME"].ToString().Trim();
                string issu_co_code = drCardInfo[0]["ISSU_CO_CODE"].ToString().Trim();
                string issu_co_name = drCardInfo[0]["ISSU_CO_NAME"].ToString().Trim();
                string card_join_no = drCardInfo[0]["CARD_JOIN_NO"].ToString().Trim();
                string agreedate    = "";
                string agreetime    = "";
                string track_Two    = "";
                string easyyn       = "Y";
                string tid          = "";
                string empno        = emp;
                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  = "";                                                        //상태
                string facipart  = Faci;                                                      //동코드
                string reference = r["REFERENCE"].ToString().Trim();                          //참고(카드번호,승인번호/락카번호/연회번호/상품권번호/회원번호)
                string seqno     = payseq;                                                    //순번
                string rmrk      = "[승인번호:" + 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);
                    return;
                }

                fnSelect();

                Basic.ShowMessage(1, "취소 하였습니다.");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 단체후불
        /// </summary>
        private void fnPay115_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 = Math.Abs(int.Parse(Basic.MaskReplace(this.txtBankAmt.Text.Trim())));

                if (amt <= 0)
                {
                    Basic.ShowMessage(1, "결제금액을 입력하여 주십시요.");
                    txtEventAmt.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 (chkBankCashBillYn.Checked)
                //{
                //    if (lupBankCashBill_IdCode.EditValue.ToString() == "0")
                //    {
                //        DataRow[] dr = Parm.mDataTable.dtZx010ms.Select("HEAD = 'Z0028' AND DETAIL = '0' AND USE_YN = 'Y' ");

                //        if (dr.Length >= 0) txtBankCashBillRegNo.Text = dr[0]["ITEM1"].ToString();
                //    }

                //    if (lupBankCashBill_IdCode.EditValue.ToString() == "")
                //    {
                //        //현금영수증
                //        Basic.ShowMessage(1, "현금영수증 구분을 선택하여 주십시요");
                //        lupBankCashBill_IdCode.Focus();
                //        return;
                //    }
                //    else if (!chkBankCashSignPad.Checked && txtBankCashBillRegNo.Text.Trim().Length < 7)
                //    {
                //        //현금영수증
                //        Basic.ShowMessage(1, "식별번호를 정확하게 입력하여 주십시요");
                //        txtBankCashBillRegNo.Focus();
                //        return;
                //    }

                //    Van.RecivedData reqdata = new RecivedData();
                //    //식별번호를 싸인패드로 받는다면
                //    if (chkBankCashSignPad.Checked)
                //    {
                //        using (BizVanComunication regNumber = new BizVanComunication())
                //        {
                //            reqdata = regNumber.GetCashRegNumber("PROJECT_D",
                //                                                    int.Parse(Basic.MaskReplace(txtBankAmt.Text.Trim()))
                //                                                  );
                //            regNumber.Dispose();
                //        }
                //        txtBankCashBillRegNo.Text = reqdata.CashRegNumber;
                //    }

                //    if (txtBankCashBillRegNo.Text.Trim().Length < 7)
                //    {
                //        //현금영수증
                //        Basic.ShowMessage(1, "식별번호를 정확하게 입력하여 주십시요");
                //        txtBankCashBillRegNo.Focus();
                //        return;
                //    }

                //    //현금영수증 승인요청
                //    /***********************************************************************************************************************************************/
                //    // if(BizCommon.CheckVan.CheckMode() == DialogResult.No) return;

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

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

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

                //    //승인여부
                //    //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;
                //    try
                //    {
                //        _intInput = int.Parse(Basic.MaskReplace(txtBankAmt.Text.Trim()));
                //    }
                //    catch (Exception)
                //    {
                //        _intInput = -1;
                //    }

                //    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,
                //                                              optBankCashBillKind.SelectedIndex < 1 ? Van.CashKind.Persnal : Van.CashKind.Company,
                //                                              dr[0]["ITEM1"].ToString(),
                //                                              "",
                //                                              "",
                //                                              Basic.MaskReplace(txtBankAmt.Text.Trim()),
                //                                              "",
                //                                              "",
                //                                              "",
                //                                              "", CashGbn.None);
                //            bizVan.Dispose();
                //        }

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

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

                //        //승인여부
                //        //DB 작업 실패시 삭제하기위해서
                //        IsAgreeCash = true;
                //    }


                //}

                //string cashAgreeNo = Cashreqdata.AgreeNo;


                //현금결제 루틴을 태운다. - 객실입금테이블에 입금한다.
                //결재항목은 150으로 ..
                //비고항목에 연회계약번호(단체행사번호를) 넣는다.
                string rmrk = txtBankMemo.Text.Trim();
                //string rmrk = (cashAgreeNo.Equals("") ? "" : "[" + cashAgreeNo + "] ") + txtBankMemo.Text.Trim();
                //string v_ret = fn_110(amt.ToString(), IsAgreeCash, BizCommon.Parm_Pay.PAY_CODE_BANK, cashAgreeNo, empno, this.txtAmtNameBank.Text.Trim());
                string v_ret = fn_110(amt.ToString(), IsAgreeCash, BizCommon.Parm_Pay.PAY_CODE_BANK, rmrk, empno, this.txtAmtNameBank.Text.Trim());

                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,
                    //                                              optBankCashBillKind.SelectedIndex < 1 ? Van.CashKind.Persnal : Van.CashKind.Company,
                    //                                              txtBankCashBillRegNo.Text.Trim(),
                    //                                              "",
                    //                                              "",
                    //                                              Basic.MaskReplace(txtBankAmt.Text.Trim()),
                    //                                              "",
                    //                                              "",
                    //                                              "",
                    //                                              "",
                    //                                              lupBankCashBill_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;
                }

                //this.txtEventAmt.Text   = "0";
                //this.txtEventNo.Text    = "";
                //this.lblEventName.Text  = "";
                this.txtBankAmt.Text     = "0";
                this.txtAmtNameBank.Text = "";
                this.txtBankMemo.Text    = "";
                Basic.ShowMessage(1, "저장 하였습니다.");
                RaiseDataReflashEvent(true);
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
        }
示例#7
0
        /// <summary>
        /// 폼로드
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void DAHAH15_Load(object sender, EventArgs e)
        {
            try
            {
                SetDataTable();


                info.SaleDate = Appdate;
                info.useKind  = UseKind;
                info.RaseCode = RaseCode;

                info.RoomInfo.C_Bizcode      = Parm.CurrentUserInformation.BizInfo.BizCode;
                info.RoomInfo.C_Facilitycode = FacilityCode;
                info.RoomInfo.C_Facipart     = Faci;
                info.RoomInfo.C_Mngno        = MngNo;
                info.RoomInfo.C_Mngseq       = MngSeq;
                info.RoomInfo.C_Taskdate     = Appdate;
                info.RoomInfo.C_RoomNo       = RoomNo;
                info.RoomInfo.C_Rmrk         = "";
                info.RoomInfo.C_Reference    = "";

                info.RoomInfo.CO_Facilitycode = info.RoomInfo.C_Facilitycode;
                info.RoomInfo.CO_Keyseq       = "";
                info.RoomInfo.CO_Mngcode      = info.RoomInfo.C_Mngno;
                info.RoomInfo.CO_Mngseq       = info.RoomInfo.C_Mngseq;
                info.RoomInfo.CO_Taskdate     = info.RoomInfo.C_Taskdate;

                info.RoomInfo.ST_Facilitycode = info.RoomInfo.C_Facilitycode;
                info.RoomInfo.ST_Keyseq       = "";
                info.RoomInfo.ST_Mngno        = info.RoomInfo.C_Mngno;;
                info.RoomInfo.ST_Mngseq       = info.RoomInfo.C_Mngseq;
                info.RoomInfo.ST_Taskdate     = info.RoomInfo.C_Taskdate;


                f          = new Erp.Room.DAHA.DAZAZ02(info, "fnSelect");
                f.TopLevel = false;
                f.Dock     = DockStyle.Fill;
                this.pnlamt.Controls.Add(f);
                f.DataReflashEvent += new DAZAZ02.DataReflashEventHandler(f_DataReflashEvent);
                f.Show();

                fnSelect();

                bool IsClose = false;
                if (Faci.Trim() == "")
                {
                    Basic.ShowMessage(1, "동코드가 없습니다.");
                    IsClose = true;
                }
                else if (RoomNo.Trim() == "")
                {
                    Basic.ShowMessage(1, "객실번호가 없습니다.");
                    IsClose = true;
                }
                else if (MngNo.Trim() == "")
                {
                    Basic.ShowMessage(1, "관리번호가 없습니다.");
                    IsClose = true;
                }
                else if (MngSeq.Trim() == "")
                {
                    Basic.ShowMessage(1, "관리순번(MngSeq)가 없습니다.");
                    IsClose = true;
                }

                if (Basic.MaskReplace(Num.GetNumberOnly(Faci)) + Basic.MaskReplace(Num.GetNumberOnly(RoomNo)).Trim() == "")
                {
                    Basic.ShowMessage(2, "Bill 번호를 생성 할 수 없습니다.\n\r\n\r동코드:" + Faci + "\r\n객실번호:" + RoomNo);
                    return;
                }

                this.timer_Close.Enabled = IsClose;
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
                this.timer_Close.Enabled = true;
            }
        }
示例#8
0
        /// <summary>
        /// 카드 승인루틴 - 이지체크 신용카드
        /// </summary>
        /// <param name="amt">금액</param>
        /// <param name="cardnos">카드번호</param>
        /// <param name="scope">유효기간</param>
        /// <param name="company">매입사코드</param>
        /// <param name="companyname">매입사명</param>
        /// <param name="isscompany">발급사</param>
        /// <param name="isscompanyname">The isscompanyname.</param>
        /// <param name="cardjoinno">The cardjoinno.</param>
        /// <param name="regno">카드번호</param>
        /// <param name="split">할부기간</param>
        /// <param name="agreeDate">승인일</param>
        /// <param name="agreeTime">승인시간</param>
        /// <param name="TrackTow">투트랙정보</param>
        /// <param name="easyYn">이지체크여부</param>
        /// <param name="Tid">터미널아이디</param>
        private string fn_Card(string amt,
                               string cardnos,
                               string scope,
                               string company,
                               string companyname,
                               string isscompany,
                               string isscompanyname,
                               string cardjoinno,
                               string regno,
                               string split,
                               string agreeDate,
                               string agreeTime,
                               string TrackTow,
                               string easyYn,
                               string Tid,
                               string empNo, // 이지체크일때 담당자때문에 받는다.
                               ref string outSEQ)
        {
            try
            {
                string saledate      = "";
                string bizcode       = "";
                string facilitycode  = "";
                string billno        = "";
                string saleyn        = "";
                string payseq        = "";
                string agreeyn       = "";
                string saleamt       = "";
                string cardno        = "";
                string validthru     = "";
                string installentcnt = "";
                string agreeno       = "";
                string orgagreeno    = "";
                string card_co_code  = "";
                string card_co_name  = "";
                string issu_co_code  = "";
                string issu_co_name  = "";
                string card_join_no  = "";
                string agreedate     = "";
                string agreetime     = "";
                string track_Two     = "";
                string easyyn        = "";
                string tid           = "";
                //string empno         = "";
                string ip = "";


                if (Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo)).Trim() == "")
                {
                    return("Bill 번호를 생성 할 수 없습니다.\n\r\n\r동코드:" + PayInfomation.RoomInfo.C_Facipart + "\r\n객실번호:" + PayInfomation.RoomInfo.C_RoomNo);
                }

                DataTable[] dtTmp = null;
                if (PayInfomation.useKind == UseKind.Room)
                {
                    /*--------------------------------------------
                    *  객실일때
                    *  --------------------------------------------*/

                    saledate      = PayInfomation.SaleDate;
                    bizcode       = PayInfomation.RoomInfo.C_Bizcode;
                    facilitycode  = PayInfomation.RoomInfo.C_Facilitycode;
                    billno        = Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo)); //숫자만 축출한다.
                    saleyn        = "Y";
                    payseq        = "일련번호";
                    agreeyn       = int.Parse(amt) < 0 ? "N" : "Y"; //이지체크인경우대문에
                    saleamt       = amt;
                    cardno        = cardnos;
                    validthru     = scope;
                    installentcnt = split;
                    agreeno       = regno;
                    orgagreeno    = "";
                    card_co_code  = company;
                    card_co_name  = companyname;
                    issu_co_code  = isscompany;
                    issu_co_name  = isscompanyname;
                    card_join_no  = cardjoinno;
                    agreedate     = agreeDate;
                    agreetime     = agreeTime;
                    track_Two     = TrackTow;
                    easyyn        = easyYn;
                    tid           = Tid;
                    //empno         = "";
                    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);
                    outSEQ = payseq;

                    //일단 넘길테이블에 담는다.
                    DataTable dtCard = Pay.CreditCard(saledate,
                                                      bizcode,
                                                      facilitycode,
                                                      billno,
                                                      saleyn,
                                                      payseq,
                                                      agreeyn,
                                                      saleamt,
                                                      cardnos,
                                                      scope,
                                                      split,
                                                      regno,
                                                      orgagreeno,
                                                      card_co_code,
                                                      card_co_name,
                                                      issu_co_code,
                                                      issu_co_name,
                                                      cardjoinno,
                                                      agreedate,
                                                      agreetime,
                                                      track_Two,
                                                      easyyn,
                                                      tid,
                                                      empNo,
                                                      ip);



                    /*
                     * 카드 / 이지체크 등록시
                     * 선수금 항목이라면 객실입금테이블에 도 등록하고
                     * 그렇지 않으면 카드입금테이블에만 등록한다.
                     */


                    string mngno     = PayInfomation.RoomInfo.C_Mngno;
                    string mngseq    = PayInfomation.RoomInfo.C_Mngseq;
                    string taskdate  = PayInfomation.RoomInfo.C_Taskdate;
                    string keyseq    = "일련번호";
                    string rasiecode = ((int)PayInfomation.RaseCode).ToString();
                    string paycode   = easyYn == "Y" ? BizCommon.Parm_Pay.PAY_CODE_CARD2 : BizCommon.Parm_Pay.PAY_CODE_CARD;
                    string payamt    = amt;
                    string itemstat  = "N";
                    string facipart  = PayInfomation.RoomInfo.C_Facipart;
                    string reference = cardnos;          //카드번호;
                    string seqno     = payseq;           //카드테이블에서 채번한 일련번호
                    string rmrk      = regno;            //승인번호

                    string co_facilitycode = PayInfomation.RoomInfo.CO_Facilitycode;
                    string co_mngcode      = PayInfomation.RoomInfo.CO_Mngcode;
                    string co_mngseq       = PayInfomation.RoomInfo.CO_Mngseq;
                    string co_taskdate     = PayInfomation.RoomInfo.CO_Taskdate;
                    string co_keyseq       = PayInfomation.RoomInfo.CO_Keyseq;

                    string st_facilitycode = PayInfomation.RoomInfo.ST_Facilitycode;
                    string st_mngno        = PayInfomation.RoomInfo.ST_Mngno;
                    string st_mngseq       = PayInfomation.RoomInfo.ST_Mngseq;
                    string st_taskdate     = PayInfomation.RoomInfo.ST_Taskdate;
                    string st_keyseq       = PayInfomation.RoomInfo.ST_Keyseq;

                    string editstatus = "2";

                    DataTable dtParmCash = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

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

                    keyseq    = DataLayer.ExecuteSpScala("PKG_DAZAZ02.PR_DCA030MS_KEY_SEQ", dtParmCash, DataLayer.MessageEncoding.Default);
                    co_keyseq = st_keyseq = keyseq;

                    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);

                    dtTmp = new DataTable[] { dtcash, dtCard };
                }

                DataSet dsTmp = DataLayer.AddProdedcure(dtTmp);

                string v_ret = "";
                try
                {
                    v_ret = DataLayer.ExecuteSpScalaTransaction(dsTmp, "OK", DataLayer.MessageEncoding.Default);
                }
                catch (Exception ex1)
                {
                    v_ret = ex1.Message;
                }

                return(v_ret);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#9
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;
            }
        }