Example #1
0
        //public SheetView SortingData { get { return m_SheetViewData; } }

        #endregion

        #region Handles and Overrides

        private void AdvanceSearchDialog_Load(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                this.SuspendLayout();

                shtQueryList.ActiveSkin = CommonLib.Common.ACTIVE_SKIN;

                fpQueryList.Enabled = true;

                shtQueryList.Columns[(int)eCol.ColumnIndex].Visible = false;
                shtQueryList.Columns[(int)eCol.ColumnType].Visible  = false;

                CtrlUtil.SpreadSetColumnsLocked(shtQueryList, false, (int)eCol.Checkbox);
                CtrlUtil.SpreadSetColumnsLocked(shtQueryList, true, (int)eCol.ColumnName);
                CtrlUtil.SpreadSetColumnsLocked(shtQueryList, true, (int)eCol.Sign);
                CtrlUtil.SpreadSetColumnsLocked(shtQueryList, true, (int)eCol.Value1);
                CtrlUtil.SpreadSetColumnsLocked(shtQueryList, true, (int)eCol.Value2);

                ShowColumnName();

                // Add by Pongthorn S. @ 2012-05-18
                //fpQueryList.KeyPress += CtrlUtil.SetRestrictKeyInput;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                this.ResumeLayout();
                this.Cursor = Cursors.Default;
            }
        }
Example #2
0
        void m_keyboardSpread_RowAdded(object sender, int rowIndex)
        {
            // Unlock cells
            //CtrlUtil.SpreadSetCellLocked(shtCustomerOrder, true, rowIndex, (int)eColCustomerOrder.PO_NO);
            //CtrlUtil.SpreadSetCellLocked(shtCustomerOrder, true, rowIndex, (int)eColCustomerOrder.ORDER_NO);
            //CtrlUtil.SpreadSetCellLocked(shtCustomerOrder, true, rowIndex, (int)eColCustomerOrder.ITEM_CD);
            //CtrlUtil.SpreadSetCellLocked(shtCustomerOrder, true, rowIndex, (int)eColCustomerOrder.SHORT_NAME);
            //CtrlUtil.SpreadSetCellLocked(shtCustomerOrder, true, rowIndex, (int)eColCustomerOrder.ITEM_DELIVERY_DATE);
            //CtrlUtil.SpreadSetCellLocked(shtCustomerOrder, true, rowIndex, (int)eColCustomerOrder.REMAIN_QTY);
            //CtrlUtil.SpreadSetCellLocked(shtCustomerOrder, true, rowIndex, (int)eColCustomerOrder.SHIP_QTY);
            //CtrlUtil.SpreadSetCellLocked(shtCustomerOrder, true, rowIndex, (int)eColCustomerOrder.PRICE);
            //CtrlUtil.SpreadSetCellLocked(shtCustomerOrder, true, rowIndex, (int)eColCustomerOrder.AMOUNT);
            //CtrlUtil.SpreadSetCellLocked(shtCustomerOrder, false, rowIndex, (int)eColCustomerOrder.ChoosePart);
            CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.PO_NO);
            CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ORDER_NO);
            CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ORDER_DETAIL_NO);
            CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ITEM_CD);
            CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.SHORT_NAME);
            CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.ITEM_DESC);
            CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.UNIT);
            CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.QTY);
            CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.PRICE);
            CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.AMOUNT);

            //shtCustomerOrder.Cells[rowIndex, (int)eColView.ISSUE_QTY].Value = 0;
            //shtCustomerOrder.Cells[rowIndex, (int)eColView.ONHAND_QTY].Value = 0;
            //// DEFAULT LOT VALUE
            //if (dtShipDate.Value.HasValue)
            //    shtCustomerOrder.Cells[shtCustomerOrder.Rows.Count - 1, (int)eColView.LOT_NO].Value = dtShipDate.Value.Value.ToString(DataDefine.LOT_NO_FORMAT);
        }
