spc-kiosk-pb/Service/AsvCampaign/frmInputDataMin.cs
2019-06-16 14:12:09 +09:00

194 lines
7.3 KiB
C#

using System;
using System.Collections;
using System.Windows.Forms;
using Cosmos.UserFrame;
using Cosmos.BaseFrame;
using Cosmos.ServiceProvider;
using Cosmos.Common;
using Cosmos.CommonManager;
namespace Cosmos.Service
{
public partial class frmInputDataMin : Form
{
#region
private StateServer StateObject = (StateServer)StateServer.GetInstance(); // StateObject : StateServer Object (객체)
private PosStatus m_cPosStatus = new PosStatus(); // 기본정보 참조
private string m_sPosMenuKeyIn;
public string PosMenuKeyIn { set { m_sPosMenuKeyIn = value; } get { return m_sPosMenuKeyIn; } }
private string m_sPosInPutData;
public string PosInPutData { set { m_sPosInPutData = value; } get { return m_sPosInPutData; } }
#endregion
#region &
public frmInputDataMin()
{
InitializeComponent();
base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw, true);
//this.UpdateStyles();
m_cPosStatus = (PosStatus)StateObject.POS;
}
/// <summary>
/// 폼로드
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void frmInputDataMin_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();
txtInPutData.Select();
}
/// <summary>
/// 폼 클로즈
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void frmInputDataMin_FormClosing(object sender, FormClosingEventArgs e)
{
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);
picBack.Image = ImageManager.GetImage(Cosmos.BaseFrame.BaseCom.NxImgPath, ImageManager.POP_SIZE_MIN);
btnExit.Image = ImageManager.GetImage(BaseCom.NxImgPath, ImageManager.BTN_CLOSE);
if (btnExit.Image != null) btnExit.Text = "";
padInPut.ThemeColor = m_cPosStatus.ScnMst.ThemeColor;
padInPut.ClearBtnText = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0817);
if (PosMenuKeyIn == "QTY") // 수량 입력
{
lblTitle.Text = MessageManager.GetLabelMessage(POS_MESSAGE.LABEL.MSG_0017);
lblMsg.Text = MessageManager.GetErrorMessage(POS_MESSAGE.ERROR.MSG_0232);
padInPut.BtnDotEnable = true;
txtInPutData.InputType = UI.InputType.Digit;
txtInPutData.MaxLength = 5;
}
txtInPutData.Value = "";
}
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
#region Control Event
/// <summary>
/// 입력박스 이벤트
/// </summary>
/// <param name="sender"></param>
/// <param name="sFuncValue"></param>
private void txtEditBox_EditBoxKeyDownEvent(object sender, string sFuncValue)
{
try
{
if (sFuncValue == PosKey.MENU_KEY.ENTER)
{
m_sPosInPutData = txtInPutData.Value;
this.DialogResult = DialogResult.OK;
this.Close();
}
else if (sFuncValue == PosKey.MENU_KEY.CLEAR)
{
if (((Cosmos.UI.CsmPosEditBox)sender).ReadOnly == false) ((Cosmos.UI.CsmPosEditBox)sender).Text = "";
}
else if (sFuncValue == PosKey.MENU_KEY.ESC_PREVIOUS)
{
m_sPosInPutData = "";
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 btnExit_Click(object sender, EventArgs e)
{
m_sPosInPutData = "";
this.DialogResult = DialogResult.Cancel;
this.Close();
}
/// <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);
}
}
/// <summary>
/// 소수점 처리
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void EditBoxTextChangedEvnet(object sender, EventArgs e)
{
try
{
//if (padInPut.BtnDotEnable == true)
//{
// string stmp = ((Cosmos.UI.CsmPosEditBox)sender).Value;
// if (stmp.IndexOf(".") != -1)
// ((Cosmos.UI.CsmPosEditBox)sender).Value = Math.Truncate(CmUtil.DoubleParse(stmp)).ToString();
//}
}
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
}
}