/// <summary> /// 프린터 설정여부 /// </summary> /// <param name="type">프로젝트 타입 [업무타입]</param> /// <param name="IsSkip">다음단계 진행여부</param> /// <returns> /// <c>true</c> if [is print setting] [the specified type]; otherwise, <c>false</c>. /// </returns> /// <example> /// <code> ///private void HFHAH04_Load(object sender, EventArgs e) ///{ /// try /// { /// bool IsSkip = false; /// /// if(Parm.CurrentUserInformation.golfTask.CardTid == "") /// { /// Basic.ShowMessage(2, "신용카드승인관련 터미널아이디가 등록되지 않았습니다.\n\r영업장별 POS 등록화면에서 터미널아이디를 셋팅하세요"); /// goto _Close; /// /// } /// /// //프린텨 설정여부를 리턴받는다. 해당 변수가 false 일때는 영수출력을 하지 않는다. /// IsPrint = CheckPrint.IsPrintSetting(CheckPrint.ProjectType.GOLF , ref IsSkip); /// /// _Close: /// if(!IsSkip) //영수증프린터가 설정안되어 진행하지 않는다고 하면 화면을 종료한다. /// { /// try /// { /// //폼로드 블럭이기때문에 폼 종료시 에러가난다. /// this.Close(); /// } /// catch /// { /// /// } /// } /// } /// catch (Exception ex) /// { /// /// } ///} /// </code> /// </example> /// <remarks> /// 프린터를 체크하는 모듈을 페이지 마다 설정하지 않기위해서 체크 클레스를 만들어 사용한다. /// 만약 해당 업무의 프린터 구분이 틀려질 경우 분개하여 사용한다. /// </remarks> public static bool IsPrintSetting(ProjectType type, ref bool IsSkip) { try { //프린터 셋팅여부 bool IsSetting = false; PrintMode mode = PrintMode.NONE; string tsp800 = ""; ComPortPrintStyle comstyle = ComPortPrintStyle.NONE; string BaundRate = ""; string ComPort = ""; string DataBit = ""; switch (type) { case ProjectType.GOLF: mode = Parm.CurrentUserInformation.golfTask.PrintMode; tsp800 = Parm.CurrentUserInformation.golfTask.TSP800; comstyle = Parm.CurrentUserInformation.golfTask.SerialPrintStyle; BaundRate = Parm.CurrentUserInformation.golfTask.SerialPrintInfo.BaundRate; ComPort = Parm.CurrentUserInformation.golfTask.SerialPrintInfo.ComPort; DataBit = Parm.CurrentUserInformation.golfTask.SerialPrintInfo.DataBit; break; case ProjectType.ROOM: mode = Parm.CurrentUserInformation.roomTask.gsPrintMode; tsp800 = Parm.CurrentUserInformation.roomTask.TSP800; comstyle = Parm.CurrentUserInformation.roomTask.SerialPrintStyle; BaundRate = Parm.CurrentUserInformation.roomTask.SerialPrintInfo.BaundRate; ComPort = Parm.CurrentUserInformation.roomTask.SerialPrintInfo.ComPort; DataBit = Parm.CurrentUserInformation.roomTask.SerialPrintInfo.DataBit; break; } if (mode == PrintMode.NONE) { if (Basic.ShowMessageQuestion("영수증프린터가 설정되어 있지 않습니다.\n\r영수증 출력이 불가 합니다.\n\n계속 하시겠습니까?") == DialogResult.Yes) { IsSkip = true; } } else if (mode == PrintMode.DRIVER && tsp800 == "") { if (Basic.ShowMessageQuestion("영수증프린터는 드라이버모드로 설정되어 있지만 프린터는 선택되지 않았습니다.\n\r영수증 출력이 불가 합니다.\n\n계속 하시겠습니까?") == DialogResult.Yes) { IsSkip = true; } } else if (mode == PrintMode.SERIALPORT && comstyle == ComPortPrintStyle.NONE) { if (Basic.ShowMessageQuestion("영수증프린터는 시리얼모드로 설정되어 있지만 프린터는 타입은 설정되어 있지 않습니다.\n\r승인/취소시 영수증 출력이 불가 합니다.\n\n계속 하시겠습니까?") == DialogResult.Yes) { IsSkip = true; } } else if (mode == PrintMode.SERIALPORT && (BaundRate == "" || ComPort == "" || DataBit == "")) { if (Basic.ShowMessageQuestion("영수증프린터는 시리얼모드로 설정되어 있지만 상세 설정이 없는것이 있습니다.\n\r승인/취소시 영수증 출력이 불가 합니다.\n\n계속 하시겠습니까?") == DialogResult.Yes) { IsSkip = true; } } else { IsSetting = true; IsSkip = true; } return(IsSetting); } catch (Exception ex) { throw ex; } }
/// <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); } }
/// <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); } }
public Bill_Print(ComPortPrintStyle stylePrint) { PrintType = stylePrint; }