Example #3
0
        private void InitialSpread()
        {
            shtIssueList.ActiveSkin = Common.ACTIVE_SKIN;

            m_keyboardSpread             = new KeyboardSpread(fpIssueList);
            m_keyboardSpread.RowAdding  += m_keyboardSpread_RowAdding;
            m_keyboardSpread.RowAdded   += m_keyboardSpread_RowAdded;
            m_keyboardSpread.RowRemoved += m_keyboardSpread_RowRemoved;
            if (m_Mode != eSaveMode.VIEW)
            {
                m_keyboardSpread.StartBind();
            }

            fpIssueList.SubEditorOpening += CtrlUtil.SpreadDisableSubEditorOpening;

            string[] names = Enum.GetNames(typeof(eColView));
            for (int i = 0; i < names.Length; i++)
            {
                shtIssueList.Columns[i].DataField = names[i];
                CtrlUtil.SpreadSetColumnsLocked(shtIssueList, true, i);
            }
            if (m_Mode == eSaveMode.ADD || m_Mode == eSaveMode.UPDATE)
            {
                CtrlUtil.SpreadSetColumnsLocked(shtIssueList, false, (int)eColView.ISSUE_QTY);
            }
            if (m_Mode == eSaveMode.ADD)
            {
                CtrlUtil.SpreadSetColumnsLocked(shtIssueList, false, (int)eColView.LOT_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtIssueList, false, (int)eColView.LOT_BTN);
            }
        }
Example #4
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;
        }
Example #5
0
        private void InitialData()
        {
            PackingEntryUIDM model = new PackingEntryUIDM();

            shtView.DataSource = model.DATA_VIEW;
            CtrlUtil.SpreadSetColumnsLocked(shtView, false, (int)eColView.LOT_NO);
            CtrlUtil.SpreadSetColumnsLocked(shtView, false, (int)eColView.EXTERNAL_LOT_NO);
            CtrlUtil.SpreadSetColumnsLocked(shtView, false, (int)eColView.QTY);
        }
Example #6
0
        private void InitializeSpread()
        {
            shtView.ActiveSkin = Common.ACTIVE_SKIN;

            CtrlUtil.MappingDataFieldWithEnum(shtView, typeof(eColumns));

            CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColumns.LOT_NO);
            CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColumns.ON_HAND_QTY);
        }
Example #7
0
        private void InitailSpread()
        {
            shtView.ActiveSkin = Common.ACTIVE_SKIN;
            string[] names = Enum.GetNames(typeof(eColView));
            for (int i = 0; i < names.Length; i++)
            {
                shtView.Columns[i].DataField = names[i];
                CtrlUtil.SpreadSetColumnsLocked(shtView, true, i);
            }

            shtView.Columns[(int)eColView.ISSUE_DATE].CellType = CtrlUtil.CreateDateTimeCellType();
        }
Example #8
0
        private void InitialSpread()
        {
            shtView.ActiveSkin = Common.ACTIVE_SKIN;
            CtrlUtil.MappingDataFieldWithEnum(shtView, typeof(eColumns));

            string[] names = Enum.GetNames(typeof(eColumns));
            for (int i = 0; i < names.Length; i++)
            {
                shtView.Columns[i].DataField = names[i];
                CtrlUtil.SpreadSetColumnsLocked(shtView, true, i);
            }

            CtrlUtil.SpreadSetColumnsLocked(shtView, false, (int)eColumns.EDIT_FLAG);
        }
Example #9
0
        private void InitialScreen()
        {
            // add search button
            tsbSearch       = new ToolStripButton("Refresh");
            tsbSearch.Image = Forms.Properties.Resources.REFRESH;
            tslControl.Items.Insert(0, tsbSearch);
            tsbSearch.Click += tsbSearch_Click;


            shtInventorySummary.ActiveSkin = Common.ACTIVE_SKIN;

            CtrlUtil.MappingDataFieldWithEnum(this.shtInventorySummary, typeof(eColView));

            for (int i = 0; i < shtInventorySummary.Columns.Count; i++)
            {
                CtrlUtil.SpreadSetColumnsLocked(shtInventorySummary, true, i);
            }

            CtrlUtil.SpreadUpdateColumnSorting(shtInventorySummary);

            //LookupDataBIZ bizLookup = new LookupDataBIZ();
            //LookupData umClsLookup = bizLookup.LoadLookupClassType((NZString)DataDefine.UM_CLS);
            //shtView.Columns[(int)eColView.INV_UM_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(umClsLookup);

            //LookupData itemClsLookup = bizLookup.LoadLookupClassType((NZString)DataDefine.ITEM_CLS);
            //shtView.Columns[(int)eColView.ITEM_CLS].CellType = CtrlUtil.CreateReadOnlyPairCellType(itemClsLookup);

            //LookupData itemClsMinorLookup = bizLookup.LoadLookupClassType((NZString)DataDefine.ITEM_CLS_MINOR04);
            //shtView.Columns[(int)eColView.ITEM_CLS_MINOR].CellType = CtrlUtil.CreateReadOnlyPairCellType(itemClsMinorLookup);

            //LookupData locCustomer = bizLookup.LoadLookupLocation();
            //shtView.Columns[(int)eColView.FOR_CUSTOMER].CellType = CtrlUtil.CreateReadOnlyPairCellType(locCustomer);

            switch (Common.CurrentUserInfomation.DateFormat)
            {
            case eDateFormat.YMD:
                dtMonth.Format = "yyyy/MM";
                break;

            case eDateFormat.MDY:
            case eDateFormat.DMY:
                dtMonth.Format = "MM/yyyy";
                break;
            }

            LoadDefaultPeriod();
        }
