예제 #1
0
 private void rdoIncrease_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == '\r')
     {
         CtrlUtil.FocusControl(txtMasterNo);
     }
 }
예제 #2
0
        private void SetScreenMode(eScreenMode mode)
        {
            switch (mode)
            {
            case eScreenMode.ADD:
                CtrlUtil.EnabledControl(true, dtWorkResultDate, cboShiftCls);
                CtrlUtil.EnabledControl(true, txtItemCode, btnItemCode);
                CtrlUtil.EnabledControl(false, txtPartNo, txtCustomerName);
                CtrlUtil.EnabledControl(true, evoComboBox1, txtRemark);
                CtrlUtil.EnabledControl(true, txtLotNo, btnGenerate);
                CtrlUtil.EnabledControl(false, txtTotalQty);

                m_keyboardSpread.StartBind();

                shtView.OperationMode = OperationMode.Normal;

                CtrlUtil.FocusControl(dtWorkResultDate);
                CtrlUtil.SpreadSetColumnsLocked(shtView, false, (int)eColView.CHECKBOX);
                CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColView.PACK_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColView.LOT_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColView.EXTERNAL_LOT_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColView.ONHAND_QTY);

                tsbSaveAndNew.Enabled   = true;
                tsbSaveAndClose.Enabled = true;

                break;
            }

            m_screenMode = mode;
        }
예제 #3
0
        private void InitializeScreenMode()
        {
            if (String.IsNullOrEmpty(m_MasterNo))
            {
                // New mode.
                m_screenMode = eMode.ADD;
                CtrlUtil.EnabledControl(true, btnSearchMasterNo, txtPartNo, txtMasterNo, dtStartEffDate, numPrice, cboCurrency, txtRemark);
                CtrlUtil.EnabledControl(false, txtCustomerName, txtPartNo);

                LookupData();

                tsbSaveAndNew.Enabled   = true;
                tsbSaveAndClose.Enabled = true;

                CtrlUtil.FocusControl(txtMasterNo);
            }
            else
            {
                // Edit mode.
                m_screenMode = eMode.EDIT;
                CtrlUtil.EnabledControl(true, numPrice, txtRemark);
                CtrlUtil.EnabledControl(false, btnSearchMasterNo, txtPartNo, txtMasterNo, txtCustomerName, dtStartEffDate, txtPartNo, cboCurrency);

                tsbSaveAndNew.Enabled   = true;
                tsbSaveAndClose.Enabled = true;

                CtrlUtil.FocusControl(numPrice);
            }
        }
예제 #4
0
        public override void OnSaveAndNew()
        {
            fpView.StopCellEditing();
            if (m_bRowHasModified)
            { // ถ้า Row กำลังแก้ไขอยู่
                if (!ValidateRowSpread(shtView.ActiveRowIndex, false))
                {
                    return;
                }
            }
            // ต้องเรียกก่อน Save เสมอ  เพื่อ Commit ข้อมูลการแก้ไขล่าสุดบน Grid
            // ใช้ได้เฉพาะกับ Sheet ที่ผูก DataSource
            CtrlUtil.SpreadSheetRowEndEdit(shtView, shtView.ActiveRowIndex);
            RemoveRowUnused(shtView);

            if (txtNumberOfBox.Int <= 0)
            {
                txtNumberOfBox.Int = 1;
            }

            try
            {
                ValidateBeforeSave();

                MessageDialogResult dr = MessageDialog.ShowConfirmation(this, Message.LoadMessage(Messages.eConfirm.CFM9001.ToString()));
                if (dr == MessageDialogResult.Cancel)
                {
                    return;
                }
                if (dr == MessageDialogResult.Yes)
                {
                    SaveData();
                    SetScreenMode(eScreenMode.ADD);

                    CtrlUtil.FocusControl(txtMasterNo);
                    m_dialogResult = DialogResult.OK;
                }
            }
            catch (ValidateException err)
            {
                for (int i = 0; i < err.ErrorResults.Count; i++)
                {
                    MessageDialog.ShowBusiness(this, err.ErrorResults[i].Message);
                    err.ErrorResults[i].FocusOnControl();
                }
            }
            catch (BusinessException err)
            {
                MessageDialog.ShowBusiness(this, err.Error.Message);
                err.Error.FocusOnControl();
            }
            catch (Exception ex)
            {
                MessageDialog.ShowBusiness(this, ex.Message);
            }
        }
