using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Cosmos.BaseFrame; using Cosmos.UserFrame; using Cosmos.CommonManager; using Cosmos.ServiceProvider; using Cosmos.Common; namespace Cosmos.Win { public partial class frmSchEvt : Form { #region 변수 선언 private StateServer StateObject = (StateServer)StateServer.GetInstance(); // StateObject : StateServer Object (객체) private SManager sManager = new SManager(); // 이 객체를 통해 업무 Service 호출 private PosStatus m_cPosStatus = new PosStatus(); // 기본정보 참조 private IDataProcessUs m_cDataService = null; private IDataServiceUs m_cSchEvt = null; // 행사주문 취합내역 조회 인터페이스 private IDataSearch m_cDataSearch = null; private ArrayList m_cSchData = null; // 조회/출력 정보 private DataTable m_dtItemInit; // 조회 데이터 리스트 private bool bNotDoubleClik = false; // 더블 클릭 방지용 #endregion 변수 선언 #region 생성자 & 소멸자 public frmSchEvt() { InitializeComponent(); base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw, true); //this.UpdateStyles(); m_cPosStatus = (PosStatus)StateObject.POS; // POS 기본정보 m_cDataService = (IDataProcessUs)sManager.InitServiceInstance(ServiceLists.ASV_DATA_PROCESS.DLL, ServiceLists.ASV_DATA_PROCESS.DATA_SERVICE); m_cSchEvt = (IDataServiceUs)sManager.InitServiceInstance(ServiceLists.BSV_BASIC.DLL, ServiceLists.BSV_BASIC.SCH_EVT); // 행사주문 취합내역조회 인터페이스 m_cDataSearch = (IDataSearch)sManager.InitServiceInstance(ServiceLists.BSV_ADMIN.DLL, ServiceLists.BSV_ADMIN.DATASEARCH); } private void frmSchEvt_Load(object sender, EventArgs e) { UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", ""); // 콘트롤 초기화 처리 InitControl(); } private void frmSchEvt_FormClosing(object sender, FormClosingEventArgs e) { vScrollbar.Attach(null); UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", lblTitle.Text); } protected override void OnShown(EventArgs e) { base.OnShown(e); // 행사 주문 취합 내역 조회 GetEventOrderList(); } #endregion 생성자 & 소멸자 #region 폼 컨트롤 초기화 /// /// 폼 컨트롤 초기화 /// private void InitControl() { try { if (m_cPosStatus.Sale.ScreenSizeUser == 1024) { // 이미지 로딩 처리 picBack.Image = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.POP_FULL_SIZE); //this.Size = new Size(1024, 696); //this.Location = new Point(0, 50); FormManager.SetControlSize(picBack, 0, 0, 1024, 696); FormManager.SetControlSize(this, 0, 50, picBack.Size.Width, picBack.Size.Height); FormManager.SetControlSize(this.lblTitle, 16, 1, 950, 50); FormManager.SetControlSize(this.btnExit, 965, 1, 58, 50); FormManager.SetControlSize(this.txtPrtData, 686, 123, 322, 555); FormManager.SetControlSize(this.vScrollbar, 988, 124, 30, 555); FormManager.SetControlSize(this.label3, 686, 122, 332, 2); FormManager.SetControlSize(this.label01, 16, 67, 558, 2); FormManager.SetControlSize(this.lblSearchDate, 16, 68, 122, 40); FormManager.SetControlSize(this.label02, 345, 79, 21, 24); FormManager.SetControlSize(this.btnSearch, 806, 68, 100, 40); FormManager.SetControlSize(this.btnPrint, 908, 68, 100, 40); FormManager.SetControlSize(this.dgvData, 16, 123, 656, 508); FormManager.SetControlSize(this.btnDw2, 508, 630, 164, 48); FormManager.SetControlSize(this.btnDw, 344, 630, 164, 48); FormManager.SetControlSize(this.btnUp, 180, 630, 164, 48); FormManager.SetControlSize(this.btnUp2, 16, 630, 164, 48); FormManager.SetControlSize(this.label5, 16, 122, 656, 2); FormManager.SetControlSize(this.btnDateFrom, 311, 74, 26, 26); FormManager.SetControlSize(this.txtDateFrom, 153, 74, 157, 26); FormManager.SetControlSize(this.btnDateTo, 532, 74, 26, 26); FormManager.SetControlSize(this.txtDateTo, 374, 74, 157, 26); FormManager.SetControlSize(this.lblBox1, 137, 68, 437, 40); btnUp.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_UP1_BASIC); btnUp.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_UP1_PRESS); btnUp2.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_UP2_BASIC); btnUp2.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_UP2_PRESS); btnDw.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_DOWN1_BASIC); btnDw.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_DOWN1_PRESS); btnDw2.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_DOWN2_BASIC); btnDw2.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_DOWN2_PRESS); } else { // 이미지 로딩 처리 picBack.Image = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.POP_SIZE_800X600); FormManager.SetControlSize(picBack, 0, 0, 800, 600); FormManager.SetControlSize(this, 0, 0, picBack.Size.Width, picBack.Size.Height); FormManager.SetControlSize(this.lblTitle, 16, 1, 728, 50); FormManager.SetControlSize(this.btnExit, 741, 1, 58, 50); FormManager.SetControlSize(this.txtPrtData, 456, 123, 322, 453); FormManager.SetControlSize(this.vScrollbar, 758, 124, 30, 453); FormManager.SetControlSize(this.label3, 456, 122, 324, 2); FormManager.SetControlSize(this.label01, 22, 67, 540, 2); FormManager.SetControlSize(this.lblSearchDate, 22, 68, 122, 40); FormManager.SetControlSize(this.label02, 342, 79, 21, 24); FormManager.SetControlSize(this.btnSearch, 576, 68, 100, 40); FormManager.SetControlSize(this.btnPrint, 678, 68, 100, 40); FormManager.SetControlSize(this.dgvData, 22, 123, 420, 406); FormManager.SetControlSize(this.btnDw2, 337, 528, 105, 48); FormManager.SetControlSize(this.btnDw, 232, 528, 105, 48); FormManager.SetControlSize(this.btnUp, 127, 528, 105, 48); FormManager.SetControlSize(this.btnUp2, 22, 528, 105, 48); FormManager.SetControlSize(this.label5, 22, 122, 420, 2); FormManager.SetControlSize(this.btnDateFrom, 308, 74, 26, 26); FormManager.SetControlSize(this.txtDateFrom, 159, 74, 148, 26); FormManager.SetControlSize(this.btnDateTo, 520, 74, 26, 26); FormManager.SetControlSize(this.txtDateTo, 371, 74, 148, 26); FormManager.SetControlSize(this.lblBox1, 143, 68, 419, 40); btnUp.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_105X48_UP1_BASIC); btnUp.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_105X48_UP1_PRESS); btnUp2.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_105X48_UP2_BASIC); btnUp2.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_105X48_UP2_PRESS); btnDw.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_105X48_DOWN1_BASIC); btnDw.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_105X48_DOWN1_PRESS); btnDw2.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_105X48_DOWN2_BASIC); btnDw2.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_105X48_DOWN2_PRESS); } FormManager.SetFormAllControlFont(this, m_cPosStatus.Base.FONT); FormManager.SetTextBoxGlobalInfo(this, m_cPosStatus.Global.m_stCultureMaster.nGroupingDigits, m_cPosStatus.Global.m_stCultureMaster.strGroupingSymbol , m_cPosStatus.Global.m_stCultureMaster.nDecimalDigits, m_cPosStatus.Global.m_stCultureMaster.strDecimalSymbol); FormManager.MovePopUpForm(this, false, m_cPosStatus.Sale.ScreenSizeUser); //picBack.Image = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.POP_FULL_SIZE); btnExit.Image = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.BTN_CLOSE); if (btnExit.Image != null) btnExit.Text = ""; btnDateFrom.Image = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.ICON_DATE_BASIC); if (btnDateFrom.Image != null) btnDateFrom.Text = ""; btnDateTo.Image = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.ICON_DATE_BASIC); if (btnDateTo.Image != null) btnDateTo.Text = ""; txtPrtData.Font = new Font(m_cPosStatus.Base.FONT_FIX, txtPrtData.Font.Size, txtPrtData.Font.Style); vScrollbar.Attach(txtPrtData); // 라벨 이름 설정 lblTitle.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0382); //2017.12.20;다국어 처리;girak.kim; Start lblSearchDate.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0408); btnSearch.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0004); btnPrint.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0257); //2017.12.20;다국어 처리;girak.kim; End txtDateFrom.InputTypeFormat = m_cPosStatus.Global.m_stCultureMaster.strDatePattern; txtDateFrom.Text = m_cPosStatus.Global.DateToCulture(System.DateTime.Now.ToString("yyyyMMdd")); txtDateTo.InputTypeFormat = m_cPosStatus.Global.m_stCultureMaster.strDatePattern; txtDateTo.Text = m_cPosStatus.Global.DateToCulture(System.DateTime.Now.ToString("yyyyMMdd")); txtPrtData.Text = ""; dgvData.CsmGridClear(); //btnUp.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_UP1_BASIC); //btnUp.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_UP1_PRESS); //btnUp2.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_UP2_BASIC); //btnUp2.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_UP2_PRESS); //btnDw.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_DOWN1_BASIC); //btnDw.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_DOWN1_PRESS); //btnDw2.DefaultImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_DOWN2_BASIC); //btnDw2.ClickImage = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.NAVIBTN_164X48_DOWN2_PRESS); SetListColumn(); } catch (Exception ex) { WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", ex.Message); } } /// /// 행사 주문 취합 내역에 대한 DataGridView 초기화 /// private void SetListColumn() { try { // 행사 주문 취합 내역 리스트 정보 dgvData.CsmGridColumnHeadersVisible = true; //DataGridView 자체의 컬럼 헤더 Visible 여부 dgvData.CsmGridColumnHeadersFont = new Font(m_cPosStatus.Base.FONT, 12, FontStyle.Bold); //DataGridView 자체의 컬럼 헤더 폰트 dgvData.CsmGridColumnCount = 4; //그리드의 컬럼수 dgvData.CsmGridSetHeaderBackColor(236, 238, 239); //그리드 헤더 배경색 dgvData.CsmGridDefaultRowBackColor = Color.FromArgb(255, 255, 255); //그리드 홀수(Default)행의 배경색 지정 dgvData.CsmGridAlternateRowBackColor = Color.FromArgb(251, 253, 255); //그리드 짝수(Alternate)행의 배경색 지정 dgvData.CsmGridBackGroundColor = Color.FromArgb(251, 253, 255); //기본 백그라운드 컬러 dgvData.CsmGridHighlightColor = Color.FromArgb(255, 251, 211); //그리드 선택 백 컬러 dgvData.CsmGridHighlightTextColor = Color.Black; //그리드 선택 글자 컬러 dgvData.CsmGridAlignment(new int[] { 1, 1, 2, 2 }); //컬럼 정렬 0:왼쪽, 1:가운데, 2:오른쪽 if (m_cPosStatus.Sale.ScreenSizeUser == 1024) { dgvData.CsmGridColumnHeadersHeight = 38; //DataGridView 자체의 컬럼 헤더 높이 dgvData.CsmGridRowsHeight = 39; dgvData.CsmGridShowPageRowsCount = 12; //그리드의 한 화면에 보이는 로우수 dgvData.CsmGridSetColumnWidth(new int[] { 50, 130, 150, 326 }); //컬럼넓이 지정(656) } else { dgvData.CsmGridColumnHeadersHeight = 34; //DataGridView 자체의 컬럼 헤더 높이 dgvData.CsmGridRowsHeight = 37; dgvData.CsmGridShowPageRowsCount = 10; //그리드의 한 화면에 보이는 로우수 dgvData.CsmGridSetColumnWidth(new int[] { 50, 110, 120, 140 }); //컬럼넓이 지정(420) } //각 컬럼별 이름 지정 dgvData.CsmGridColumnName(0, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0014)); dgvData.CsmGridColumnName(1, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0436)); dgvData.CsmGridColumnName(2, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0017)); dgvData.CsmGridColumnName(3, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0019)); //그리드 초기화 테이블 m_dtItemInit = new DataTable("INIT"); m_dtItemInit.Columns.Add(new DataColumn("NO", typeof(string))); m_dtItemInit.Columns.Add(new DataColumn("ORDER_DT", typeof(string))); m_dtItemInit.Columns.Add(new DataColumn("PLU_CNT", typeof(string))); m_dtItemInit.Columns.Add(new DataColumn("TOT_AMOUNT", typeof(string))); m_dtItemInit.Clear(); } catch (Exception ex) { UserLog.WriteLogFile(UserCom.LOG_ERROR, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, // Project Name (프로젝트명) System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + // Class Name (Class Name (클래스명)) System.Reflection.MethodBase.GetCurrentMethod().Name + "()", // Function Name (Function Name (함수명)) ex.Message); } } #endregion 폼 컨트롤 초기화 #region Control Event /// /// 조회 그리드 업/다운 클릭 이벤트 /// /// /// private void btnSelProc_Click(object sender, EventArgs e) { try { if (bNotDoubleClik) return; bNotDoubleClik = true; if ((UI.CsmButton)sender == btnUp2) { dgvData.CsmGridScroll("PAGE UP"); } else if ((UI.CsmButton)sender == btnUp) { dgvData.CsmGridScroll("UP"); } else if ((UI.CsmButton)sender == btnDw) { dgvData.CsmGridScroll("DOWN"); } else if ((UI.CsmButton)sender == btnDw2) { dgvData.CsmGridScroll("PAGE DOWN"); } } catch (Exception ex) { WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", ex.Message); } bNotDoubleClik = false; } private void btnSearch_Click(object sender, EventArgs e) { txtPrtData.Text = ""; GetEventOrderList(); } private void btnPrint_Click(object sender, EventArgs e) { string sRet = UserCom.RST_ERR; try { if (txtPrtData.Text == "") { WinManager.ErrorMessage(MessageManager.GetErrorMessage(POS_MESSAGE.ERROR.MSG_0302)); return; } ArrayList aPrintData = new ArrayList(); // 상단 이미지 출력 if (PosMstManager.GetPosOption(POS_OPTION.OPT409) != "0") AddPrintData(PosConst.PRT_HDR.PRT_TBM, PosConst.PRT_FMT.F100, new string[] { "" }, ref aPrintData); // 상단 문구 출력 AddPrintData(PosConst.PRT_HDR.PRT_NOR, PosConst.PRT_FMT.F101, new string[] { MessageManager.GetPrintMessage(POS_MESSAGE.PRINT.MSG_0160) + m_cPosStatus.Mst.StorName }, ref aPrintData); AddPrintData(PosConst.PRT_HDR.PRT_NOR, PosConst.PRT_FMT.F101, new string[] { MessageManager.GetPrintMessage(POS_MESSAGE.PRINT.MSG_0161) + m_cPosStatus.Mst.StorAddr }, ref aPrintData); AddPrintData(PosConst.PRT_HDR.PRT_NOR, PosConst.PRT_FMT.F101, new string[] { MessageManager.GetPrintMessage(POS_MESSAGE.PRINT.MSG_0162) + m_cPosStatus.Mst.StorOwnName }, ref aPrintData); AddPrintData(PosConst.PRT_HDR.PRT_NOR, PosConst.PRT_FMT.F101, new string[] { MessageManager.GetPrintMessage(POS_MESSAGE.PRINT.MSG_0163) + m_cPosStatus.Mst.StorBizPsnNo + " (" + m_cPosStatus.Mst.StorTelNo + ")" }, ref aPrintData); AddPrintData(PosConst.PRT_HDR.PRT_NOR, PosConst.PRT_FMT.F101, new string[] { MessageManager.GetPrintMessage(POS_MESSAGE.PRINT.MSG_0164) + CmUtil.MidH(m_cPosStatus.Base.CashierName, 0, 12) + " POS NO :" + m_cPosStatus.Base.PosNo }, ref aPrintData); AddPrintData(PosConst.PRT_HDR.PRT_NOR, PosConst.PRT_FMT.F101, new string[] { MessageManager.GetPrintMessage(POS_MESSAGE.PRINT.MSG_0165) + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") }, ref aPrintData); AddPrintData(PosConst.PRT_HDR.PRT_NOR, PosConst.PRT_FMT.F101, new string[] { "-" }, ref aPrintData); // 공지사항 출력 aPrintData.AddRange(m_cSchData); // 하단 이미지 출력 if (PosMstManager.GetPosOption(POS_OPTION.OPT410) != "0") AddPrintData(PosConst.PRT_HDR.PRT_BBM, PosConst.PRT_FMT.F100, new string[] { "" }, ref aPrintData); // cut AddPrintData(PosConst.PRT_HDR.PRT_CUT, PosConst.PRT_FMT.F100, new string[] { " " }, ref aPrintData); if (aPrintData.Count == 0) return; bool bReturn = m_cDataSearch.PosDataPrint(aPrintData); if (bReturn == true) sRet = UserCom.RST_OK; //string bReturn = m_cSchEvt.SetData(m_cSchData); } catch (Exception ex) { UserLog.WriteLogFile(UserCom.LOG_ERROR, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, // Project Name (프로젝트명) System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + // Class Name (Class Name (클래스명)) System.Reflection.MethodBase.GetCurrentMethod().Name + "()", // Function Name (Function Name (함수명)) ex.Message); } } private void btnExit_Click(object sender, EventArgs e) { this.Close(); } #endregion Control Event #region User Method /// /// 계정선택 DataGridView와 Data 연결 /// private void GetEventOrderList() { string sRetData = null; string[] sCol = null; string[] sHeaderRow = null; string[] sDetailRow = null; try { dgvData.CsmGridClear(); m_dtItemInit.Clear(); string sDateFrom = m_cPosStatus.Global.CultureToDate(txtDateFrom.Text); string sDateTo = m_cPosStatus.Global.CultureToDate(txtDateTo.Text); // 행사주문취합내역조회 리스트 sRetData = (string)m_cSchEvt.GetData(new string[] { "1", sDateFrom, sDateTo }); if (sRetData != UserCom.RST_ERR) { if (sRetData != null && sRetData.Length > 0) { sCol = sRetData.Split(new string[] { "#~" }, StringSplitOptions.RemoveEmptyEntries); sHeaderRow = sCol[0].Split('|'); //각 컬럼별 이름 지정 dgvData.CsmGridColumnName(0, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0014)); dgvData.CsmGridColumnName(1, sHeaderRow[0]); dgvData.CsmGridColumnName(2, sHeaderRow[1]); dgvData.CsmGridColumnName(3, sHeaderRow[2]); // 조회 데이터 설정 // 헤더 이상의 값이 있을때 화면 설정 if (sCol.Count() > 1) { for (int i = 1; i < sCol.Count(); i++) { sDetailRow = sCol[i].Split('|'); DataRow drNewRow = m_dtItemInit.NewRow(); drNewRow["NO"] = Convert.ToString(i); drNewRow["ORDER_DT"] = m_cPosStatus.Global.DateToCulture(sDetailRow[0]); drNewRow["PLU_CNT"] = m_cPosStatus.Global.DateToCulture(sDetailRow[1]); drNewRow["TOT_AMOUNT"] = m_cPosStatus.Global.NumericTOCurrency(m_cDataService.DoubleParse(sDetailRow[2])); m_dtItemInit.Rows.Add(drNewRow); } dgvData.CsmGridDataSource = m_dtItemInit; dgvData.CsmGridSelectRow(0); // 상세조회 GetEventOrderDetail(dgvData.CsmGridGetCell(dgvData.CsmGridSelectedRowIndex, 1).Replace("-","")); } } else { //데이터 없음! dgvData.CsmGridDataSource = m_dtItemInit; } } else { //데이터 없음! dgvData.CsmGridDataSource = m_dtItemInit; } } catch (Exception ex) { UserLog.WriteLogFile(UserCom.LOG_ERROR, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, // Project Name (프로젝트명) System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + // Class Name (Class Name (클래스명)) System.Reflection.MethodBase.GetCurrentMethod().Name + "()", // Function Name (Function Name (함수명)) ex.Message); } } /// /// 계정선택 DataGridView와 Data 연결 /// private void GetEventOrderDetail(string sDateFrom) { try { if (dgvData.CsmGridRowsCount <= 0) { return; } if (dgvData.CsmGridSelectedRowIndex < 0) { return; } txtPrtData.Text = ""; // 1> 상세조회 2> 화면표시, 출력 3> 조회일자 m_cSchData = (ArrayList)m_cSchEvt.GetData(new string[] { "2", sDateFrom }); for (int nLoop = 0; nLoop < m_cSchData.Count; nLoop++) { txtPrtData.AppendText(CmUtil.MidH(m_cSchData[nLoop].ToString(), 5, CmUtil.LenH(m_cSchData[nLoop].ToString())).ToString() + PosConst.CRLF); } txtPrtData.Refresh(); } catch (Exception ex) { UserLog.WriteLogFile(UserCom.LOG_ERROR, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, // Project Name (프로젝트명) System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + // Class Name (Class Name (클래스명)) System.Reflection.MethodBase.GetCurrentMethod().Name + "()", // Function Name (Function Name (함수명)) ex.Message); } } #endregion User Method private void btnDateFrom_Click(object sender, EventArgs e) { try { string sDate = WinBasic.ShowForm(new string[] { FormManager.FORM_CALENDAR }); if (sDate != "") txtDateFrom.Text = m_cPosStatus.Global.DateToCulture(sDate); } catch (Exception ex) { WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", ex.Message); } } private void btnDateTo_Click(object sender, EventArgs e) { try { string sDate = WinBasic.ShowForm(new string[] { FormManager.FORM_CALENDAR }); if (sDate != "") txtDateTo.Text = m_cPosStatus.Global.DateToCulture(sDate); } catch (Exception ex) { WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", ex.Message); } } private void dgvData_GridClickEvent(object sender, string rowIndex) { GetEventOrderDetail(dgvData.CsmGridGetCell(dgvData.CsmGridSelectedRowIndex, 1).Replace("-", "")); } #region 영수증 출력데이터 생성 /// /// 영수증 출력데이터 생성 /// /// 출력형태 /// 출력포맷 /// Data private void AddPrintData(string sPrtHead, string sPrtFmt, string[] aData, ref ArrayList aPrintData) { try { string sPrtData = ""; if (sPrtFmt == PosConst.PRT_FMT.F100) // 선귿기 { for (int i = 1; i <= 42; i++) sPrtData += aData[0]; } else if (sPrtFmt == PosConst.PRT_FMT.F101) // 왼쪽정렬 { sPrtData = aData[0]; } else if (sPrtFmt == PosConst.PRT_FMT.F102) // 오른쪽 정렬 { sPrtData = CmUtil.LPadH(aData[0], 42); } else if (sPrtFmt == PosConst.PRT_FMT.F103) // 중앙정렬 { if (sPrtHead == PosConst.PRT_HDR.PRT_HOR || sPrtHead == PosConst.PRT_HDR.PRT_BIG) { if (CmUtil.LenH(aData[0]) <= 21) sPrtData = CmUtil.LPadH("", 10 - (CmUtil.LenH(aData[0]) / 2)) + aData[0]; } else { if (CmUtil.LenH(aData[0]) <= 42) sPrtData = CmUtil.LPadH("", 21 - (CmUtil.LenH(aData[0]) / 2)) + aData[0]; } } else { switch (aData.Length) { case 5: sPrtData = CmUtil.RPadH(aData[0].ToString(), 13) + CmUtil.LPadH(aData[1].ToString(), 5) + CmUtil.LPadH(aData[2].ToString(), 5) + CmUtil.RPadH(aData[3].ToString(), 5) + CmUtil.LPadH(aData[4].ToString(), 14); break; case 4: sPrtData = CmUtil.RPadH(aData[0].ToString(), 12) + CmUtil.LPadH(aData[1].ToString(), 9) + CmUtil.LPadH(aData[2].ToString(), 10) + CmUtil.LPadH(aData[3].ToString(), 11); break; case 3: sPrtData = CmUtil.RPadH(aData[0].ToString(), 23) + CmUtil.LPadH(aData[1].ToString(), 7) + CmUtil.LPadH(aData[2].ToString(), 11); break; default: sPrtData = aData[0].ToString(); break; } } aPrintData.Add(sPrtHead + sPrtData); } catch (Exception ex) { UserLog.WriteLogFile(UserCom.LOG_ERROR, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, // Project Name (프로젝트명) System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + // Class Name (Class Name (클래스명)) System.Reflection.MethodBase.GetCurrentMethod().Name + "()", // Function Name (Function Name (함수명)) ex.Message); } } #endregion } }