spc-kiosk-pb/Window/WinBasic/frmSchReturnCompany.cs
2019-06-16 14:12:09 +09:00

641 lines
34 KiB
C#

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 frmSchReturnCompany : 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_cSchReturnCompany = null; // 본사반품조회
private IDataSearch m_cDataSearch = null;
private ArrayList m_cSchData = null; // 조회/출력 정보
private DataTable m_dtItemInit; // 조회 데이터 리스트
private bool bNotDoubleClik = false; // 더블 클릭 방지용
#endregion
#region &
public frmSchReturnCompany()
{
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_cSchReturnCompany = (IDataServiceUs)sManager.InitServiceInstance(ServiceLists.BSV_BASIC.DLL, ServiceLists.BSV_BASIC.SCH_RETURN_COMPANY); // 본사방품내역조회
m_cDataSearch = (IDataSearch)sManager.InitServiceInstance(ServiceLists.BSV_ADMIN.DLL, ServiceLists.BSV_ADMIN.DATASEARCH);
}
private void frmSchReturnCompay_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 frmSchReturnCompay_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);
// 본사 반품 내역 조회
GetReturnCompanyList();
}
#endregion &
#region
/// <summary>
/// 폼 컨트롤 초기화
/// </summary>
private void InitControl()
{
try
{
if (m_cPosStatus.Sale.ScreenSizeUser == 1024)
{
// 이미지 로딩 처리
#region
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, 16);
FormManager.SetControlSize(this.btnExit, 965, 1, 58, 50, 20);
FormManager.SetControlSize(this.txtPrtData, 686, 123, 328, 555);
FormManager.SetControlSize(this.vScrollbar, 981, 124, 30, 555);
FormManager.SetControlSize(this.label3, 686, 122, 325, 2);
FormManager.SetControlSize(this.label01, 16, 67, 337, 2);
FormManager.SetControlSize(this.lblSearchDate, 16, 68, 122, 40);
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.btnDate, 311, 74, 26, 26);
FormManager.SetControlSize(this.txtDate, 153, 74, 157, 26);
FormManager.SetControlSize(this.lblBox1, 137, 68, 216, 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);
#endregion
}
else
{
// 이미지 로딩 처리
#region
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, 751, 124, 30, 453);
FormManager.SetControlSize(this.label3, 456, 122, 325, 2);
FormManager.SetControlSize(this.label01, 22, 67, 328, 2);
FormManager.SetControlSize(this.lblSearchDate, 22, 68, 122, 40);
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.btnDate, 308, 74, 26, 26);
FormManager.SetControlSize(this.txtDate, 159, 74, 148, 26);
FormManager.SetControlSize(this.lblBox1, 143, 68, 207, 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);
#endregion
}
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 = "";
btnDate.Image = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.ICON_DATE_BASIC);
if (btnDate.Image != null) btnDate.Text = "";
txtPrtData.Font = new Font(m_cPosStatus.Base.FONT_FIX, 10, txtPrtData.Font.Style);
vScrollbar.Attach(txtPrtData);
lblTitle.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0443);
//2017.11.27;버튼명 다국어 처리;girak.kim;Start
lblSearchDate.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0354);
btnSearch.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0004);
btnPrint.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0257);
//2017.11.27;버튼명 다국어 처리;girak.kim;End
txtDate.InputTypeFormat = m_cPosStatus.Global.m_stCultureMaster.strDatePattern;
txtDate.Text = m_cPosStatus.Global.DateToCulture(System.DateTime.Now.ToString("yyyyMMdd"));
txtPrtData.Text = "";
//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);
}
}
/// <summary>
/// 본사반품 조회에 대한 DataGridView 초기화
/// </summary>
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, 0, 2, 0 }); //컬럼 정렬 0:왼쪽, 1:가운데, 2:오른쪽
if (m_cPosStatus.Sale.ScreenSizeUser == 1024)
{
dgvData.CsmGridColumnHeadersHeight = 38; //DataGridView 자체의 컬럼 헤더 높이
dgvData.CsmGridRowsHeight = 39;
dgvData.CsmGridShowPageRowsCount = 12; //그리드의 한 화면에 보이는 로우수
dgvData.CsmGridSetColumnWidth(new int[] { 50, 215, 391, 0 }); //컬럼넓이 지정(656)
}
else
{
dgvData.CsmGridColumnHeadersHeight = 34; //DataGridView 자체의 컬럼 헤더 높이
dgvData.CsmGridRowsHeight = 37;
dgvData.CsmGridShowPageRowsCount = 10; //그리드의 한 화면에 보이는 로우수
dgvData.CsmGridSetColumnWidth(new int[] { 50, 175, 195, 0 }); //컬럼넓이 지정(420)
}
//각 컬럼별 이름 지정
dgvData.CsmGridColumnName(0, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0014));
dgvData.CsmGridColumnName(1, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0872));
dgvData.CsmGridColumnName(2, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0019));
dgvData.CsmGridColumnName(3, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0872));
//그리드 초기화 테이블
m_dtItemInit = new DataTable("INIT");
m_dtItemInit.Columns.Add(new DataColumn("NO", typeof(string)));
m_dtItemInit.Columns.Add(new DataColumn("RETURN_NM", typeof(string)));
m_dtItemInit.Columns.Add(new DataColumn("TOT_AMOUNT", typeof(string)));
m_dtItemInit.Columns.Add(new DataColumn("RETURN_CODE", 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 btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
/// <summary>
/// 조회 그리드 업/다운 클릭 이벤트
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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 = "";
GetReturnCompanyList();
}
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_cSchReturnCompany.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);
}
}
#endregion Control Event
#region User Method
/// <summary>
/// 계정선택 DataGridView와 Data 연결
/// </summary>
private void GetReturnCompanyList()
{
string sRetData = null;
string[] sCol = null;
string[] sHeaderRow = null;
string[] sDetailRow = null;
try
{
string sDate = m_cPosStatus.Global.CultureToDate(txtDate.Text);
m_dtItemInit.Clear();
// 본사반품내역조회 리스트
sRetData = (string)m_cSchReturnCompany.GetData(new string[] { "1", sDate });
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[1]);
dgvData.CsmGridColumnName(2, sHeaderRow[2]);
dgvData.CsmGridColumnName(3, sHeaderRow[0]);
// 조회 데이터 설정
// 헤더 이상의 값이 있을때 화면 설정
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["SALE_DT"] = m_cPosStatus.Global.DateToCulture(sDetailRow[0]);
drNewRow["RETURN_NM"] = (sDetailRow[1]);
drNewRow["TOT_AMOUNT"] = m_cPosStatus.Global.NumericTOCurrency(m_cDataService.DoubleParse(sDetailRow[2]));
drNewRow["RETURN_CODE"] = sDetailRow[0];
m_dtItemInit.Rows.Add(drNewRow);
}
dgvData.CsmGridDataSource = m_dtItemInit;
dgvData.CsmGridSelectRow(0);
// 상세조회
//GetReturnCompanyDetail(dgvData.CsmGridGetCell(dgvData.CsmGridSelectedRowIndex, 1));
}
}
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);
}
}
/// <summary>
/// 계정선택 DataGridView와 Data 연결
/// </summary>
private void GetReturnCompanyDetail(string sParamCode, string sParamNm)
{
try
{
if (dgvData.CsmGridRowsCount <= 0)
{
return;
}
if (dgvData.CsmGridSelectedRowIndex < 0)
{
return;
}
txtPrtData.Text = "";
// 1> 상세조회 2> 화면표시, 출력 3> 조회일자
string sDate = m_cPosStatus.Global.CultureToDate(txtDate.Text);
txtPrtData.Font = new Font(m_cPosStatus.Base.FONT_FIX, 10, txtPrtData.Font.Style);
m_cSchData = (ArrayList)m_cSchReturnCompany.GetData(new string[] { "2", sParamCode, sParamNm, sDate });
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();
//string sLine = "";
//for (int i = 1; i <= 42; i++) sLine += "-";
//if (m_cSchData == null) return;
//for (int nLoop = 0; nLoop < m_cSchData.Count; nLoop++)
//{
// Column.POS_REQ_SERVER_INTERFACE.DATA cSchData = (Column.POS_REQ_SERVER_INTERFACE.DATA) m_cSchData[nLoop];
// //txtPrtData.AppendText(CmUtil.MidH(m_cSchData[nLoop].ToString(), 5, CmUtil.LenH(m_cSchData[nLoop].ToString())).ToString() + PosConst.CRLF);
// if (nLoop == 0) txtPrtData.AppendText(sLine + PosConst.CRLF);
// txtPrtData.AppendText(CmUtil.RPadH(cSchData.FIELD_02, 10) + CmUtil.LPadH(cSchData.FIELD_03, 5) + CmUtil.LPadH(cSchData.FIELD_04, 10) + CmUtil.LPadH(cSchData.FIELD_05, 7) + PosConst.CRLF);
// if (nLoop == 0) txtPrtData.AppendText(sLine + PosConst.CRLF);
//}
//if (txtPrtData.TextLength > 0) txtPrtData.AppendText(sLine + 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 btnDate_Click(object sender, EventArgs e)
{
try
{
string sDate = WinBasic.ShowForm(new string[] { FormManager.FORM_CALENDAR });
if (sDate != "") txtDate.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_Click(object sender, EventArgs e)
{
try
{
// 상세조회
if (dgvData.CsmGridRowsCount <= 1) return;
GetReturnCompanyDetail(dgvData.CsmGridGetCell(dgvData.CsmGridSelectedRowIndex, 3), dgvData.CsmGridGetCell(dgvData.CsmGridSelectedRowIndex, 1));
}
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_MouseClick(object sender, MouseEventArgs e)
{
}
private void dgvData_GridClickEvent(object sender, string rowIndex)
{
try
{
// 상세조회
if (dgvData.CsmGridRowsCount <= 0) return;
GetReturnCompanyDetail(dgvData.CsmGridGetCell(dgvData.CsmGridSelectedRowIndex, 3), dgvData.CsmGridGetCell(dgvData.CsmGridSelectedRowIndex, 1));
}
catch (Exception ex)
{
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", ex.Message);
}
}
#region
/// <summary>
/// 영수증 출력데이터 생성
/// </summary>
/// <param name="sPrtHead">출력형태</param>
/// <param name="sPrtFmt">출력포맷</param>
/// <param name="sData">Data</param>
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.RPadH(aData[1].ToString(), 12) + CmUtil.LPadH(aData[2].ToString(), 7) + CmUtil.LPadH(aData[3].ToString(), 11);
break;
case 3:
sPrtData = CmUtil.RPadH(aData[0].ToString(), 22) + CmUtil.LPadH(aData[1].ToString(), 7) + CmUtil.LPadH(aData[2].ToString(), 12);
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
}
}