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

527 lines
28 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 frmSchShipment : Form
{
#region
private StateServer StateObject = (StateServer)StateServer.GetInstance(); // StateObject : StateServer Object (객체)
private SManager sManager = new SManager(); // 이 객체를 통해 업무 Service 호출
private PosStatus m_cPosStatus = new PosStatus(); // 기본정보 참조
private IDataServiceUs m_cShipment = null; // 출하/예정 내역 서비스
private IDataSearch m_cDataSearch = null;
private ArrayList m_cSchData = null; // 조회/출력 정보
private DataTable m_dtItemInit; // 조회 데이터 리스트
private bool bNotDoubleClik = false; // 더블 클릭 방지용
#endregion
#region &
public frmSchShipment()
{
InitializeComponent();
base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw, true);
//this.UpdateStyles();
m_cPosStatus = (PosStatus)StateObject.POS; // POS 기본정보
m_cShipment = (IDataServiceUs)sManager.InitServiceInstance(ServiceLists.BSV_BASIC.DLL, ServiceLists.BSV_BASIC.SCH_SHIPMENT); // 출하/예정 내역 서비스
m_cDataSearch = (IDataSearch)sManager.InitServiceInstance(ServiceLists.BSV_ADMIN.DLL, ServiceLists.BSV_ADMIN.DATASEARCH);
}
private void frmSchShipment_Load(object sender, EventArgs e)
{
// 콘트롤 초기화 처리
InitControl();
UserLog.WriteLogFile(UserCom.LOG_IOS, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", "");
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
string sDate = m_cPosStatus.Global.CultureToDate(txtDate.Text);
// 출하/예정 내역 조회
GetShipmentDetail(sDate);
}
private void frmSchShipment_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);
}
#endregion &
#region
/// <summary>
/// 폼 컨트롤 초기화
/// </summary>
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, 16);
FormManager.SetControlSize(this.btnExit, 965, 1, 58, 50, 20);
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, 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);
}
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, 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);
}
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, txtPrtData.Font.Size, txtPrtData.Font.Style);
vScrollbar.Attach(txtPrtData);
lblTitle.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0326);
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);
//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);
txtDate.InputTypeFormat = m_cPosStatus.Global.m_stCultureMaster.strDatePattern;
txtDate.Text = m_cPosStatus.Global.DateToCulture(System.DateTime.Now.ToString("yyyyMMdd"));
txtPrtData.Text = "";
// 그리드 설정
SetListColumn();
// 조회항목 설정
GetShipmentList();
}
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 = 2; //그리드의 컬럼수
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 }); //컬럼 정렬 0:왼쪽, 1:가운데, 2:오른쪽
if (m_cPosStatus.Sale.ScreenSizeUser == 1024)
{
dgvData.CsmGridColumnHeadersHeight = 38; //DataGridView 자체의 컬럼 헤더 높이
dgvData.CsmGridRowsHeight = 39;
dgvData.CsmGridShowPageRowsCount = 12; //그리드의 한 화면에 보이는 로우수
dgvData.CsmGridSetColumnWidth(new int[] { 56, 600 }); //컬럼넓이 지정(656)
}
else
{
dgvData.CsmGridColumnHeadersHeight = 34; //DataGridView 자체의 컬럼 헤더 높이
dgvData.CsmGridRowsHeight = 37;
dgvData.CsmGridShowPageRowsCount = 10; //그리드의 한 화면에 보이는 로우수
dgvData.CsmGridSetColumnWidth(new int[] { 50, 370 }); //컬럼넓이 지정(420)
}
//각 컬럼별 이름 지정
dgvData.CsmGridColumnName(0, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0014));
dgvData.CsmGridColumnName(1, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0500));
//그리드 초기화 테이블
m_dtItemInit = new DataTable("INIT");
m_dtItemInit.Columns.Add(new DataColumn("No", typeof(string)));
m_dtItemInit.Columns.Add(new DataColumn("Notice", 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
/// <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 = "";
string sDate = m_cPosStatus.Global.CultureToDate(txtDate.Text);
m_cSchData = (ArrayList)m_cShipment.GetData(new string[] { 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();
}
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_cShipment.SetData(m_cSchData);
}
catch (Exception ex)
{
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", ex.Message);
}
return;
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
#endregion Control Event
#region User Method
/// <summary>
/// 계정선택 DataGridView와 Data 연결
/// </summary>
private void GetShipmentList()
{
try
{
DataRow dr = m_dtItemInit.NewRow();
dr["No"] = "1";
dr["Notice"] = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0326);
m_dtItemInit.Rows.Add(dr);
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>
/// 출하/예정 내역 조회
/// </summary>
private void GetShipmentDetail(string sDateFrom)
{
try
{
txtPrtData.Text = "";
m_cSchData = (ArrayList)m_cShipment.GetData(new string[] { 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 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_GridClickEvent(object sender, string rowIndex)
{
txtPrtData.Text = "";
string sDate = m_cPosStatus.Global.CultureToDate(txtDate.Text);
// 출하/예정 내역 조회
GetShipmentDetail(sDate);
}
#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(), 14) + CmUtil.LPadH(aData[1].ToString(), 5) + CmUtil.RPadH(aData[2].ToString(), 5) + CmUtil.RPadH(aData[3].ToString(), 5) + CmUtil.RPadH(aData[4].ToString(), 13);
sPrtData = CmUtil.RPadH(aData[0].ToString(), 14) + CmUtil.LPadH(aData[1].ToString(), 5) + CmUtil.LPadH(aData[2].ToString(), 5) + CmUtil.LPadH(aData[3].ToString(), 5) + CmUtil.LPadH(aData[4].ToString(), 13);
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(), 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
}
}