예제 #5
0
 private void TRN020_Shown(object sender, EventArgs e)
 {
     if (m_screenMode == Common.eScreenMode.ADD)
     {
         CtrlUtil.FocusControl(dtReceiveDate);
     }
     else
     {
         CtrlUtil.FocusControl(fpView);
     }
 }
예제 #6
0
 private void TRN120_Shown(object sender, EventArgs e)
 {
     if (m_screenMode == eScreenMode.ADD)
     {
         CtrlUtil.FocusControl(dtAdjustDate);
     }
     else
     {
         CtrlUtil.FocusControl(txtAdjustQty);
     }
 }
예제 #7
0
 private void txtAdjustWeight_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == '\r')
     {
         if (string.Empty.Equals(txtAdjustWeight.Text))
         {
             CtrlUtil.FocusControl(txtAdjustQty);
         }
         else
         {
             CtrlUtil.FocusControl(txtRemark);
         }
     }
 }
예제 #8
0
        private void ClearAllExceptDefault()
        {
            CtrlUtil.ClearControlData(txtInvoiceNo, txtPONo, txtRemark, cboSupplierCode);
            lblReceiveNo.Text = string.Empty;

            shtView.RowCount = 0;
            if (m_model.DATA_VIEW != null)
            {
                m_model.DATA_VIEW.Rows.Clear();
            }

            rdoReceive.Checked = true;

            CtrlUtil.FocusControl(txtInvoiceNo);
        }
예제 #9
0
        private void tsbCancel_Click(object sender, EventArgs e)
        {
            // Do you want to save?
            if (MessageDialog.ShowConfirmation(this, Message.LoadMessage(Messages.eConfirm.CFM9003.ToString()), MessageDialogButtons.YesNo) == MessageDialogResult.No)
            {
                return;
            }

            m_rootBOMNode.Nodes.Clear();
            m_rootBOMNode = new BOMNode();

            shtView.RowCount   = 0;
            shtView.DataSource = null;

            CtrlUtil.ClearControlData(txtItemCD, txtItemDesc);
            CtrlUtil.FocusControl(txtItemCD);

            UpdateUpDownButton();
        }
예제 #10
0
 protected void MAS051_ReigsterBOM_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(txtItemCode);
 }
예제 #11
0
 private void TRN080_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(txtMasterNo);
 }
예제 #12
0
 private void INV020_InventoryMovementInquiry_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(txtLocation);
 }
