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

831 lines
38 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.UI;
using Cosmos.Common;
using Cosmos.CommonManager;
using Cosmos.ServiceProvider;
using Cosmos.BaseFrame;
using Cosmos.UserFrame;
namespace Cosmos.Win
{
public partial class frmAccRemoney : Form
{
#region
private SManager sManager = new SManager(); // 이 객체를 통해 업무 Service 호출
private StateServer StateObject = (StateServer)StateServer.GetInstance(); // StateObject : StateServer Object (객체)
private PosStatus m_cPosStatus = new PosStatus(); // 기본정보 참조
private IAccRemoney m_cAccRemoney = null; // 준비금 기능 처리 서비스
private IDataProcessUs m_cDataService = null;
private IDataCommonUs m_cDataCommon = null; // POS 공통함수 인터페이스
private ICashdrawerUs m_cCashDrawer = null;
private bool bNotDoubleClik = false; // 더블 클릭 방지용
private int TotalControlCount = 0;
private int MAX_CASH_COUNT = 0;
private Hashtable m_htLblControl;
private Hashtable m_htTxtControl;
private DataTable m_dtItemInit; // 조회 데이터 리스트
// 준비금 등록내역을 조회할 영업일자
private string m_sSearchInfo = "";
public string SearchInfo { set { m_sSearchInfo = value; } get { return m_sSearchInfo; } }
// 개점시 자동 닫힘 플래그
private string m_sAutoClose = "";
public string SetAutoClose { set { m_sAutoClose = value; } get { return m_sAutoClose; } }
#endregion
#region &
public frmAccRemoney()
{
InitializeComponent();
base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw, true);
//this.UpdateStyles();
m_cPosStatus = (PosStatus)StateObject.POS; // POS 기본정보
m_cAccRemoney = (IAccRemoney)sManager.InitServiceInstance(ServiceLists.BSV_OPEN_CLOSE.DLL, ServiceLists.BSV_OPEN_CLOSE.ACC_REMONEY);
m_cDataService = (IDataProcessUs)sManager.InitServiceInstance(ServiceLists.ASV_DATA_PROCESS.DLL, ServiceLists.ASV_DATA_PROCESS.DATA_SERVICE);
m_cDataCommon = (IDataCommonUs)sManager.InitServiceInstance(ServiceLists.ASV_DATA_PROCESS.DLL, ServiceLists.ASV_DATA_PROCESS.DATA_COMMON);
m_cCashDrawer = (ICashdrawerUs)sManager.InitServiceInstance(ServiceLists.AGENT_OLEDEVICE.DLL, ServiceLists.AGENT_OLEDEVICE.DEVICE_CASHDRAWER);
}
private void frmAccRemoney_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();
// 준비금 입력 내역 조회
GetAccInfo();
}
private void frmAccRemoney_FormClosing(object sender, FormClosingEventArgs e)
{
m_sAutoClose = "";
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
{
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 = "";
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);
//테마색상 적용!
padInPut.ThemeColor = m_cPosStatus.ScnMst.ThemeColor;
padInPut.ClearBtnText = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0817);
padInPut.SearchBtnText = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_1018);
btnSave.BackColor = CmUtil.GetColorToString(m_cPosStatus.ScnMst.ThemeColor);
// 라벨 이름 설정
lblTitle.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0085);
lblCashTotAmt01.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0085);
lblCashTotAmt02.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0085);
lblCashID00.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0240);
lblCashQty00.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0241);
lblCashAmt00.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0019);
lblSaleDate.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0242);
lblCashier.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0191);
// 버튼 이름 설정
btnSave.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0225);
btnPrt.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0257);
// 준비금 입력 담당자
txtCashier.Text = m_cPosStatus.Base.CashierName;
txtSaleDate.InputTypeFormat = m_cPosStatus.Global.m_stCultureMaster.strDatePattern;
txtSaleDate.Text = m_cPosStatus.Global.DateToCulture(m_cPosStatus.Base.SaleDate);
// 총 합계 초기화
//this.txtCashTotAmt01.Text = "0";
// 합계 기본 선택
//this.txtCashTotAmt01.Select();
// 준비금이 권종별 입력 옵션일 경우 표시함
if (PosMstManager.GetPosOption(POS_OPTION.OPT012) == "0")
{
this.panel1.Enabled = false;
// 굵은 실선을 없애고 얇은 실선으로 경계선을 대체
label05.Visible = false;
label25.Visible = true;
lblCashTotAmt01.Visible = true;
txtCashTotAmt01.Visible = true;
label02.Visible = true;
label24.Size = new Size(1, 120);
label22.Size = new Size(1, 117);
label23.Size = new Size(1, 120);
this.txtCashTotAmt01.Text = "0";
this.txtCashTotAmt01.Select();
// 총합 금액 입력시 조회 그리드를 늘려준다.
label17.Size = new Size(656, 1);
dgvData.Size = new Size(656, 560);
// 스크롤 버튼 위치를 재조정한다.
btnUp.Location = new Point(16, 630);
btnUp2.Location = new Point(180, 630);
btnDw.Location = new Point(344, 630);
btnDw2.Location = new Point(508, 630);
btnUp2.Visible = true;
btnDw2.Visible = true;
}
m_htLblControl = new Hashtable();
m_htTxtControl = new Hashtable();
// {1: 0:현금,1:합계}, {2:0:이름,1:수량,2:금액}
m_htLblControl.Add("0001", lblCashID01);
m_htLblControl.Add("0002", lblCashID02);
m_htLblControl.Add("0003", lblCashID03);
m_htLblControl.Add("0004", lblCashID04);
m_htLblControl.Add("0005", lblCashID05);
m_htLblControl.Add("0006", lblCashID06);
m_htLblControl.Add("0007", lblCashID07);
m_htLblControl.Add("0008", lblCashID08);
m_htLblControl.Add("0009", lblCashID09);
m_htLblControl.Add("0010", lblCashID10);
m_htLblControl.Add("0011", lblCashID11);
m_htLblControl.Add("0012", lblCashID12);
m_htLblControl.Add("0013", lblCashID13);
m_htLblControl.Add("0014", lblCashID14);
m_htLblControl.Add("0015", lblCashID15);
// 준비금 입력 텍스트 박스
m_htTxtControl.Add("0101", txtCashQty01);
m_htTxtControl.Add("0201", txtCashAmt01);
m_htTxtControl.Add("0102", txtCashQty02);
m_htTxtControl.Add("0202", txtCashAmt02);
m_htTxtControl.Add("0103", txtCashQty03);
m_htTxtControl.Add("0203", txtCashAmt03);
m_htTxtControl.Add("0104", txtCashQty04);
m_htTxtControl.Add("0204", txtCashAmt04);
m_htTxtControl.Add("0105", txtCashQty05);
m_htTxtControl.Add("0205", txtCashAmt05);
m_htTxtControl.Add("0106", txtCashQty06);
m_htTxtControl.Add("0206", txtCashAmt06);
m_htTxtControl.Add("0107", txtCashQty07);
m_htTxtControl.Add("0207", txtCashAmt07);
m_htTxtControl.Add("0108", txtCashQty08);
m_htTxtControl.Add("0208", txtCashAmt08);
m_htTxtControl.Add("0109", txtCashQty09);
m_htTxtControl.Add("0209", txtCashAmt09);
m_htTxtControl.Add("0110", txtCashQty10);
m_htTxtControl.Add("0210", txtCashAmt10);
m_htTxtControl.Add("0111", txtCashQty11);
m_htTxtControl.Add("0211", txtCashAmt11);
m_htTxtControl.Add("0112", txtCashQty12);
m_htTxtControl.Add("0212", txtCashAmt12);
m_htTxtControl.Add("0113", txtCashQty13);
m_htTxtControl.Add("0213", txtCashAmt13);
m_htTxtControl.Add("0114", txtCashQty14);
m_htTxtControl.Add("0214", txtCashAmt14);
m_htTxtControl.Add("0115", txtCashQty15);
m_htTxtControl.Add("0215", txtCashAmt15);
foreach (object obj in m_htLblControl.Values)
{
Cosmos.UI.CsmLabel LblCtl = (Cosmos.UI.CsmLabel)obj;
LblCtl.Text = "";
LblCtl.Tag = "";
LblCtl.Visible = false;
}
foreach (object obj in m_htTxtControl.Values)
{
Cosmos.UI.CsmPosEditBox TxtCtl = (Cosmos.UI.CsmPosEditBox)obj;
TxtCtl.Text = "0";
TxtCtl.Tag = "0";
TxtCtl.Enabled = false;
TxtCtl.Visible = false;
}
// 그리드 초기화
SetListColumn();
// 준비금 입력 권종 조회
GetCommonCode();
// 권종별 입력
panel1.Visible = true;
if (PosMstManager.GetPosOption(POS_OPTION.OPT012) == "0")
{
this.panel1.Visible = false;
this.panel1.Enabled = false;
}
else
{
this.txtCashTotAmt02.Text = "0";
this.txtCashQty01.Select();
}
//}
}
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.CsmGridColumnHeadersHeight = 40; //DataGridView 자체의 컬럼 헤더 높이
dgvData.CsmGridColumnHeadersFont = new Font(m_cPosStatus.Base.FONT, 12, FontStyle.Bold); //DataGridView 자체의 컬럼 헤더 폰트
dgvData.CsmGridRowsHeight = 40;
dgvData.CsmGridColumnCount = 4; //그리드의 컬럼수
dgvData.CsmGridShowPageRowsCount = 13; //그리드의 한 화면에 보이는 로우수
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; //그리드 선택 글자 컬러
if (PosMstManager.GetPosOption(POS_OPTION.OPT012) == "0")
{
dgvData.CsmGridSetColumnWidth(new int[] { 50, 240, 240, 126 }); //컬럼넓이 지정(656)
}
else
{
dgvData.CsmGridSetColumnWidth(new int[] { 30, 100, 100, 99 }); //컬럼넓이 지정(329)
}
dgvData.CsmGridAlignment(new int[] { 1, 0, 2, 1 }); //컬럼 정렬 0:왼쪽, 1:가운데, 2:오른쪽
//각 컬럼별 이름 지정
dgvData.CsmGridColumnName(0, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0014));
dgvData.CsmGridColumnName(1, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0191));
dgvData.CsmGridColumnName(2, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0085));
dgvData.CsmGridColumnName(3, MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0239));
//그리드 초기화 테이블
m_dtItemInit = new DataTable("INIT");
m_dtItemInit.Columns.Add(new DataColumn("NO", typeof(string)));
m_dtItemInit.Columns.Add(new DataColumn("CASHIER_NM", typeof(string)));
m_dtItemInit.Columns.Add(new DataColumn("REMONEY", typeof(string)));
m_dtItemInit.Columns.Add(new DataColumn("INPUT_TIME", 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);
}
}
/// <summary>
/// 계정선택 DataGridView와 Data 연결
/// </summary>
public void GetAccInfo()
{
try
{
DataTable dtData = new DataTable();
if (m_sSearchInfo == "")
{
m_sSearchInfo = m_cPosStatus.Base.SaleDate;
}
dtData = (DataTable)m_cAccRemoney.GetData(new string[] { m_sSearchInfo });
if (dtData != null && dtData.Rows.Count > 0)
{
foreach (DataRow dr in dtData.Rows)
{
dr["TOTSALE_AMT"] = m_cPosStatus.Global.NumericTOCurrency(m_cDataService.DoubleParse(dr["TOTSALE_AMT"].ToString()));
}
//그리드 적용!
dgvData.CsmGridDataSource = dtData;
dgvData.CsmGridSelectRow(0);
}
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);
}
}
#endregion
#region Control Event
#region
/// <summary>
/// 준비금 입력 창 닫기
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnExit_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
#endregion
#region
/// <summary>
/// 준비금 저장 진행
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnSave_Click(object sender, EventArgs e)
{
string sQty, sAmt;
int nTotQty = 0;
string sRet = UserCom.RST_ERR;
try
{
DataTable dtData = new DataTable();
dtData.Columns.Add(new DataColumn("DPST_WTHDR_CD", typeof(string)));
dtData.Columns.Add(new DataColumn("DPST_WTHDR_QTY", typeof(string)));
dtData.Columns.Add(new DataColumn("DPST_WTHDR_AMT", typeof(string)));
dtData.Columns.Add(new DataColumn("DPST_WTHDR_NM", typeof(string)));
// 준비금을 합계로 입력했을 경우
// 준비금이 권종별 입력 옵션일 경우 표시함
if (PosMstManager.GetPosOption(POS_OPTION.OPT012) != "0")
{
// 권종 입력시 준비금 저장
// 권종 금액 재계산
DisplayTotal();
for (int i = 1; i <= MAX_CASH_COUNT; i++)
{
string sSeq = string.Format("{0:00}", i);
Cosmos.UI.CsmLabel LblCtl = (Cosmos.UI.CsmLabel)m_htLblControl["00" + sSeq];
if (LblCtl.Tag.ToString() == "") continue;
Cosmos.UI.CsmPosEditBox txtQty = (Cosmos.UI.CsmPosEditBox)m_htTxtControl["01" + sSeq]; //수량
sQty = txtQty.Value;
if (sQty == "") sQty = "0";
nTotQty = nTotQty + CmUtil.IntParse(sQty);
Cosmos.UI.CsmPosEditBox txtAmt = (Cosmos.UI.CsmPosEditBox)m_htTxtControl["02" + sSeq]; //금액
sAmt = txtAmt.Value;
if (sAmt == "") sAmt = "0";
DataRow dr = dtData.NewRow();
dr["DPST_WTHDR_CD"] = LblCtl.Tag.ToString();
dr["DPST_WTHDR_NM"] = LblCtl.Text;
dr["DPST_WTHDR_QTY"] = sQty;
dr["DPST_WTHDR_AMT"] = sAmt;
dtData.Rows.Add(dr);
}
DataRow dr2 = dtData.NewRow();
dr2["DPST_WTHDR_CD"] = PosConst.FRM_ACC_REMONEY_CODE.TOTAL_REMONEY;
dr2["DPST_WTHDR_NM"] = lblCashTotAmt02.Text;
dr2["DPST_WTHDR_QTY"] = nTotQty;
dr2["DPST_WTHDR_AMT"] = txtCashTotAmt02.Text.Replace(m_cPosStatus.Global.m_stCultureMaster.strGroupingSymbol, "");
dtData.Rows.Add(dr2);
}
else
{
// 현금합계
DataRow dr = dtData.NewRow();
dr["DPST_WTHDR_CD"] = PosConst.FRM_ACC_REMONEY_CODE.TOTAL_REMONEY;
dr["DPST_WTHDR_NM"] = lblCashTotAmt01.Text;
dr["DPST_WTHDR_QTY"] = 0;
dr["DPST_WTHDR_AMT"] = txtCashTotAmt01.Text.Replace(m_cPosStatus.Global.m_stCultureMaster.strGroupingSymbol, "");
dtData.Rows.Add(dr);
}
// 저장 버튼 눌렀을 경우
// 입출금 유형, 입출금 코드, 입출금 금액, 입출금 명, 고객번호, 여유필드01, 여유필드02, 여유필드03, 여유필드04, 여유필드05
sRet = m_cAccRemoney.SetData(dtData);
if (sRet == UserCom.RST_OK)
{
m_cCashDrawer.OpenCashDrawer(); //돈통오픈
WinManager.ConfirmMessage(MessageManager.GetErrorMessage(POS_MESSAGE.ERROR.MSG_0178));
GetAccInfo();
if (m_sAutoClose != "")
{
this.DialogResult = DialogResult.OK;
this.Close();
}
}
else
{
WinManager.ErrorMessage(sRet);
}
}
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
private void btnPrt_Click(object sender, EventArgs e)
{
string sRet = UserCom.RST_ERR;
DataTable dtData = new DataTable();
try
{
if (dgvData.CsmGridRowsCount <= 0)
{
WinManager.ErrorMessage(POS_MESSAGE.ERROR.MSG_0413);
return;
}
dtData.Columns.Add(new DataColumn("No", typeof(string)));
dtData.Columns.Add(new DataColumn("CASHIER_NM", typeof(string)));
dtData.Columns.Add(new DataColumn("TOTSALE_AMT", typeof(string)));
dtData.Columns.Add(new DataColumn("PAY_TIME", typeof(string)));
for (int i = 0; i <= dgvData.CsmGridRowsCount - 1; i++)
{
DataRow dr = dtData.NewRow();
dr["No"] = dgvData.CsmGridGetCell(i, 0);
dr["CASHIER_NM"] = dgvData.CsmGridGetCell(i, 1);
dr["TOTSALE_AMT"] = dgvData.CsmGridGetCell(i, 2);
dr["PAY_TIME"] = dgvData.CsmGridGetCell(i, 3);
dtData.Rows.Add(dr);
}
sRet = m_cAccRemoney.AccRemoneyListPrt(dtData, m_cPosStatus.Base.SaleDate);
}
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
/// <summary>
/// 권종 수량 변경시 금액 재계산
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void txtCashQty_EditBoxTextChangedEvnet(object sender, EventArgs e)
{
DisplayTotal();
}
#endregion
#region
/// <summary>
/// 텍스트박스 키 입력 이벤트 처리
/// </summary>
/// <param name="sender"></param>
/// <param name="sFuncValue"></param>
private void txtEditBox_EditBoxKeyDownEvent(object sender, string sFuncValue)
{
try
{
string sTxtBoxName = ((Cosmos.UI.CsmPosEditBox)sender).Name;
if (sFuncValue == PosKey.MENU_KEY.ENTER)
{
MoveTxFocus(sTxtBoxName, "DOWN");
DisplayTotal();
}
else if (sFuncValue == PosKey.MENU_KEY.CLEAR)
{
// CLEAR 눌렀을 경우 뭘 해줘야 할까...
}
else if (sFuncValue == PosKey.MENU_KEY.ESC_PREVIOUS)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
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>
/// 텍스트박스 활성화 처리
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void txtEditBox_EnterEvent(object sender, EventArgs e)
{
try
{
padInPut.SetActiveControl = (Control)sender;
}
catch (Exception ex)
{
WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name,
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", ex.Message);
}
}
#endregion
#endregion Control Event
#region User Method
#region Method
/// <summary>
/// 매수 입력시 계산/총 등록액 계산
/// </summary>
private void DisplayTotal()
{
string sQty, sAmt;
double lTotQty = 0, lTotAmt = 0;
try
{
{
//현금시재 합계금액 표시
lTotQty = 0; lTotAmt = 0;
for (int i = 1; i <= MAX_CASH_COUNT; i++)
{
string sSeq = string.Format("{0:00}", i);
Cosmos.UI.CsmLabel LblCtl = (Cosmos.UI.CsmLabel)m_htLblControl["00" + sSeq];
if (LblCtl.Tag.ToString() == "") continue;
Cosmos.UI.CsmPosEditBox txtQty = (Cosmos.UI.CsmPosEditBox)m_htTxtControl["01" + sSeq]; //수량
Cosmos.UI.CsmPosEditBox txtAmt = (Cosmos.UI.CsmPosEditBox)m_htTxtControl["02" + sSeq]; //금액
//수량
sQty = txtQty.Value;
if (sQty == "") sQty = "0";
if (double.Parse(txtQty.Tag.ToString()) > 0) //권종 존재
{
txtAmt.Text = m_cPosStatus.Global.NumericTOCurrency(double.Parse(sQty) * double.Parse(txtQty.Tag.ToString()));
}
//금액
sAmt = txtAmt.Value;
if (sAmt == "") sAmt = "0";
lTotQty = CmUtil.DoubleAdd(lTotQty, double.Parse(sQty));
lTotAmt = CmUtil.DoubleAdd(lTotAmt, double.Parse(sAmt));
}
//txtCashTotAmt01.Text = m_cPosStatus.Global.NumericTOCurrency(lTotAmt);
txtCashTotAmt02.Text = m_cPosStatus.Global.NumericTOCurrency(lTotAmt);
}
}
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 Method
#region
/// <summary>
/// 포커스 이동
/// </summary>
/// <param name="sTxName"></param>
/// <param name="sUpDown"></param>
private void MoveTxFocus(string sTxName, string sUpDown)
{
int nTabIndex = 0;
try
{
foreach (object obj in m_htTxtControl.Values)
{
Cosmos.UI.CsmPosEditBox txtCtl = (Cosmos.UI.CsmPosEditBox)obj;
if (txtCtl.Name == sTxName)
{
nTabIndex = txtCtl.TabIndex;
break;
}
}
if (sUpDown == "DOWN")
nTabIndex++;
else
nTabIndex--;
foreach (object obj in m_htTxtControl.Values)
{
Cosmos.UI.CsmPosEditBox txtCtl = (Cosmos.UI.CsmPosEditBox)obj;
if (nTabIndex == txtCtl.TabIndex)
{
txtCtl.Focus();
break;
}
}
// 마지막 합계쪽에 Focus가 갔을 경우 거기서 Down 일 경우 저장 진행
if (sUpDown == "DOWN")
if (TotalControlCount == nTabIndex)
{
}
}
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
/// <summary>
/// 공통코드에 있는 권종 조회
/// </summary>
public void GetCommonCode()
{
try
{
int nTabIndex = 0;
{
//현금시재 조회
DataTable dtData = new DataTable();
dtData = m_cDataCommon.SeletCommonCode(PosConst.COMMON_CODE_GROUP.Z0004, "");
if (dtData != null && dtData.Rows.Count != 0)
{
foreach (DataRow dr in dtData.Rows)
{
string sSeq = string.Format("{0:00}", nTabIndex + 1);
//권종명 설정
Cosmos.UI.CsmLabel LblCtl = (Cosmos.UI.CsmLabel)m_htLblControl["00" + sSeq];
string sPassChk = dr[PosMst.MST_COMMON.DATA.CHAR_VAL_TITLE_VAL_02].ToString();
if (sPassChk != "1") continue;
LblCtl.Text = dr[PosMst.MST_COMMON.DATA.CD_NM].ToString();
LblCtl.Tag = dr[PosMst.MST_COMMON.DATA.CMM_CD].ToString();
LblCtl.Visible = true;
//수량 설정
Cosmos.UI.CsmPosEditBox txtQty = (Cosmos.UI.CsmPosEditBox)m_htTxtControl["01" + sSeq];
txtQty.Tag = dr[PosMst.MST_COMMON.DATA.CHAR_VAL_TITLE_VAL_01].ToString();
txtQty.Enabled = true;
txtQty.Visible = true;
txtQty.TabIndex = nTabIndex++;
//금액 설정
Cosmos.UI.CsmPosEditBox txtAmt = (Cosmos.UI.CsmPosEditBox)m_htTxtControl["02" + sSeq];
if (double.Parse(txtQty.Tag.ToString()) == 0)
{
txtAmt.Enabled = true;
txtAmt.TabIndex = nTabIndex++;
}
txtAmt.Visible = true;
}
}
}
MAX_CASH_COUNT = nTabIndex;
TotalControlCount = nTabIndex;
}
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 /
/// <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;
}
#endregion /
#endregion User Method
}
}