예제 #1
0
        /// <summary>
        /// SOAvoidDupleSaleOrdersDelivery_Load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <author>Trada</author>
        /// <date>Friday, Feb 17 2006</date>
        private void SOAvoidDupleSaleOrdersDelivery_Load(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".SOAvoidDupleSaleOrdersDelivery_Load()";

            try
            {
                //Set form security
                Security objSecurity = new Security();

                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    // You don't have the right to view this item
                    PCSMessageBox.Show(ErrorCode.MESSAGE_YOU_HAVE_NO_RIGHT_TO_VIEW, MessageBoxIcon.Warning);
                    this.Close();
                    return;
                }
                //Init Combo box
                cboMonth.Items.Clear();
                cboMonth.Items.Add(string.Empty);
                for (int i = 1; i < 13; i++)
                {
                    cboMonth.Items.Add(i.ToString());
                }
                cboMonth.SelectedIndex = -1;

                cboYear.Items.Clear();
                cboYear.Items.Add(string.Empty);
                for (int i = 2000; i < 2051; i++)
                {
                    cboYear.Items.Add(i.ToString());
                }
                cboYear.SelectedIndex = -1;
                //get grid layout
                dtbGridLayOut = FormControlComponents.StoreGridLayout(dgrdData);
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
예제 #2
0
        private void InvalidCPO_Load(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".InvalidCPO_Load()";

            const string STARTDATE_COL   = "StartDate";
            const string DUEDATE_COL     = "DueDate";
            const string QUANTITY_COL    = "Quantity";
            const string ERRORCODE_COL   = "ErrorCode";
            const string ERRORREASON_COL = "ErrorReason";

            try
            {
                Security objSecurity = new Security();
                this.Name = THIS;
                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    this.Close();
                    return;
                }

                if (m_dtbInvalidWOLineAndCPO != null)
                {
                    m_dtbInvalidWOLineAndCPO.Columns.Add(ERRORREASON_COL, typeof(string));
                    foreach (DataRow drow in m_dtbInvalidWOLineAndCPO.Rows)
                    {
                        drow[ERRORREASON_COL] = ErrorMessageBO.GetErrorMessage(Convert.ToInt32(drow[ERRORCODE_COL]));
                    }
                    DataTable dtbLayout = FormControlComponents.StoreGridLayout(tgridOverCapacityWC);
                    tgridOverCapacityWC.DataSource = m_dtbInvalidWOLineAndCPO;
                    FormControlComponents.RestoreGridLayout(tgridOverCapacityWC, dtbLayout);
                    tgridOverCapacityWC.Columns[STARTDATE_COL].NumberFormat = Constants.DATETIME_FORMAT_HOUR;
                    tgridOverCapacityWC.Columns[DUEDATE_COL].NumberFormat   = Constants.DATETIME_FORMAT_HOUR;
                    tgridOverCapacityWC.Columns[QUANTITY_COL].NumberFormat  = Constants.DECIMAL_NUMBERFORMAT;
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
예제 #3
0
        private void MessageBoxFormForItems_Load(object sender, System.EventArgs e)
        {
            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.WaitCursor;

            #endregion Code Inserted Automatically


            new Security().SetRightForUserOnForm(this, SystemProperty.UserName);

            DataTable dtbGridLayOut = FormControlComponents.StoreGridLayout(dgrdData);
            dgrdData.DataSource = BugReason;

            //Restore layout
            FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayOut);

            this.MaximizeBox     = false;
            this.FormBorderStyle = FormBorderStyle.FixedSingle;

            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.Default;

            #endregion Code Inserted Automatically
        }
예제 #4
0
        /// <summary>
        /// ManufacturingClose_Load
        /// </summary>
        /// <author>Trada</author>
        /// <date>Thursday, June 9 2005</date>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ManufacturingClose_Load(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".ManufacturingClose_Load()";

            try
            {
                //Set authorization for user
                Security objSecurity = new Security();
                this.Name = THIS;
                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    this.Close();
                    // You don't have the right to view this item
                    PCSMessageBox.Show(ErrorCode.MESSAGE_YOU_HAVE_NO_RIGHT_TO_VIEW);
                    return;
                }
                //StoreGrid();
                dtbGridLayOut = FormControlComponents.StoreGridLayout(gridWOClose);
                InitVariable();
                //Fill Default Master Location
                FormControlComponents.SetDefaultMasterLocation(txtMasLoc);
                voMasLoc.MasterLocationID = SystemProperty.MasterLocationID;
                //Set focus to dtmPostDate
                dtmPostDate.Focus();
            }
            catch (PCSException ex)
            {
                // Displays the error message if throwed from PCSException.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    // Log error message into log file.
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    // Show message if logger has an error.
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // Displays the error message if throwed from system.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    // Log error message into log file.
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    // Show message if logger has an error.
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
예제 #5
0
        private void SelectWorkOrders_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".MultiWOIssueMaterial_Load()";

            try
            {
                //Set form security
                Security objSecurity = new Security();
                this.Name = THIS;
                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    // You don't have the right to view this item
                    PCSMessageBox.Show(ErrorCode.MESSAGE_YOU_HAVE_NO_RIGHT_TO_VIEW, MessageBoxIcon.Warning);
                    this.Close();
                    return;
                }

                //check if the Location and the CCN has data
                if (mMasterLocationID <= 0 || mCCNID <= 0)
                {
                    //MessageBox.Show("Please select the Master Location and CCN id");
                    PCSMessageBox.Show(ErrorCode.MSG_WOISSUE_MATERIAL_SELECT_MASLOC_AND_CCN, MessageBoxIcon.Warning);
                    this.Close();
                    return;
                }
                //Format DateTime control
                dtmFromStartDate.CustomFormat = Constants.DATETIME_FORMAT_HOUR;
                dtmToStartDate.CustomFormat   = Constants.DATETIME_FORMAT_HOUR;
                var workingPeriod = Utilities.Instance.GetWorkingPeriod();
                dtmFromStartDate.Value = workingPeriod.FromDate;
                dtmToStartDate.Value   = Utilities.Instance.GetServerDate();
                //store the gridlayout
                dtStoreGridLayout = FormControlComponents.StoreGridLayout(dgrdData);

                //Display the data on form
                lblMasLocValue.Text = mMasterLocCode;
                lblCCNValue.Text    = mCCNCode;
            }

            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
예제 #6
0
        private void OutOfCapacityWC_Load(object sender, System.EventArgs e)
        {
            const string OVERDAYS_COL    = "OverDays";
            const string OVERPERCENT_COL = "OverPercent";

            const string METHOD_NAME = THIS + ".OutOfCapacityWC_Load()";

            try
            {
                Security objSecurity = new Security();
                this.Name = THIS;
                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    this.Close();
                    return;
                }

                if (m_dtbOverCapacityWC != null)
                {
                    DataTable dtbLayout = FormControlComponents.StoreGridLayout(tgridOverCapacityWC);
                    tgridOverCapacityWC.DataSource = m_dtbOverCapacityWC;
                    FormControlComponents.RestoreGridLayout(tgridOverCapacityWC, dtbLayout);
                    tgridOverCapacityWC.Columns[OVERDAYS_COL].NumberFormat    = Constants.DECIMAL_NUMBERFORMAT;
                    tgridOverCapacityWC.Columns[OVERPERCENT_COL].NumberFormat = Constants.DECIMAL_NUMBERFORMAT;
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
예제 #7
0
        private void ProductProductionOrder_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".ManualProductionPlanning_Load()";

            try
            {
                Security objSecurity = new Security();
                this.Name = THIS;
                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    this.Close();
                    PCSMessageBox.Show(ErrorCode.MESSAGE_YOU_HAVE_NO_RIGHT_TO_VIEW, MessageBoxIcon.Warning);
                    return;
                }


                //get grid layout
                dtbGridLayOut = FormControlComponents.StoreGridLayout(dgrdData);

                FillDataToGrid(0);
                txtProductionLine.Focus();
                btnSave.Enabled = false;
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }
예제 #8
0
        private void NotSetupSTDItems_Load(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".NotSetupSTDItems_Load()";

            try
            {
                Security objSecurity = new Security();
                this.Name = THIS;
                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    this.Close();
                    return;
                }

                if (m_dtbNotSTDCost != null)
                {
                    DataTable dtbLayout = FormControlComponents.StoreGridLayout(dgrdData);
                    dgrdData.DataSource = m_dtbNotSTDCost;
                    FormControlComponents.RestoreGridLayout(dgrdData, dtbLayout);
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
예제 #9
0
        private void SelectItems_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".SelectItems_Load()";

            try
            {
                BomBO     boBOM         = new BomBO();
                DataSet   dstAllItem    = boBOM.ListComponents();
                DataTable dtbComponents = boBOM.ListComponents(intProductID).Tables[0];
                dstData.Tables.Add(BuildSchema());
                DataRow drowItem = boBOM.GetItemInfo(intProductID);
                dstData.Tables[0].ImportRow(drowItem);
                foreach (DataRow drowData in dtbComponents.Rows)
                {
                    BuildData(dstData.Tables[0], dstAllItem.Tables[0], drowData);
                }
                dtbGridLayout = FormControlComponents.StoreGridLayout(dgrdData);
                BindData();
                FilterData();
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
예제 #10
0
        private void IgnoreProductionLine_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".IgnoreProductionLine_Load()";

            try
            {
                Security objSecurity = new Security();
                this.Name = THIS;
                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    this.Close();
                    PCSMessageBox.Show(ErrorCode.MESSAGE_YOU_HAVE_NO_RIGHT_TO_VIEW, MessageBoxIcon.Warning);
                    return;
                }


                //get grid layout
                dtbGridLayOut = FormControlComponents.StoreGridLayout(dgrdData);

                //load all production line
                ProductionLineBO boProductionLine = new ProductionLineBO();
                dstData = boProductionLine.List();
                if (dtbIgnoreList.Rows.Count > 0)
                {
                    foreach (DataRow drowData in dtbIgnoreList.Rows)
                    {
                        dstData.Tables[0].Select(PRO_ProductionLineTable.PRODUCTIONLINEID_FLD
                                                 + "=" + drowData[PRO_ProductionLineTable.PRODUCTIONLINEID_FLD].ToString().Trim())[0][IGNORED_FLD] = true;
                    }
                }
                dgrdData.DataSource = dstData.Tables[0];

                FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayOut);
                foreach (C1DisplayColumn c1Col in dgrdData.Splits[0].DisplayColumns)
                {
                    if (c1Col.DataColumn.DataField != IGNORED_FLD)
                    {
                        c1Col.Locked = true;
                    }
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }