コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 private bool CheckMandatory()
 {
     if (txtServer.Text.Trim().Equals(string.Empty))
     {
         PCSMessageBox.Show(lblMandatory.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning,
                            MessageBoxDefaultButton.Button1);
         txtServer.Focus();
         return(false);
     }
     if (txtDatabase.Text.Trim().Equals(string.Empty))
     {
         PCSMessageBox.Show(lblMandatory.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning,
                            MessageBoxDefaultButton.Button1);
         txtServer.Focus();
         return(false);
     }
     if (txtUserID.Text.Trim().Equals(string.Empty))
     {
         PCSMessageBox.Show(lblMandatory.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning,
                            MessageBoxDefaultButton.Button1);
         txtServer.Focus();
         return(false);
     }
     return(true);
 }
コード例 #2
0
        /// <summary>
        /// ValidateDataToSearch
        /// </summary>
        /// <returns></returns>
        /// <author>Trada</author>
        /// <date>Friday, Feb 17 2006</date>
        private bool ValidateDataToSearch()
        {
            const string METHOD_NAME = THIS + ".ValidateDataToSearch()";

            try
            {
                if (FormControlComponents.CheckMandatory(cboYear))
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Exclamation);
                    cboYear.Focus();
                    return(false);
                }
                if (FormControlComponents.CheckMandatory(cboMonth))
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Exclamation);
                    cboMonth.Focus();
                    return(false);
                }
                if (FormControlComponents.CheckMandatory(txtCustomer))
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Exclamation);
                    txtCustomer.Focus();
                    return(false);
                }
                return(true);
            }
            catch (PCSException ex)
            {
                throw new PCSException(ex.mCode, METHOD_NAME, ex);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
コード例 #3
0
        private void dgrdData_AfterColEdit(object sender, C1.Win.C1TrueDBGrid.ColEventArgs e)
        {
            const string METHOD_NAME = ".dgrdData_AfterColEdit()";

            try
            {
                blnHasChange = 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, 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);
                }
            }
        }
コード例 #4
0
        private void txtProductionLine_Validating(object sender, CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".txtProductionLine_Validating()";

            try
            {
                SelectProductionLine(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, 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);
                }
            }
        }
コード例 #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + "btnOK_Click()";

            try
            {
                if (CheckMandatory())
                {
                    #region Save Connection String

                    var connectionString = ConstructConnString();
                    SaveConnectionString(connectionString);

                    PCSComUtils.DataAccess.Utils.Instance.ChangeConnection();

                    #endregion

                    MessageBox.Show(lblSaveOK.Text, Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    btnClose.Focus();
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(lblSystemError.Text, MessageBoxButtons.OK, MessageBoxIcon.Error,
                                   MessageBoxDefaultButton.Button1);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                }
            }
        }
コード例 #6
0
        private void btnWCCapacity_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnWCCapacity_Click()";

            try
            {
                int intWorkCenterID = Convert.ToInt32(tgridOverCapacityWC.Columns[MST_WorkCenterTable.WORKCENTERID_FLD].Value);
                WorkCenterCapacity frmWCCapacity = new WorkCenterCapacity(intWorkCenterID, m_intCycleOptionID);
                frmWCCapacity.ShowDialog(this);
            }
            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 chkSelectAll_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".chkSelectAll_Click()";

            try
            {
                string strFilter = ((DataTable)dgrdData.DataSource).DefaultView.RowFilter;
                var    boUtils   = new UtilsBO();
                dtbData = boUtils.UpdateSelected(dtbData.Tables[0].TableName, strFilter, chkSelectAll.Checked);
                LoadDataDetail(dtbData);
                dtbData.Tables[0].DefaultView.RowFilter = strFilter;
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
コード例 #8
0
        private void btnShiftPattern_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnShiftPattern_Click()";

            try
            {
                ShiftPattern frmShiftPattern = new ShiftPattern();
                frmShiftPattern.ShowDialog(this);
            }
            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 btnOK_Click(object sender, EventArgs e)
        {
            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.WaitCursor;

            #endregion Code Inserted Automatically


            const string METHOD_NAME = THIS + ".btnOK_Click()";
            try
            {
                // get all checked item and add to arraylist
                foreach (int intIndex in chlList.CheckedIndices)
                {
                    marrReturnsList.Add(tblData.Rows[intIndex][strValueMember]);
                }
                marrReturnsList.TrimToSize();
                // close the form
                this.Close();
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            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);
                }
            }

            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.Default;

            #endregion Code Inserted Automatically
        }
