Пример #1
0
        /// <summary>
        /// [포인트]  항목 삭제
        /// </summary>
        /// <param name="r">입금정보</param>
        /// <param name="emp">사번.</param>
        /// <param name="memo">사유.</param>
        private void fn_181(DataRow r, string emp, string memo, string seqnos)
        {
            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";                                                      //작업구분



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

                DataTable dtcash = Pay.Room_110(bizcode,
                                                facilitycode,
                                                mngno,
                                                mngseq,
                                                taskdate,
                                                keyseq,
                                                rasiecode,
                                                paycode,
                                                payamt,
                                                itemstat,
                                                facipart, reference,
                                                seqno,
                                                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 = "실행정보 없음";

                v_ret = DataLayer.ExecuteSpScala("PKG_DAZAZ02_DEV.PR_ROOM_110", dtcash, DataLayer.MessageEncoding.Default);



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

                fnSelect();

                Basic.ShowMessage(1, "취소 하였습니다.");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <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;
            }
        }
        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="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;
            }
        }