コード例 #1
0
        /// <summary>
        /// 승인을 요청합니다.
        /// </summary>
        /// <param name="Project">업무구분 [PROJECT_D ,  PROJECT_H ...]</param>
        /// <param name="kind">현금인지  /  카드인지 구분</param>
        /// <param name="cashKind">현금영주증  중 개인/법인구분</param>
        /// <param name="cardno">카드번호  / 식별번호</param>
        /// <param name="scope">유효기간</param>
        /// <param name="amtSplit">할부개월</param>
        /// <param name="amt">승인금액</param>
        /// <param name="vanSeq">POS  에서  밴 거래시  일련번호</param>
        /// <param name="SignDataString">싸인이미지</param>
        /// <returns></returns>
        public Van.RecivedData SendData(string Project,
                                        Van.JobKind kind,
                                        CashKind cashKind,
                                        string cardno,
                                        string scope,
                                        string amtSplit,
                                        string amt,
                                        string vanSeq,
                                        string SignDataString,
                                        string OrgAgreeNo,
                                        string OrgAgreeDate
                                        , CashGbn cashgbn)
        {
            try
            {
                BizCommon.VanType type    = VanType.NONE;
                string            svrIP   = "";
                string            svrPort = "";
                string            tid     = "";

                SignPad pad         = SignPad.NONE;
                string  signcomport = "";

                type = BizVan.GetProjectVaninfo(Project, kind, ref svrIP, ref svrPort, ref tid, ref pad, ref signcomport);

                return(MySendData(type, svrIP, svrPort, kind, cashKind, tid, cardno, scope, amtSplit, amt, vanSeq, SignDataString, OrgAgreeNo, OrgAgreeDate, cashgbn));
            }
            catch (Exception ex)
            {
                throw  ex;
            }
        }
コード例 #2
0
        /// <summary>
        /// 업무  구분별 밴정보를  가져온다.
        /// </summary>
        /// <param name="Project">업무구분  프로젝트.</param>
        /// <param name="kind">현금인지 /  카드인지</param>
        /// <param name="svrIp">서버아아피</param>
        /// <param name="svrPort">서버포트.</param>
        /// <param name="tid">터미널아이디</param>
        /// <returns></returns>
        public static BizCommon.VanType  GetProjectVaninfo(string Project,
                                                           Van.JobKind kind,
                                                           ref string svrIp,
                                                           ref string svrPort,
                                                           ref string tid,
                                                           ref SignPad pad,
                                                           ref string SinpadComport
                                                           )
        {
            BizCommon.VanType type = VanType.NONE;

            switch (Project.ToUpper())
            {
            case  "PROJECT_H":
                type    = Parm.CurrentUserInformation.golfTask.VanInfomation.vanType;
                svrIp   = Parm.CurrentUserInformation.golfTask.VanInfomation.SvrIP;
                svrPort = Parm.CurrentUserInformation.golfTask.VanInfomation.SvrPort;

                if (kind == JobKind.CancelCash || kind == JobKind.RegCash)
                {
                    tid = Parm.CurrentUserInformation.golfTask.CashTid;
                }
                else if (kind == JobKind.CancelCard || kind == JobKind.RegCard)
                {
                    tid = Parm.CurrentUserInformation.golfTask.CardTid;
                }

                SinpadComport = Parm.CurrentUserInformation.golfTask.SignPort;
                pad           = Parm.CurrentUserInformation.golfTask.SignPad;


                break;

            case "PROJECT_D":
                type    = Parm.CurrentUserInformation.roomTask.VanInfomation.vanType;
                svrIp   = Parm.CurrentUserInformation.roomTask.VanInfomation.SvrIP;
                svrPort = Parm.CurrentUserInformation.roomTask.VanInfomation.SvrPort;

                if (kind == JobKind.CancelCash || kind == JobKind.RegCash)
                {
                    tid = Parm.CurrentUserInformation.roomTask.gsCashTerminalID;
                }
                else if (kind == JobKind.CancelCard || kind == JobKind.RegCard)
                {
                    tid = Parm.CurrentUserInformation.roomTask.gsCardTerminalID;
                }

                SinpadComport = Parm.CurrentUserInformation.roomTask.gsEtcSignPort;
                pad           = Parm.CurrentUserInformation.roomTask.gsEtcSignPad;

                break;
            }

            return(type);
        }