Example #10
0
        private void InitialSpread()
        {
            shtView.ActiveSkin = Common.ACTIVE_SKIN;
            CtrlUtil.MappingDataFieldWithEnum(shtView, typeof(eColumns));
            shtView.OperationMode = OperationMode.Normal;

            shtView.Columns[(int)eColumns.CHECK_FLAG].CellType            = CtrlUtil.CreateCheckboxCellType();
            shtView.Columns[(int)eColumns.CHECK_FLAG].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;

            CtrlUtil.SpreadSetColumnsLocked(shtView, false, (int)eColumns.CHECK_FLAG);
            CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColumns.LAST_RECEIVE_DATE);
            CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColumns.PACK_NO);
            CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColumns.FG_NO);
            CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColumns.LOT_NO);
            CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColumns.EXTERNAL_LOT_NO);
            CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColumns.ONHAND_QTY);
            fpView.ContextMenuStrip  = null;
            fpView.SubEditorOpening += CtrlUtil.SpreadDisableSubEditorOpening;
        }
Example #11
0
        private void InitialSpread()
        {
            shtView.ActiveSkin = Common.ACTIVE_SKIN;

            //m_keyboardSpread = new KeyboardSpread(fpView);
            //m_keyboardSpread.RowAdding += m_keyboardSpread_RowAdding;
            //m_keyboardSpread.RowAdded += m_keyboardSpread_RowAdded;
            //m_keyboardSpread.RowRemoved += m_keyboardSpread_RowRemoved;
            //if (m_screenMode != Common.eScreenMode.VIEW)
            //    m_keyboardSpread.StartBind();


            //fpNGInfo.SubEditorOpening += CtrlUtil.SpreadDisableSubEditorOpening;
            //CtrlUtil.MappingDataFieldWithEnum(shtView, typeof(eNGInfoCol));

            //fpCustomerOrderList.LeaveCell += new LeaveCellEventHandler(fpView_LeaveCell);
            //fpCustomerOrderList.SubEditorOpening += CtrlUtil.SpreadDisableSubEditorOpening;
            CtrlUtil.MappingDataFieldWithEnum(shtView, typeof(eColumns));

            string[] names = Enum.GetNames(typeof(eColumns));
            for (int i = 0; i < names.Length; i++)
            {
                shtView.Columns[i].DataField = names[i];
                CtrlUtil.SpreadSetColumnsLocked(shtView, true, i);
            }

            CtrlUtil.SpreadSetColumnsLocked(shtView, false, (int)eColumns.EDIT_FLAG);
            //if (m_screenMode == Common.eScreenMode.ADD || m_screenMode == Common.eScreenMode.EDIT)
            //{
            //    CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrderList, false, (int)eColView.ITEM_CD_BTN);
            //    CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrderList, false, (int)eColView.ITEM_DELIVERY_DATE);
            //    CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrderList, false, (int)eColView.QTY);
            //}
            //if (m_screenMode == Common.eScreenMode.ADD)
            //{
            //    CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrderList, false, (int)eColView.ITEM_CD_BTN);
            //    CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrderList, false, (int)eColView.ITEM_DELIVERY_DATE);
            //    CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrderList, false, (int)eColView.QTY);
            //}
        }
