Beispiel #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            int intRecordsReturned;
            int intCounter;
            int intNumberOfRecords;

            //this will load up the controls

            cboJobType.Items.Add("Select Job Type");

            TheFindSortedJobTypeDataSet = TheJobTypeClass.FindSortedJobType();

            intNumberOfRecords = TheFindSortedJobTypeDataSet.FindSortedJobType.Rows.Count;

            for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
            {
                cboJobType.Items.Add(TheFindSortedJobTypeDataSet.FindSortedJobType[intCounter].JobType);
            }

            TheFindProductionProjectInfoDataSet = TheProductionProjectClass.FindProductionProjectInfo(MainWindow.gintProjectID);

            intRecordsReturned = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo.Rows.Count;

            if (intRecordsReturned > 0)
            {
                TheMessagesClass.ErrorMessage("The Production Project Has an Entry Already");

                this.Close();
            }
        }
Beispiel #2
0
        private void txtCustomerProjectID_TextChanged(object sender, TextChangedEventArgs e)
        {
            string strCustomerProjectID;
            int    intLength;
            int    intRecordsReturned;
            int    intBusinessLineID;

            try
            {
                strCustomerProjectID  = txtCustomerProjectID.Text;
                gstrAssignedProjectID = strCustomerProjectID;
                intLength             = strCustomerProjectID.Length;

                if (((intLength > 5) && (intLength < 12)) && gblnDoNotRun == false)
                {
                    TheFindProjectMatrixByCustomerProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByCustomerProjectID(strCustomerProjectID);

                    intRecordsReturned = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID.Rows.Count;

                    if (intRecordsReturned > 0)
                    {
                        gintProjectID     = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].ProjectID;
                        intBusinessLineID = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].BusinessLineID;

                        TheFindProductionProjectInfoDataSet = TheProductionProjectClass.FindProductionProjectInfo(gintProjectID);

                        intRecordsReturned = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo.Rows.Count;

                        if ((intRecordsReturned < 1) && (intBusinessLineID == 1009))
                        {
                            TheMessagesClass.InformationMessage("There is no Production Project Info Entered, The Window will now Open");

                            MainWindow.gintProjectID = gintProjectID;

                            AddProductionProjectInfo AddProductionProjectInfo = new AddProductionProjectInfo();
                            AddProductionProjectInfo.ShowDialog();
                        }

                        gblnProjectExists = true;

                        FillControls();
                    }
                }
                else if (intLength >= 12)
                {
                    TheMessagesClass.ErrorMessage("The Project is not the Correct Format");
                    return;
                }
            }
            catch (Exception Ex)
            {
                TheSendEmailClass.SendEventLog("New Blue Jay ERP // Edit Project // Customer Project ID Text Box " + Ex.ToString());

                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Edit Project // Customer Project ID Text Box " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            bool blnFatalError = false;
            int  intCounter;
            int  intNumberOfRecords;
            int  intSelectedIndex;

            try
            {
                TheFindSortedJobTypeDataSet = TheJobTypeClass.FindSortedJobType();

                cboSelectJobType.Items.Add("Select Job Type");

                intNumberOfRecords = TheFindSortedJobTypeDataSet.FindSortedJobType.Rows.Count;

                for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                {
                    cboSelectJobType.Items.Add(TheFindSortedJobTypeDataSet.FindSortedJobType[intCounter].JobType);
                }

                cboSelectJobType.SelectedIndex = 0;

                blnFatalError = TheEmployeeDateEntryClass.InsertIntoEmployeeDateEntry(MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID, "New Blue Jay ERP // Edit Production Project Info ");

                if (blnFatalError == true)
                {
                    throw new Exception();
                }

                TheFindProductionProjectInfoDataSet = TheProductionProjectClass.FindProductionProjectInfo(MainWindow.gintProjectID);

                intNumberOfRecords = cboSelectJobType.Items.Count;

                for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                {
                    cboSelectJobType.SelectedIndex = intCounter;

                    if (cboSelectJobType.SelectedItem.ToString() == TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].JobType)
                    {
                        intSelectedIndex = intCounter;
                    }
                }

                cboSelectJobType.SelectedIndex = intCounter;
                MainWindow.gintTransactionID   = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].TransactionID;
                txtPOAmount.Text = Convert.ToString(TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].POAmount);
                txtPOC.Text      = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].PointOfContact;
                txtPONumber.Text = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].PONumber;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Edit Production Project Info // Window Loaded Method " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
Beispiel #4
0
        private void expAddEditProjectInfo_Expanded(object sender, RoutedEventArgs e)
        {
            int intRecordsReturned;

            expAddEditProjectInfo.IsExpanded = false;
            MainWindow.gintProjectID         = gintProjectID;

            TheFindProductionProjectInfoDataSet = TheProductionProjectClass.FindProductionProjectInfo(MainWindow.gintProjectID);

            intRecordsReturned = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo.Rows.Count;

            if (intRecordsReturned < 1)
            {
                AddProductionProjectInfo AddProductionProjectInfo = new AddProductionProjectInfo();
                AddProductionProjectInfo.ShowDialog();
            }
            else if (intRecordsReturned > 0)
            {
                EditProductionProjectInfo EditProductionProjectInfo = new EditProductionProjectInfo();
                EditProductionProjectInfo.ShowDialog();
            }
        }
        private void btnFind_Click(object sender, RoutedEventArgs e)
        {
            string strCustomerProjectID;
            string strAssignedProjectID = "";
            string strProjectName;
            string strProjectUpdates = "";
            int    intRecordsReturned;
            int    intCounter;
            int    intNumberOfRecords;
            int    intStatusID;
            string strProjectNotes;
            bool   blnFatalError = false;

            try
            {
                //getting project id
                strCustomerProjectID = txtEnterProjectID.Text;

                if (strCustomerProjectID.Length < 1)
                {
                    TheMessageClass.ErrorMessage("The Project Information Was Not Entered");
                    return;
                }

                TheFindProjectMatrixByCustomerProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByCustomerProjectID(strCustomerProjectID);

                intRecordsReturned = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID.Rows.Count;

                if (intRecordsReturned > 1)
                {
                    TheMessageClass.ErrorMessage("The Project Has Been Entered More Than Once, Contact Admin");
                    return;
                }
                else if (intRecordsReturned < 1)
                {
                    strAssignedProjectID = strCustomerProjectID;

                    TheFindProjectMatrxiByAssignedProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByAssignedProjectID(strAssignedProjectID);

                    intRecordsReturned = TheFindProjectMatrxiByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID.Rows.Count;

                    if (intRecordsReturned == 0)
                    {
                        TheMessageClass.ErrorMessage("Project Not Found");
                        return;
                    }
                    else if (intRecordsReturned > 1)
                    {
                        TheMessageClass.InformationMessage("There are Multiple Projects with this Project ID, Please use the Customer Assigned ID");
                        return;
                    }
                    else if (intRecordsReturned == 1)
                    {
                        MainWindow.gintProjectID = TheFindProjectMatrxiByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID[0].ProjectID;
                        strCustomerProjectID     = TheFindProjectMatrxiByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID[0].CustomerAssignedID;
                    }
                }
                else if (intRecordsReturned == 1)
                {
                    MainWindow.gintProjectID = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].ProjectID;
                    strAssignedProjectID     = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].AssignedProjectID;
                }

                TheFindProductionProjectByProjectIDDataSet = TheProductionProjectClass.FindProductionProjectByProjectID(MainWindow.gintProjectID);
                TheFindProjectByProjectIDDataSet           = TheProjectClass.FindProjectByProjectID(MainWindow.gintProjectID);

                strProjectName  = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectName;
                strProjectNotes = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].ProjectNotes;

                intStatusID = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].CurrentStatusID;

                ClearRadioButtons();

                if (intStatusID == 1001)
                {
                    rdoOpen.IsChecked = true;
                }
                else if (intStatusID == 1002)
                {
                    rdoConComplete.IsChecked = true;
                }
                else if (intStatusID == 1003)
                {
                    rdoOnHold.IsChecked = true;
                }
                else if (intStatusID == 1004)
                {
                    rdoCancel.IsChecked = true;
                }
                else if (intStatusID == 1005)
                {
                    rdoInProcess.IsChecked = true;
                }
                else if (intStatusID == 1006)
                {
                    rdoClosed.IsChecked = true;
                }
                else if (intStatusID == 1007)
                {
                    rdoInvoiced.IsChecked = true;
                }
                else if (intStatusID == 1008)
                {
                    rdoSubmitted.IsChecked = true;
                }

                txtAssignedProjectID.Text = strAssignedProjectID;
                txtCustomerProjectID.Text = strCustomerProjectID;
                txtProjectName.Text       = strProjectName;
                txtProjectNotes.Text      = strProjectNotes;

                TheFindProductionProjectUpdateByProjectIDDataSet = TheProductionProjectUpdatesClass.FindProductionProjectUpdateByProjectID(MainWindow.gintProjectID);

                intNumberOfRecords = TheFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID.Rows.Count;

                if (intNumberOfRecords > 0)
                {
                    for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                    {
                        strProjectUpdates += Convert.ToString(TheFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID[intCounter].TransactionDate) + " - ";
                        strProjectUpdates += TheFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID[intCounter].ProjectUpdate + "\n\n";
                    }
                }

                txtProjectUpdates.Text = strProjectUpdates;

                TheFindProductionProjectInfoDataSet = TheProductionProjectClass.FindProductionProjectInfo(MainWindow.gintProjectID);

                intRecordsReturned = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo.Rows.Count;

                if (intRecordsReturned < 1)
                {
                    blnFatalError = TheProductionProjectClass.InsertProductionProjectInfo(MainWindow.gintProjectID, 0, " ", " ", 0);

                    if (blnFatalError == true)
                    {
                        throw new Exception();
                    }
                }
                else if (intRecordsReturned > 0)
                {
                    if (TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].HardRestoration == true)
                    {
                        chkHardRestoration.IsChecked = true;
                    }
                    else
                    {
                        chkHardRestoration.IsEnabled = false;
                    }
                    if (TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].QCPerformed == true)
                    {
                        chkQCPerformed.IsChecked = true;
                    }
                    else
                    {
                        chkQCPerformed.IsChecked = false;
                    }
                    if (TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].SplicingComple == true)
                    {
                        chkSplicingComplete.IsChecked = true;
                    }
                    else
                    {
                        chkSplicingComplete.IsChecked = false;
                    }
                }

                expViewDocuments.IsEnabled = true;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Update Project // Find Button " + Ex.Message);

                TheMessageClass.ErrorMessage(Ex.ToString());
            }
        }