예제 #13
0
        public override void OnSaveAndNew()
        {
            MachineUIDM model = dmcMachine.SaveData(new MachineUIDM());

            try
            {
                #region
                MachineValidator validator = new MachineValidator();

                ErrorItem errorItem = null;
                errorItem = validator.CheckEmptyMachineNo(new NZString(txtMachineNo, txtMachineNo.Text));
                if (null != errorItem)
                {
                    ValidateException.ThrowErrorItem(errorItem);
                }

                errorItem = validator.CheckEmptyMachineType(new NZString(cboMachineType, cboMachineType.Text));
                if (null != errorItem)
                {
                    ValidateException.ThrowErrorItem(errorItem);
                }

                errorItem = validator.CheckEmptyProcess(new NZString(cboProcess, cboProcess.SelectedValue));
                if (null != errorItem)
                {
                    ValidateException.ThrowErrorItem(errorItem);
                }

                errorItem = validator.CheckEmptyMachineGroup(new NZString(cboMachineGroup, cboMachineGroup.Text));
                if (null != errorItem)
                {
                    ValidateException.ThrowErrorItem(errorItem);
                }

                errorItem = validator.CheckEmptyProject(new NZString(cboProject, cboProject.SelectedValue));
                if (null != errorItem)
                {
                    ValidateException.ThrowErrorItem(errorItem);
                }

                #endregion

                // Confirm to save.
                MessageDialogResult dr = MessageDialog.ShowConfirmation(this, new EVOFramework.Message(Messages.eConfirm.CFM9001.ToString()));
                if (dr == MessageDialogResult.Cancel || dr == MessageDialogResult.No)
                {
                    return;
                }

                if (eMode.ADD == m_screenMode)
                {
                    m_MachineController.SaveNew(model);
                }
                else
                {
                    m_MachineController.SaveUpdate(model);
                }

                m_dummyDialogResult = DialogResult.OK;

                //ClearControls();

                m_MachineNo = null;

                LookupData();
                InitializeScreenMode();

                CtrlUtil.FocusControl(txtMachineNo);
                MessageDialog.ShowInformation(this, null, new EVOFramework.Message(Messages.eInformation.INF9003.ToString()).MessageDescription);
            }
            catch (BusinessException err)
            {
                MessageDialog.ShowBusiness(this, err.Error.Message);
                err.Error.FocusOnControl();
            }
            catch (ValidateException err)
            {
                MessageDialog.ShowBusiness(this, err.ErrorResults[0].Message);
                err.ErrorResults[0].FocusOnControl();
            }
        }
예제 #14
0
 private void MAS010_LocationList_Shown(object sender, System.EventArgs e)
 {
     PermissionControl();
     CtrlUtil.FocusControl(txtFind);
 }
예제 #15
0
 private void MAS030_ItemList_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(txtSearch);
 }
예제 #16
0
 private void INV070_InventorySummary_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(txtFilter);
 }
예제 #17
0
 private void CustomerFindDialog_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(txtSearch);
 }
예제 #18
0
 private void MAS052_ChangeItem_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(txtUpperQty);
 }
예제 #19
0
 private void TRN102_OrderSelection_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(dtPeriodBegin);
 }
예제 #20
0
        public override void OnSaveAndNew()
        {
            base.OnSaveAndNew();

            try
            {
                UpdateOnhandQtyText();


                ValidateBeforeSave();

                MessageDialogResult dr = MessageDialog.ShowConfirmation(this, Message.LoadMessage(Messages.eConfirm.CFM9001.ToString()));
                if (dr == MessageDialogResult.Cancel || dr == MessageDialogResult.No)
                {
                    return;
                }

                if (dr == MessageDialogResult.Yes)
                {
                    AdjustmentEntryUIDM model = dmcAdjust.SaveData(new AdjustmentEntryUIDM());

                    if (m_screenMode == eScreenMode.ADD)
                    {
                        m_controller.SaveAdd(model);
                        ClearAllExceptDefault();
                    }
                    else
                    {
                        m_controller.SaveEdit(m_editTransactionID, model);
                        ClearAll();
                    }


                    MessageDialog.ShowInformation(this, null, new Message(Messages.eInformation.INF9003.ToString()).MessageDescription);
                }

                m_editTransactionID = null;
                SetScreenMode(eScreenMode.ADD);

                m_isSelected = true;



                CtrlUtil.FocusControl(dtAdjustDate);
            }
            catch (ValidateException err)
            {
                MessageDialog.ShowBusiness(this, err.ErrorResults[0].Message);
                err.ErrorResults[0].FocusOnControl();
            }
            catch (BusinessException err)
            {
                MessageDialog.ShowBusiness(this, err.Error.Message);
                err.Error.FocusOnControl();
            }
            catch (Exception err)
            {
                MessageDialog.ShowBusiness(this, null, err.Message);
            }
            finally
            {
                if (Common.CurrentDatabase.DBConnectionState == ConnectionState.Open)
                {
                    Common.CurrentDatabase.Close();
                }
            }
        }
예제 #21
0
 private void TRN070_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(dtPeriodBegin);
 }
