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; } /// /// 폼로드 /// /// /// 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(); } /// /// 폼 클로즈 /// /// /// 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 폼 컨트롤 초기화 /// /// 폼 컨트롤 초기화 /// 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 /// /// 입력박스 이벤트 /// /// /// 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); } } /// /// 종료 /// /// /// private void btnExit_Click(object sender, EventArgs e) { m_sPosInPutData = ""; this.DialogResult = DialogResult.Cancel; this.Close(); } /// /// 입력박스 엔터 이벤트 /// /// /// 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); } } /// /// 소수점 처리 /// /// /// 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 } }