Example #12
0
        private void SetScreenMode(Common.eScreenMode mode)
        {
            switch (mode)
            {
            case Common.eScreenMode.VIEW:
                CtrlUtil.EnabledControl(false, txtInvoiceNo, txtPONo, txtRemark, fpView);
                CtrlUtil.EnabledControl(false, dtReceiveDate, rdoReceive, rdoReceiveReturn);
                CtrlUtil.EnabledControl(false, txtInvoiceNo, txtPONo, txtRemark, cboStoredLoc, cboSupplierCode);

                tsbSaveAndNew.Enabled   = false;
                tsbSaveAndClose.Enabled = false;
                shtView.OperationMode   = OperationMode.ReadOnly;

                CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColView.ORDER_QTY);
                CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColView.SUPP_LOT_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtView, true, (int)eColView.PRICE);
                fpView.ContextMenuStrip = null;
                break;

            case Common.eScreenMode.ADD:
                CtrlUtil.EnabledControl(true, dtReceiveDate, txtInvoiceNo, txtPONo
                                        , txtRemark, fpView, rdoReceiveReturn, rdoReceive, cboSupplierCode, cboStoredLoc);
                //m_keyboardSpread.StartBind();
                break;

            case Common.eScreenMode.EDIT:
                CtrlUtil.EnabledControl(true, fpView);
                CtrlUtil.EnabledControl(false, dtReceiveDate, rdoReceive, rdoReceiveReturn, cboStoredLoc, cboSupplierCode);
                CtrlUtil.EnabledControl(true, txtInvoiceNo, txtPONo, txtRemark);
                CtrlUtil.SpreadSetColumnsLocked(shtView, false, (int)eColView.ORDER_QTY);
                CtrlUtil.SpreadSetColumnsLocked(shtView, false, (int)eColView.SUPP_LOT_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtView, false, (int)eColView.PRICE);
                //m_keyboardSpread.StartBind();
                break;
            }

            m_screenMode = mode;
        }
Example #13
0
        private void SetScreenMode(Common.eScreenMode mode)
        {
            switch (mode)
            {
            case Common.eScreenMode.ADD:
                CtrlUtil.EnabledControl(true, txtDeliveryNo, cboAddress, txtInvoiceNo,
                                        dtInvoiceDate, cboTermOfPayment, dtPaymentDueDate,
                                        txtReferTemNo, txtRemark, txtVat, txtVatTotal);
                CtrlUtil.EnabledControl(false, cboCustomerCode, txtFullAddress, txtSubTotal, txtTotal);
                shtCustomerOrder.OperationMode = OperationMode.Normal;
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.PO_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ORDER_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ORDER_DETAIL_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ITEM_CD);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.SHORT_NAME);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.ITEM_DESC);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.UNIT);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.QTY);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.PRICE);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.AMOUNT);


                break;

            case Common.eScreenMode.EDIT:
                CtrlUtil.EnabledControl(false, txtDeliveryNo, cboAddress, txtInvoiceNo,
                                        dtInvoiceDate, cboTermOfPayment, dtPaymentDueDate,
                                        txtVat, cboCustomerCode, txtFullAddress, txtSubTotal);
                CtrlUtil.EnabledControl(true, txtReferTemNo, txtRemark, txtVatTotal, txtTotal);
                shtCustomerOrder.OperationMode = OperationMode.Normal;
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.PO_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ORDER_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ORDER_DETAIL_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ITEM_CD);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.SHORT_NAME);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.ITEM_DESC);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.UNIT);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.QTY);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.PRICE);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, false, (int)eColView.AMOUNT);

                break;

            case Common.eScreenMode.VIEW:

                shtCustomerOrder.OperationMode = OperationMode.ReadOnly;
                CtrlUtil.EnabledControl(false, txtDeliveryNo, cboAddress, txtInvoiceNo,
                                        dtInvoiceDate, cboTermOfPayment, dtPaymentDueDate,
                                        txtVat, cboCustomerCode, txtFullAddress, txtSubTotal);
                CtrlUtil.EnabledControl(false, txtReferTemNo, txtRemark, txtVatTotal, txtTotal);
                shtCustomerOrder.OperationMode = OperationMode.ReadOnly;
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.PO_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ORDER_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ORDER_DETAIL_NO);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ITEM_CD);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.SHORT_NAME);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.ITEM_DESC);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.UNIT);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.QTY);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.PRICE);
                CtrlUtil.SpreadSetColumnsLocked(shtCustomerOrder, true, (int)eColView.AMOUNT);


                fpCustomerOrder.ContextMenuStrip = null;
                tsbSaveAndClose.Enabled          = false;
                tsbSaveAndNew.Enabled            = false;
                break;
            }

            m_Mode = mode;
        }