コード例 #10
0
        private void btnOK_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnOK_Click()";

            try
            {
                ReturnValue();
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            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);
                }
            }
        }
コード例 #11
0
        private void txtBeginWO_KeyDown(object sender, KeyEventArgs e)
        {
            const string METHOD_NAME = THIS + ".txtBeginWO_KeyDown";

            try
            {
                if (e.KeyCode == Keys.F4)
                {
                    if (btnSearchBeginWO.Enabled)
                    {
                        btnSearchBeginWO_Click(null, null);
                    }
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
コード例 #12
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);
                }
            }
        }
コード例 #13
0
        public void btnSearch_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearch_Click()";

            try
            {
                DateTime dtmFromDate = DateTime.MinValue, dtmToDate = DateTime.MinValue;
                if (dtmFromStartDate.Value != DBNull.Value && dtmFromStartDate.Text != String.Empty)
                {
                    DateTime dtmDate = (DateTime)dtmFromStartDate.Value;
                    dtmFromDate = new DateTime(dtmDate.Year, dtmDate.Month, dtmDate.Day, dtmDate.Hour, dtmDate.Minute, 0);
                }

                if (dtmToStartDate.Value != DBNull.Value && dtmToStartDate.Text != String.Empty)
                {
                    DateTime dtmDate = (DateTime)dtmToStartDate.Value;
                    dtmToDate = new DateTime(dtmDate.Year, dtmDate.Month, dtmDate.Day, dtmDate.Hour, dtmDate.Minute, 0);
                }
                string strCondition = (new UtilsBO()).GetConditionByRecord(SystemProperty.UserName, REMAIN_COMPONENT_FOR_ISSUE_VIEW);
                dtbData = objSelectWorkOrdersBO.SearchWorkOrderToIssueMaterial(strCondition, mMasterLocationID, mToLocationID, intWorkOrderMasterID, dtmFromDate, dtmToDate);
                if (dtbData != null && dtbData.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in dtbData.Tables[0].Rows)
                    {
                        dr["SELECTED"] = "False";
                    }
                }

                LoadDataDetail(dtbData);
                chkSelectAll.Checked = false;
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            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);
                }
            }
        }
コード例 #14
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);
                }
            }
        }
コード例 #15
0
        private void dgrdData_ButtonClick(object sender, ColEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_ButtonClick()";

            try
            {
                DataRowView drwResult    = null;
                Hashtable   htbCondition = new Hashtable();
                if (txtProductionLine.Text.Trim() != string.Empty)
                {
                    htbCondition.Add(PRO_WorkOrderMasterTable.PRODUCTIONLINEID_FLD, int.Parse(txtProductionLine.Tag.ToString()));
                }
                else
                {
                    String[] strParam = new string[2];
                    strParam[0] = lblProductionLine.Text;
                    strParam[1] = dgrdData.Columns[dgrdData.Col].Caption;
                    PCSMessageBox.Show(ErrorCode.MESSAGE_SELECT_ONE_BEFORE_SELECT_ONE, MessageBoxIcon.Warning, strParam);
                    txtProductionLine.Focus();
                    return;
                }
                if (dgrdData.AddNewMode == AddNewModeEnum.AddNewCurrent)
                {
                    drwResult = FormControlComponents.OpenSearchForm(PRODUCT_IN_PRODUCTIONLINE_VIEWNAME, dgrdData.Columns[dgrdData.Col].DataField, dgrdData[dgrdData.Row, dgrdData.Col].ToString(), htbCondition, true);
                }
                else
                {
                    drwResult = FormControlComponents.OpenSearchForm(PRODUCT_IN_PRODUCTIONLINE_VIEWNAME, dgrdData.Columns[dgrdData.Col].DataField, dgrdData.Columns[dgrdData.Col].Text.Trim(), htbCondition, true);
                }
                if (drwResult != null)
                {
                    FillItemData(drwResult.Row);
                }
            }
            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);
                }
            }
        }