예제 #22
0
 private void TRN010_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(txtSearch);
 }
예제 #23
0
 private void MAS050_BOMSetup_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(txtItemCD);
     UpdateUpDownButton();
     PermissionControl();
 }
예제 #24
0
 private void TRN271_DeliveryOrderSelection_Shown(object sender, EventArgs e)
 {
     CtrlUtil.FocusControl(txtMasterNo);
 }
예제 #25
0
        public override void OnSaveAndNew()
        {
            DealingUIDM model     = dmcLocation.SaveData(new DealingUIDM());
            string      ADDRESS01 = txtAddr1Address1.Text + System.Environment.NewLine + txtAddr1Address2.Text + System.Environment.NewLine + txtAddr1Address3.Text;

            model.ADDRESS1 = ADDRESS01.ToNZString();
            string ADDRESS02 = txtAddr2Address1.Text + System.Environment.NewLine + txtAddr2Address2.Text + System.Environment.NewLine + txtAddr2Address3.Text;

            model.ADDRESS2 = ADDRESS02.ToNZString();
            string ADDRESS03 = txtAddr3Address1.Text + System.Environment.NewLine + txtAddr3Address2.Text + System.Environment.NewLine + txtAddr3Address3.Text;

            model.ADDRESS3 = ADDRESS03.ToNZString();
            try
            {
                DealingValidator validator = new DealingValidator();
                // Mandatory check
                #region
                ErrorItem errorItem = null;
                errorItem = validator.CheckEmptyLocationCode(new NZString(txtDealingCode, txtDealingCode.Text));
                if (null != errorItem)
                {
                    ValidateException.ThrowErrorItem(errorItem);
                }

                errorItem = validator.CheckEmptyLocationName(new NZString(txtDealingName, txtDealingName.Text));
                if (null != errorItem)
                {
                    ValidateException.ThrowErrorItem(errorItem);
                }

                errorItem = validator.CheckEmptyLocationType(new NZString(cboDealingType, cboDealingType.SelectedValue));
                if (null != errorItem)
                {
                    ValidateException.ThrowErrorItem(errorItem);
                }

                //errorItem = validator.CheckEmptyTermOfPayment(new NZString(cboTermOfPayment, cboTermOfPayment.SelectedValue));
                //if (null != errorItem) ValidateException.ThrowErrorItem(errorItem);

                errorItem = validator.CheckInvoicePattern(new NZString(cboInvoicePattern, cboInvoicePattern.SelectedValue), new NZString(cboDealingType, cboDealingType.SelectedValue));
                if (null != errorItem)
                {
                    ValidateException.ThrowErrorItem(errorItem);
                }
                #endregion

                // Confirm to save.
                MessageDialogResult dr = MessageDialog.ShowConfirmation(this, new EVOFramework.Message(Messages.eConfirm.CFM9001.ToString()));
                if (dr == MessageDialogResult.Cancel || dr == MessageDialogResult.No)
                {
                    return;
                }

                //if (dr == MessageDialogResult.No)
                //{
                //    DialogResult = m_dummyDialogResult;
                //    return;
                //}

                if (eMode.ADD == m_screenMode)
                {
                    m_locationController.SaveNew(model);
                }
                else
                {
                    m_locationController.SaveUpdate(model);
                }

                m_dummyDialogResult = DialogResult.OK;

                ClearControls();


                m_locationCode = null;
                InitializeScreenMode();

                CtrlUtil.FocusControl(txtDealingCode);
                MessageDialog.ShowInformation(this, null, new EVOFramework.Message(Messages.eInformation.INF9003.ToString()).MessageDescription);
            }
            catch (BusinessException err)
            {
                MessageDialog.ShowBusiness(this, err.Error.Message);
                err.Error.FocusOnControl();
            }
            catch (ValidateException err)
            {
                MessageDialog.ShowBusiness(this, err.ErrorResults[0].Message);
                err.ErrorResults[0].FocusOnControl();
            }
        }