コード例 #3
0
        /// <summary>
        /// 실제적인 승인처리 현금영수 - 카드 승인/취소 공통이다.
        /// </summary>
        /// <param name="Project">The project.</param>
        /// <param name="kind">종류 /  카드승인/카드취소/현금승인/현금취소등</param>
        /// <param name="cashKind">현금영수증일대  구분</param>
        /// <param name="cardno">카드번호 /  식별번호</param>
        /// <param name="scope">유효기간</param>
        /// <param name="amtSplit">할부개월</param>
        /// <param name="amt">금액</param>
        /// <param name="vanSeq">밴일련번호 - pos에서  밴거래시  1씩증가</param>
        /// <param name="SignDataString">싸인데이터</param>
        /// <param name="OrgAgreeNo">The org agree no.</param>
        /// <param name="OrgAgreeDate">The org agree date.</param>
        /// <returns></returns>
        public string GetVanMakeCardProtocol(string Project,
                                             Van.JobKind kind,
                                             CashKind cashKind,
                                             string cardno,
                                             string scope,
                                             string amtSplit,
                                             string amt,
                                             string vanSeq,
                                             string SignDataString,
                                             string OrgAgreeNo,
                                             string OrgAgreeDate
                                             , CashGbn cashgbn)
        {
            try
            {
                string svrIP   = "";
                string svrPort = "";
                string tid     = "";

                SignPad pad         = SignPad.NONE;
                string  signcomport = "";

                BizCommon.VanType rtype = BizVan.GetProjectVaninfo(Project, kind, ref svrIP, ref svrPort, ref tid, ref pad, ref signcomport);

                Van.VanType type = BizVan.ConvertToVanType(rtype);

                if (tid == "")
                {
                    throw new Exception("밴 터미널 아이디가 등록되지 않았습니다.");
                }
                else if (rtype != VanType.KIS && (type == Van.VanType.NONE || svrIP == "" || svrPort == ""))
                {
                    throw new Exception("밴 환경설정이 없습니다.");
                }
                string str = "";

                if (kind == JobKind.RegCard || kind == JobKind.RegCash)
                {
                    //현금영수증 부가세 관련현 수정
                    string strVat = "";// intVat = 0;
                    if (amt == null || amt == "0" || amt == "")
                    {
                        strVat = "";
                    }
                    else
                    {
                        strVat = ((int)(Convert.ToDouble(amt) - Convert.ToDouble(amt) / 1.1)).ToString();
                    }

                    switch (type)
                    {
                    case Van.VanType.KICC:
                        str = Van.KICC.Reg(kind,
                                           cashKind,
                                           tid,
                                           cardno,
                                           scope,
                                           Basic.MaskReplace(amtSplit.Trim()),
                                           Basic.MaskReplace(amt.Trim()));
                        break;

                    case Van.VanType.KSNET:
                        str = Van.KSNET.Reg(kind,
                                            cashKind,
                                            tid,
                                            cardno,
                                            scope,
                                            Basic.MaskReplace(amtSplit.Trim()),
                                            Basic.MaskReplace(amt.Trim()),
                                            1,
                                            SignDataString);


                        break;

                    case Van.VanType.KIS:
                        str = Van.KIS.Reg(kind
                                          , cashKind
                                          , tid
                                          , cardno
                                          , scope
                                          , Basic.MaskReplace(amtSplit.Trim())
                                          , Basic.MaskReplace(amt.Trim())
                                          , strVat
                                          , cashgbn);

                        break;
                    }
                }
                else if (kind == JobKind.CancelCash || kind == JobKind.CancelCard)
                {
                    switch (type)
                    {
                    case Van.VanType.KICC:
                        str = Van.KICC.Cancel(kind,
                                              cashKind,
                                              tid,
                                              cardno,
                                              scope,
                                              Basic.MaskReplace(amtSplit.Trim()),
                                              Basic.MaskReplace(amt.Trim()),
                                              OrgAgreeNo,
                                              OrgAgreeDate
                                              );
                        break;

                    case Van.VanType.KSNET:
                        str = KSNET.Cancel(kind,
                                           cashKind,
                                           tid,
                                           cardno,
                                           scope,
                                           Basic.MaskReplace(amtSplit.Trim()),
                                           Basic.MaskReplace(amt.Trim()),
                                           OrgAgreeNo,
                                           OrgAgreeDate,
                                           1,
                                           "");
                        break;
                    }
                }



                return(str);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
        public Van.RecivedData GetCashRegNumber(string Project, int amt)
        {
            try
            {
                string svrIP   = "";
                string svrPort = "";
                string tid     = "";

                SignPad pad         = SignPad.NONE;
                string  signcomport = "";

                BizCommon.VanType rtype = BizVan.GetProjectVaninfo(Project, JobKind.None, ref svrIP, ref svrPort, ref tid, ref pad, ref signcomport);

                Van.VanType type = BizVan.ConvertToVanType(rtype);

                if (signcomport == "")
                {
                    throw new Exception("싸인패드 포트가 등록되지 않았습니다.");
                }

                if (pad == SignPad.NONE)
                {
                    throw new Exception("환경설정에 선택한 싸인패드가 없습니다. \n\r식별번호를 수기로 입력하세요");
                }
                else if (pad == SignPad.KSP100S)
                {
                    throw new Exception("선택되어진 싸인패드는 식별번호를 받을 수 없습니다. \n\r식별번호를 수기로 입력하세요");
                }



                /*************************************************************************/
                //싸인패드 식별번호 요청
                /*************************************************************************/



                Van.frmVanLoading fCash = new Van.frmVanLoading("현금영수증 식별번호 요청",
                                                                type,
                                                                frmVanLoading.JobKind.CashRegNumber,
                                                                "BizGetRequest");



                try
                {
                    fCash.Amount    = amt;
                    fCash.SignPort  = int.Parse(signcomport.Replace("COM", ""));
                    fCash.SignSpeed = 57600;
                    fCash.Owner     = this;
                    IsLoop          = true;
                    fCash.ShowDialog();
                }
                catch (Exception ex)
                {
                    throw ex;
                }


                while (IsLoop)
                {
                    Application.DoEvents();
                }

                if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.PortError).ToString())
                {
                    throw new Exception("싸인패드 연결실패 입니다.");
                }
                else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.NotData).ToString())
                {
                    throw new Exception("반환된 결과 값이 없습니다.");
                }
                else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.TimeOut).ToString())
                {
                    throw new Exception("제한시간 초과 입니다.");
                }
                else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.Communication).ToString())
                {
                    throw new Exception("싸인패드와 통신할 수 없습니다.");
                }


                if (_ReqData.CashRegNumber.Trim() == "")
                {
                    throw new Exception("식별번호가 없습니다.");
                }


                return(_ReqData);
            }
            catch (Exception ex)
            {
                throw  ex;
            }
        }
コード例 #5
0
        /// <summary>
        /// 싸인을 받습니다.
        /// </summary>
        /// <param name="tid">터미널아이디</param>
        /// <param name="svrIP">서버아이피</param>
        /// <param name="svrPort">서버포트</param>
        /// <param name="Amt">금액</param>
        /// <param name="ComPort">싸인패드포트</param>
        /// <param name="reqdata">응답데이터</param>
        public bool GetSign(string Project, int Amt, ref Van.RecivedData reqdata, string VanAgreeProtocal)
        {
            try
            {
                string svrIP   = "";
                string svrPort = "";
                string tid     = "";

                SignPad pad         = SignPad.NONE;
                string  signcomport = "";

                BizCommon.VanType rtype = BizVan.GetProjectVaninfo(Project, JobKind.None, ref svrIP, ref svrPort, ref tid, ref pad, ref signcomport);

                Van.VanType type = BizVan.ConvertToVanType(rtype);

                if (signcomport == "")
                {
                    throw new Exception("싸인패드 포트가 등록되지 않았습니다.");
                }

                #region 서명모드
                /******************************************************************************/
                // 싸인패드가 체크 되어 있다면 서명모드 시작
                /******************************************************************************/


                //string str = Van.KICC.Reg(  kind,
                //                            cashKind,
                //                            tid,
                //                            cardno,
                //                            scope,
                //                            Basic.MaskReplace(amtSplit.Trim()),
                //                            Basic.MaskReplace(amt.Trim()));

_lblReTry:



                Van.frmVanLoading fCash = new Van.frmVanLoading("고객싸인요청",
                                                                type,
                                                                frmVanLoading.JobKind.Sign,
                                                                "BizGetRequest");
                try
                {
                    fCash.Amount         = Amt;
                    fCash.SignPort       = int.Parse(signcomport.Replace("COM", ""));
                    fCash.VanServerIP    = svrIP;
                    fCash.VanServerPort  = svrPort.Trim() == "" ? -999 : int.Parse(svrPort);
                    fCash.SignPadReqdata = VanAgreeProtocal;
                    fCash.Tid            = tid;


                    switch (pad)
                    {
                    case SignPad.EP791R:
                        fCash.SignSpeed = 57600;
                        break;

                    case SignPad.KSP100S:
                        fCash.SignSpeed = 34800;
                        break;

                    case SignPad.KISSP30:
                        fCash.SignSpeed = 57600;
                        break;

                    case SignPad.NONE:
                        throw new Exception("서명패드설정이 되어 있지 않습니다.");
                    }
                }
                catch (Exception ex)
                {
                    string strMsg = "싸인패드 설정 오류입니다. \n\r" +
                                    "거래내역은 아직 승인되지 않았습니다. \n\r" +
                                    "오류내용 : \n\r" + ex.Message;

                    throw new Exception(strMsg);
                }

                IsLoop      = true;
                fCash.Owner = this;
                fCash.ShowDialog();
                Application.DoEvents();


                while (IsLoop)
                {
                    Application.DoEvents();
                }
                reqdata = _ReqData;


                if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.PortError).ToString())
                {
                    if (MessageBox.Show("싸인패드 연결실패 입니다. - 싸인패드와 통신 상태를 확인하세요 \n\r" +
                                        "거래내역은 아직 승인되지 않았습니다. \n\r" +
                                        "싸인패드와 다시 연결을 시도 하시겠습니까? ", "확인",
                                        MessageBoxButtons.RetryCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
                    {
                        //취소를 누르면 빠져나간다.
                        return(false);
                    }
                    else
                    {
                        //재시도를 누르면 다시 싸인패드를 호출한다.
                        goto _lblReTry;
                    }
                }
                else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.NotImage).ToString())
                {
                    if (MessageBox.Show("싸인이미지가 없습니다. \n\r" +
                                        "거래내역은 아직 승인되지 않았습니다. \n\r" +
                                        "싸인패드와 다시 연결을 시도 하시겠습니까? ", "확인",
                                        MessageBoxButtons.RetryCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
                    {
                        //취소를 누르면 빠져나간다.
                        return(false);
                    }
                    else
                    {
                        //재시도를 누르면 다시 싸인패드를 호출한다.
                        goto _lblReTry;
                    }
                }
                else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.TimeOut).ToString())
                {
                    if (MessageBox.Show("제한시간 초과 입니다. \n\r" +
                                        "거래내역은 아직 승인되지 않았습니다. \n\r" +
                                        "싸인패드와 다시 연결을 시도 하시겠습니까? ", "확인",
                                        MessageBoxButtons.RetryCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
                    {
                        //취소를 누르면 빠져나간다.
                        return(false);
                    }
                    else
                    {
                        //재시도를 누르면 다시 싸인패드를 호출한다.
                        goto _lblReTry;
                    }
                }
                else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.Communication).ToString())
                {
                    if (MessageBox.Show("싸인패드와 통신할 수 없습니다. \n\r" +
                                        "거래내역은 아직 승인되지 않았습니다.\n\r" +
                                        "싸인패드와 다시 연결을 시도 하시겠습니까? ", "확인",
                                        MessageBoxButtons.RetryCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
                    {
                        //취소를 누르면 빠져나간다.
                        return(false);
                    }
                    else
                    {
                        //재시도를 누르면 다시 싸인패드를 호출한다.
                        goto _lblReTry;
                    }
                }
                else if (_ReqData.RequestCode == ((int)Van.frmVanLoading.RS232Err.NotData).ToString())
                {
                    if (MessageBox.Show("리턴된 데이터가 없습니다. \n\r" +
                                        "거래내역은 아직 승인되지 않았습니다. \n\r" +
                                        "싸인패드와 다시 연결을 시도 하시겠습니까? ", "확인",
                                        MessageBoxButtons.RetryCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
                    {
                        //취소를 누르면 빠져나간다.
                        return(false);
                    }
                    else
                    {
                        //재시도를 누르면 다시 싸인패드를 호출한다.
                        goto _lblReTry;
                    }
                }
                //*********************************************************************************

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

                if (type != Van.VanType.KIS)
                {
                    Van.SignViewer f = new SignViewer(img);
                    f.ShowDialog();
                    Application.DoEvents();
                }



                /******************************************************************************/
                // 서명모드 종료
                /******************************************************************************/

                #endregion

                return(true);
            }
            catch (Exception ex)
            {
                throw  ex;
            }
        }
コード例 #6
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 btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string facilitycode = "";
                string facilityname = "";

                string signpadport = CboBox.ComboSelectedMember(this.cboSignPort, "VAL");
                string tsp800print = CboBox.ComboSelectedMember(this.cboPrintTSP800, "VAL");
                string signpad     = CboBox.ComboSelectedMember(this.cboSignPad, "VAL");
                bool   signpaduse  = chkSignPadUse.Checked;

                string machinestyle   = CboBox.ComboSelectedMember(this.cboComPrintMachine, "VAL");
                string printcomport   = CboBox.ComboSelectedMember(this.cboComPort, "VAL");
                string printstopbit   = CboBox.ComboSelectedMember(this.cboComStopBit, "VAL");
                string printdatabit   = CboBox.ComboSelectedMember(this.cboComDataBit, "VAL");
                string printbaundrate = CboBox.ComboSelectedMember(this.cboComBoundRate, "VAL");
                string printparity    = CboBox.ComboSelectedMember(this.cboComParity, "VAL");
                string printmode      = "";

                if (chkRS232.Checked)
                {
                    printmode = "SERIALPORT";
                }
                else if (chkDriver.Checked)
                {
                    printmode = "DRIVER";
                }



                if (this.lupFacility.EditValue.ToString().Trim() != "" && this.lupFacility.Text.Trim() != "")
                {
                    facilitycode = this.lupFacility.EditValue.ToString();
                    facilityname = this.lupFacility.Text.Trim();
                }


                Parm.CurrentUserInformation.golfTask.CardTid = "";
                Parm.CurrentUserInformation.golfTask.CashTid = "";


                if (Parm.CurrentUserInformation.golfTask.FacilityCode != "")
                {
                    DataTable dtParmGolf = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtParmGolf.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtParmGolf.Rows.Add(new object[] { "V_FACILITY_CODE", Parm.CurrentUserInformation.golfTask.FacilityCode });
                    dtParmGolf.Rows.Add(new object[] { "V_POS_NO", "01" });

                    DataSet dsGolfTmp = DataLayer.ExecuteSpDataset("PKG_REFERENCE_TASK.PR_04", dtParmGolf, DataLayer.MessageEncoding.Default);

                    if (dsGolfTmp.Tables[0].Rows.Count > 0)
                    {
                        Parm.CurrentUserInformation.golfTask.CardTid = dsGolfTmp.Tables[0].Rows[0]["CARD_TID"].ToString().Trim();
                        Parm.CurrentUserInformation.golfTask.CashTid = dsGolfTmp.Tables[0].Rows[0]["CASH_TID"].ToString().Trim();
                    }
                }

                //해당사업장 거만 삭제
                DataRow[] rr  = dtReference.Select("BIZ_CODE = '" + Parm.CurrentUserInformation.BizInfo.BizCode + "'");
                string    str = "BIZ_CODE = '" + Parm.CurrentUserInformation.BizInfo.BizCode + "'";
                for (int j = 0; j < rr.Length; j++)
                {
                    dtReference.Rows.Remove(rr[j]);
                }


                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "FACILITY_CODE", facilitycode });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "FACILITY_NAME", facilityname });

                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "SIGNPAD_PORT", signpadport });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "SIGNPAD", signpad });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "SIGNPAD_USE", signpaduse ? "Y" : "N" });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_TSP800", tsp800print });

                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_PORT", printcomport });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_BAUND", printbaundrate });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_PARITY", printparity });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_STOPBIT", printstopbit });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_DATABIT", printdatabit });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_MACHINE", machinestyle });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_MODE", printmode });



                dtReference.WriteXml(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_GOLF_REFERENCE_FILE);

                Parm.CurrentUserInformation.golfTask.FacilityCode = facilitycode;
                Parm.CurrentUserInformation.golfTask.FacilityName = facilityname;
                Parm.CurrentUserInformation.golfTask.SignPort     = signpadport;
                Parm.CurrentUserInformation.golfTask.TSP800       = tsp800print;
                Parm.CurrentUserInformation.golfTask.IsUseSignpad = signpaduse;

                Parm.CurrentUserInformation.golfTask.SerialPrintInfo.ComPort   = printcomport;
                Parm.CurrentUserInformation.golfTask.SerialPrintInfo.BaundRate = printbaundrate;
                Parm.CurrentUserInformation.golfTask.SerialPrintInfo.DataBit   = printdatabit;
                Parm.CurrentUserInformation.golfTask.SerialPrintInfo.Parity    = RS232Info.GetConvertParity(printparity);
                Parm.CurrentUserInformation.golfTask.SerialPrintInfo.StopBit   = RS232Info.GetConvertStopBit(printstopbit);


                PrintMode printMode = PrintMode.NONE;

                switch (printmode)
                {
                case "SERIALPORT":
                    printMode = PrintMode.SERIALPORT;
                    break;

                case  "DRIVER":
                    printMode = PrintMode.DRIVER;
                    break;
                }

                Parm.CurrentUserInformation.golfTask.PrintMode = printMode;

                SignPad stPad = SignPad.NONE;

                switch (signpad)
                {
                case "EP791R":
                    stPad = SignPad.EP791R;
                    break;

                case "KSP100S":
                    stPad = SignPad.KSP100S;
                    break;

                case "KISSP30":
                    stPad = SignPad.KISSP30;
                    break;
                }

                Parm.CurrentUserInformation.golfTask.SignPad = stPad;

                ComPortPrintStyle comprintstyle = ComPortPrintStyle.NONE;
                switch (machinestyle)
                {
                case "LUKHAN":
                    comprintstyle = ComPortPrintStyle.LUKHAN;
                    break;
                }

                Parm.CurrentUserInformation.golfTask.SerialPrintStyle = comprintstyle;

                dr = DialogResult.OK;

                Basic.ShowMessage(1, "모든설정을 저장하였습니다.");
            }
            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 btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string facilitycode     = "";
                string facililtyname    = "";
                string facilitypart     = "";
                string facilitypartname = "";
                string rfiddest         = CboBox.ComboSelectedMember(this.cboRFID, "VAL");
                string rfidport         = CboBox.ComboSelectedMember(this.cboRFIDPort, "VAL");
                string signpadport      = CboBox.ComboSelectedMember(this.cboSignPort, "VAL");
                string tsp800print      = CboBox.ComboSelectedMember(this.cboPrintTSP800, "VAL");
                string signpad          = CboBox.ComboSelectedMember(this.cboSignPad, "VAL");
                bool   signpaduse       = chkSignPadUse.Checked;
                string cardtid          = "";
                string cashtid          = "";
                string depositwindowyn  = "";
                string roomviewyn       = "";
                string taskDate         = "";

                string machinestyle   = CboBox.ComboSelectedMember(this.cboComPrintMachine, "VAL");
                string printcomport   = CboBox.ComboSelectedMember(this.cboComPort, "VAL");
                string printstopbit   = CboBox.ComboSelectedMember(this.cboComStopBit, "VAL");
                string printdatabit   = CboBox.ComboSelectedMember(this.cboComDataBit, "VAL");
                string printbaundrate = CboBox.ComboSelectedMember(this.cboComBoundRate, "VAL");
                string printparity    = CboBox.ComboSelectedMember(this.cboComParity, "VAL");
                string printmode      = "";

                if (chkRS232.Checked)
                {
                    printmode = "SERIALPORT";
                }
                else if (chkDriver.Checked)
                {
                    printmode = "DRIVER";
                }



                if (this.lupFacility.EditValue.ToString().Trim() != "" && this.lupFacility.Text.Trim() != "")
                {
                    facilitycode = this.lupFacility.EditValue.ToString();
                }

                if (this.lupFacilityPart.EditValue.ToString().Trim() != "" && this.lupFacilityPart.Text.Trim() != "")
                {
                    facilitypart = this.lupFacilityPart.EditValue.ToString();
                }


                DataTable dtParm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtParm.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtParm.Rows.Add(new object[] { "V_FACILITY_CODE", facilitycode });
                dtParm.Rows.Add(new object[] { "V_FACI_PART", facilitypart });
                dtParm.Rows.Add(new object[] { "V_POS_NO", Parm._ROOM_POS_NO });

                DataSet dsTmp = DataLayer.ExecuteSpDataset("PKG_REFERENCE_TASK.PR_01", dtParm, DataLayer.MessageEncoding.Default);

                if (dsTmp.Tables[0].Rows.Count > 0)
                {
                    facililtyname    = dsTmp.Tables[0].Rows[0]["FACILITY_NAME"].ToString().Trim();
                    facilitypartname = dsTmp.Tables[0].Rows[0]["FACI_PART_NAME"].ToString().Trim();
                    cardtid          = dsTmp.Tables[0].Rows[0]["CARD_TID"].ToString().Trim();
                    cashtid          = dsTmp.Tables[0].Rows[0]["CASH_TID"].ToString().Trim();
                }
                else
                {
                    Basic.ShowMessage(2, "영업장별특성[DZA010MS] , 영업장별POS[JAA020MS] , 영업장정보[JAA010MS], 동구분[DZA021MS] 테이블에 정보가 없습니다.");
                    return;
                }

                if (dsTmp.Tables[1].Rows.Count > 0)
                {
                    taskDate = dsTmp.Tables[1].Rows[0][0].ToString().Trim();
                }
                else
                {
                    Basic.ShowMessage(1, "TaskDate가 없습니다.");
                }



                DataTable dtParm13 = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtParm13.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtParm13.Rows.Add(new object[] { "V_FACILITY_TYPE", Parm.CurrentUserInformation.roomTask.gsDFacility });

                DataSet dsTmp13 = DataLayer.ExecuteSpDataset("PKG_REFERENCE_TASK.PR_03", dtParm13, DataLayer.MessageEncoding.Default);

                if (dsTmp13.Tables[0].Rows.Count > 0)
                {
                    Parm.CurrentUserInformation.roomTask.gsTaskDate = dsTmp13.Tables[0].Rows[0][0].ToString().Trim();
                }

                //객실특성
                if (dsTmp13.Tables[1].Rows.Count > 0)
                {
                    for (int u = 0; u < dsTmp13.Tables[1].Rows.Count; u++)
                    {
                        switch (dsTmp13.Tables[1].Rows[u]["PART_CODE"].ToString().Trim())
                        {
                        case "100":         //회원제여부
                            Parm.CurrentUserInformation.roomTask.IsMember = dsTmp13.Tables[1].Rows[u][1].ToString().Trim() == "Y" ? true : false;
                            break;

                        case "200":         //인테리어사용여부 / 온돌 / 침실 욥션등..
                            Parm.CurrentUserInformation.roomTask.IsInterior = dsTmp13.Tables[1].Rows[u][1].ToString().Trim() == "Y" ? true : false;
                            break;
                        }
                    }
                }

                if (dsTmp13.Tables[2].Rows.Count > 0)
                {
                    Parm.CurrentUserInformation.roomTask.IsForcasting = dsTmp13.Tables[2].Rows[0][0].ToString().Trim() == "Y" ? true : false;
                    Parm.CurrentUserInformation.roomTask.IsDePosit    = dsTmp13.Tables[2].Rows[0][1].ToString().Trim() == "Y" ? true : false;
                }



                //해당사업장 거만 삭제
                DataRow[] rr  = dtReference.Select("BIZ_CODE = '" + Parm.CurrentUserInformation.BizInfo.BizCode + "'");
                string    str = "BIZ_CODE = '" + Parm.CurrentUserInformation.BizInfo.BizCode + "'";
                for (int j = 0; j < rr.Length; j++)
                {
                    dtReference.Rows.Remove(rr[j]);
                }


                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "FACILITY_CODE", facilitycode });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "FACILITY_PART", facilitypart });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "RFID_DEST", rfiddest });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "RFID_PORT", rfidport });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "SIGNPAD_PORT", signpadport });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "SIGNPAD", signpad });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "SIGNPAD_USE", signpaduse ? "Y" : "N" });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_TSP800", tsp800print });

                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_PORT", printcomport });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_BAUND", printbaundrate });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_PARITY", printparity });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_STOPBIT", printstopbit });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_DATABIT", printdatabit });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_COM_MACHINE", machinestyle });
                dtReference.Rows.Add(new object[] { Parm.CurrentUserInformation.BizInfo.BizCode, "PRINT_MODE", printmode });



                dtReference.WriteXml(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_ROOM_REFERENCE_FILE);


                Parm.CurrentUserInformation.roomTask.gsCardTerminalID = cardtid;
                Parm.CurrentUserInformation.roomTask.gsCashTerminalID = cashtid;
                Parm.CurrentUserInformation.roomTask.gsDFacility      = facilitycode;
                Parm.CurrentUserInformation.roomTask.gsDFacilityName  = facililtyname;
                Parm.CurrentUserInformation.roomTask.gsDFaciPart      = facilitypart;
                Parm.CurrentUserInformation.roomTask.gsDFaciPartName  = facilitypartname;
                Parm.CurrentUserInformation.roomTask.gsEtcSignPort    = signpadport;
                Parm.CurrentUserInformation.roomTask.gsRFCOMPort      = rfidport;
                Parm.CurrentUserInformation.roomTask.gsRFDest         = rfiddest;
                Parm.CurrentUserInformation.roomTask.TSP800           = tsp800print;
                Parm.CurrentUserInformation.roomTask.gsTaskDate       = taskDate;
                Parm.CurrentUserInformation.roomTask.IsUseSignpad     = signpaduse;

                Parm.CurrentUserInformation.roomTask.SerialPrintInfo.ComPort   = printcomport;
                Parm.CurrentUserInformation.roomTask.SerialPrintInfo.BaundRate = printbaundrate;
                Parm.CurrentUserInformation.roomTask.SerialPrintInfo.DataBit   = printdatabit;
                Parm.CurrentUserInformation.roomTask.SerialPrintInfo.Parity    = RS232Info.GetConvertParity(printparity);
                Parm.CurrentUserInformation.roomTask.SerialPrintInfo.StopBit   = RS232Info.GetConvertStopBit(printstopbit);


                PrintMode printMode = PrintMode.NONE;

                switch (printmode)
                {
                case "SERIALPORT":
                    printMode = PrintMode.SERIALPORT;
                    break;

                case  "DRIVER":
                    printMode = PrintMode.DRIVER;
                    break;
                }

                Parm.CurrentUserInformation.roomTask.gsPrintMode = printMode;

                SignPad stPad = SignPad.NONE;

                switch (signpad)
                {
                case "EP791R":
                    stPad = SignPad.EP791R;
                    break;

                case "KSP100S":
                    stPad = SignPad.KSP100S;
                    break;

                case "KISSP30":
                    stPad = SignPad.KISSP30;
                    break;
                }

                Parm.CurrentUserInformation.roomTask.gsEtcSignPad = stPad;

                ComPortPrintStyle comprintstyle = ComPortPrintStyle.NONE;
                switch (machinestyle)
                {
                case "LUKHAN":
                    comprintstyle = ComPortPrintStyle.LUKHAN;
                    break;
                }

                Parm.CurrentUserInformation.roomTask.SerialPrintStyle = comprintstyle;

                dr = DialogResult.OK;

                Basic.ShowMessage(1, "Van TID 는 서버에 셋팅된 값으로 저장됩니다. \n\r모든설정을 저장하였습니다.");
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
        }