コード例 #16
0
        private void dgrdData_KeyDown(object sender, KeyEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_KeyDown()";

            try
            {
                switch (e.KeyCode)
                {
                case Keys.F4:
                    if (btnSave.Enabled)
                    {
                        dgrdData_ButtonClick(sender, null);
                    }
                    break;

                case Keys.Delete:
                    if ((e.KeyCode == Keys.Delete) && (dgrdData.SelectedRows.Count > 0))
                    {
                        if (btnSave.Enabled)
                        {
                            dgrdData.AllowDelete = true;
                            FormControlComponents.DeleteMultiRowsOnTrueDBGrid(dgrdData);
                            for (int i = 0; i < dgrdData.RowCount; i++)
                            {
                                if (dgrdData[i, ITM_ProductTable.PRODUCTID_FLD].ToString() != string.Empty)
                                {
                                    dgrdData[i, SEQUENCE_FLD] = i + 1;
                                }
                            }
                        }
                    }
                    break;
                }
            }
            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);
                }
            }
        }
コード例 #17
0
        private void VendorCodeText_Validating(object sender, System.ComponentModel.CancelEventArgs e)
        {
            const string methodName = This + ".VendorCodeText_Validating()";

            try
            {
                if (!VendorCodeText.Modified)
                {
                    return;
                }
                if (VendorCodeText.Text.Trim() == string.Empty)
                {
                    FillVendor(null);
                    return;
                }
                var htbCriteria = new Hashtable {
                    { "Vendor", 1 }
                };
                var drvResult = FormControlComponents.OpenSearchForm("V_VendorCustomer", MST_PartyTable.CODE_FLD, VendorCodeText.Text.Trim(), htbCriteria, false);
                if (drvResult != null)
                {
                    FillVendor(drvResult);
                }
                else
                {
                    e.Cancel = true;
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, methodName, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, methodName, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
コード例 #18
0
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = ".btnSave_Click()";

            try
            {
                if (dgrdData.EditActive)
                {
                    return;
                }
                dstRealData.Tables[0].Rows.Clear();
                dstRealData.Tables[0].AcceptChanges();

                //get data from grid
                for (int i = 0; i < dstData.Tables[0].Rows.Count; i++)
                {
                    for (int j = 0; j < dstData.Tables[0].Rows.Count; j++)
                    {
                        DataRow drow = dstRealData.Tables[0].NewRow();
                        drow[PRO_ChangeCategoryMatrixTable.SOURCEPRODUCTID_FLD]        = dstData.Tables[0].Rows[i][ITM_ProductTable.PRODUCTID_FLD];
                        drow[PRO_ChangeCategoryMatrixTable.DESTPRODUCTID_FLD]          = dstData.Tables[0].Rows[j][ITM_ProductTable.PRODUCTID_FLD];;
                        drow[PRO_ChangeCategoryMatrixTable.CHANGETIME_FLD]             = dgrdData[i, dstData.Tables[0].Rows[j][ITM_ProductTable.PRODUCTID_FLD].ToString()];
                        drow[PRO_ChangeCategoryMatrixTable.CHANGECATEGORYMASTERID_FLD] = intMasterID;
                        dstRealData.Tables[0].Rows.Add(drow);
                    }
                }

                new ChangeCategoryBO().UpdateDataSetMatrix(dstRealData, intMasterID);
                PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA);
                blnHasChange = 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, 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);
                }
            }
        }
コード例 #19
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);
                }
            }
        }
コード例 #20
0
        /// <summary>
        /// ManufacturingClose_Closing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <author>Trada</author>
        /// <date>Thursday, October 13 2005</date>
        private void ManufacturingClose_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".ManufacturingClose_Closing()";

            try
            {
                if ((dstReleaseWO != null) && (dstReleaseWO.GetChanges() != null))
                {
                    DialogResult confirmDialog = PCSMessageBox.Show(ErrorCode.MESSAGE_QUESTION_RELEASE_BEFORE_CLOSE, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, CLOSE);
                    switch (confirmDialog)
                    {
                    case DialogResult.Yes:
                        //Save before exit
                        btnCloseWO_Click(sender, new EventArgs());
                        break;

                    case DialogResult.No:
                        break;

                    case DialogResult.Cancel:
                        e.Cancel = true;
                        break;
                    }
                    return;
                }
            }
            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.
                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);
                }
            }
        }
コード例 #21
0
        private void dgrdData_AfterColUpdate(object sender, ColEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_AfterColUpdate()";

            try
            {
                if (e.Column.DataColumn.DataField == IGNORED_FLD)
                {
                    bool blnIgnored = Convert.ToBoolean(e.Column.DataColumn.Value);
                    if (!blnIgnored)
                    {
                        foreach (DataRow drowData in dtbIgnoreList.Rows)
                        {
                            if (drowData[PRO_ProductionLineTable.PRODUCTIONLINEID_FLD].ToString()
                                == dgrdData[dgrdData.Row, PRO_ProductionLineTable.PRODUCTIONLINEID_FLD].ToString())
                            {
                                dtbIgnoreList.Rows.Remove(drowData);
                                break;
                            }
                        }
                    }
                    else
                    {
                        DataRow drowIgnore = dtbIgnoreList.NewRow();
                        drowIgnore[PRO_ProductionLineTable.PRODUCTIONLINEID_FLD] = dgrdData[dgrdData.Row, PRO_ProductionLineTable.PRODUCTIONLINEID_FLD].ToString();
                        drowIgnore[MST_WorkCenterTable.WORKCENTERID_FLD]         = dgrdData[dgrdData.Row, MST_WorkCenterTable.WORKCENTERID_FLD].ToString();
                        dtbIgnoreList.Rows.Add(drowIgnore);
                    }
                }
            }
            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);
                }
            }
        }
コード例 #22
0
        private void lvwIcons_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".lvwIcons_SelectedIndexChanged";

            try
            {
                if (lvwIcons.SelectedIndices.Count == 0)
                {
                    return;
                }
                if (mIsGroup)
                {
                    if (radCollapsed.Checked)
                    {
                        picCollapsed.Image       = imglTreeNode.Images[lvwIcons.SelectedIndices[0]];
                        MenuEntry.CollapsedImage = lvwIcons.SelectedIndices[0] + 1;
                    }
                    else
                    {
                        picExpanded.Image       = imglTreeNode.Images[lvwIcons.SelectedIndices[0]];
                        MenuEntry.ExpandedImage = lvwIcons.SelectedIndices[0] + 1;
                    }
                }
                else
                {
                    picExpanded.Image       = imglTreeNode.Images[lvwIcons.SelectedIndices[0]];
                    picCollapsed.Image      = imglTreeNode.Images[lvwIcons.SelectedIndices[0]];
                    MenuEntry.ExpandedImage = MenuEntry.CollapsedImage = lvwIcons.SelectedIndices[0] + 1;
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                }
            }
        }
コード例 #23
0
        private void RoleList_AfterRowColChange(object sender, RangeEventArgs e)
        {
            const string methodName = This + ".RoleList_AfterRowColChange()";

            try
            {
                if (RoleList.Cols.IndexOf(Sys_RoleTable.ROLEID_FLD) < 0)
                {
                    return;
                }

                // Get RoleID
                int intRowSel = RoleList.RowSel;
                // if user change selected row
                if (intRowSel <= 0 || e.OldRange.r1 == e.NewRange.r1)
                {
                    return;
                }
                // Get data display on column 1 of Role
                int roleId;
                if (int.TryParse(RoleList.GetDataDisplay(RoleList.RowSel, Sys_RoleTable.ROLEID_FLD), out roleId))
                {
                    _selectedRoleId = roleId;
                    BindRightList(_rightList.Where(r => r.RoleID == roleId), null);
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, methodName, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, methodName, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
コード例 #24
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);
                }
            }
        }
コード例 #25
0
        /// <summary>
        /// Search for specific WORK Order
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSearchBeginWO_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearchBeginWO_Click()";

            try
            {
                DataRowView drwResult = null;
                //search for master location id
                Hashtable hashCondition = new Hashtable();

                hashCondition.Add(PRO_WorkOrderMasterTable.MASTERLOCATIONID_FLD, mMasterLocationID);

                //HACK: added by Tuan TQ. 19 Jan, 2006. Apply To Location for issuing
                hashCondition.Add(MST_LocationTable.LOCATIONID_FLD, mToLocationID);
                //End Hack

                drwResult = FormControlComponents.OpenSearchForm(REMAIN_WO_FOR_ISSUE_VIEW, PRO_WorkOrderMasterTable.WORKORDERNO_FLD, txtBeginWO.Text.Trim(), hashCondition, true);
                if (drwResult != null)
                {
                    intWorkOrderMasterID = int.Parse(drwResult[PRO_WorkOrderMasterTable.WORKORDERMASTERID_FLD].ToString());
                    txtBeginWO.Text      = drwResult[PRO_WorkOrderMasterTable.WORKORDERNO_FLD].ToString();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            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);
                }
            }
        }
コード例 #26
0
        private void btnSelect_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSelect_Click";

            try
            {
                this.Cursor = Cursors.WaitCursor;

                MultiWOIssueMaterialBO boWOIssue = new MultiWOIssueMaterialBO();

                mReturnResult = boWOIssue.GetDetailData(0);

                mReturnResult.Tables[0].Columns.Add(HASBIN);
                mReturnResult.Tables[0].Columns.Add(ITM_ProductTable.LOTCONTROL_FLD);
                mReturnResult.Tables[0].Columns[PRO_IssueMaterialDetailTable.LINE_FLD].AutoIncrement     = true;
                mReturnResult.Tables[0].Columns[PRO_IssueMaterialDetailTable.LINE_FLD].AutoIncrementSeed = 1;
                mReturnResult.Tables[0].Columns[PRO_IssueMaterialDetailTable.LINE_FLD].AutoIncrementStep = 1;

                mReturnResult = objSelectWorkOrdersBO.GetSelectedRecords(dtbData.Tables[0].TableName, mReturnResult);

                if (mReturnResult.Tables[0].Rows.Count == 0)
                {
                    PCSMessageBox.Show(ErrorCode.MSG_WOISSUE_MATERIAL_SELECT_ATLEAST_ONE_WOLINE, MessageBoxIcon.Warning);
                    this.Cursor = Cursors.Default;
                    return;
                }
                else
                {
                    this.Cursor       = Cursors.Default;
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
コード例 #27
0
        private void btnSelectPeriod_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSelectPeriod_Click()";

            try
            {
                Hashtable htCondition = new Hashtable();
                htCondition.Add(Sys_PeriodTable.ACTIVATE_FLD, 1);
                DataRowView drwResult = null;
                drwResult = FormControlComponents.OpenSearchForm(Sys_PeriodTable.TABLE_NAME, string.Empty, "", htCondition, true);
                if (drwResult != null)
                {
                    dtmFromDate.Value    = drwResult[Sys_PeriodTable.FROMDATE_FLD];
                    dtmToDate.Value      = drwResult[Sys_PeriodTable.TODATE_FLD];
                    txtYear.Text         = Convert.ToDateTime(dtmFromDate.Value).Year.ToString("0000");
                    txtYear.Tag          = drwResult[Sys_PeriodTable.PERIODID_FLD].ToString();
                    txtMonth.Text        = Convert.ToDateTime(dtmFromDate.Value).Month.ToString();
                    btnCloseOpen.Enabled = true;
                }
            }
            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);
                }
            }
        }
コード例 #28
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);
                }
            }
        }
コード例 #29
0
        /// <summary>
        /// btnCustomer_Click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <author>Trada</author>
        /// <date>Friday, Feb 17 2006</date>
        private void btnCustomer_Click(object sender, System.EventArgs e)
        {
            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.WaitCursor;

            #endregion Code Inserted Automatically


            const string METHOD_NAME = THIS + ".btnCustomer_Click()";
            try
            {
                SelectCustomer(METHOD_NAME, 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, 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);
                }
            }

            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.Default;

            #endregion Code Inserted Automatically
        }
コード例 #30
0
        private void dgrdData_AfterColUpdate(object sender, ColEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_AfterColUpdate()";

            try
            {
                if (e.Column.DataColumn.DataField == ITM_ProductTable.CODE_FLD ||
                    e.Column.DataColumn.DataField == ITM_ProductTable.DESCRIPTION_FLD)
                {
                    if (e.Column.DataColumn.Tag == null || e.Column.DataColumn.Value.ToString() == string.Empty)
                    {
                        dgrdData[dgrdData.Row, ITM_ProductTable.CODE_FLD]        = string.Empty;
                        dgrdData[dgrdData.Row, ITM_ProductTable.PRODUCTID_FLD]   = null;
                        dgrdData[dgrdData.Row, ITM_ProductTable.DESCRIPTION_FLD] = string.Empty;
                        dgrdData[dgrdData.Row, ITM_ProductTable.REVISION_FLD]    = string.Empty;
                        dgrdData[dgrdData.Row, SEQUENCE_FLD] = string.Empty;
                        dgrdData[dgrdData.Row, ITM_ProductTable.PRODUCTIONLINEID_FLD] = string.Empty;
                    }
                    else
                    {
                        FillItemData((DataRow)e.Column.DataColumn.Tag);
                    }
                }
            }
            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);
                }
            }
        }