Exemple #1
0
        private void FillControls()
        {
            //setting up local variables
            int intCounter;
            int intNumberOfRecords;
            int intDepartmentID;
            int intManagerID;
            int intOfficeID;
            int intStatusID;
            int intSelectedIndex = 0;
            int intRecordsReturned;

            try
            {
                TheFindProjectMatrixByProjectIDDataSet     = TheProjectMatrixClass.FindProjectMatrixByProjectID(gintProjectID);
                TheFindProjectByProjectIDDataSet           = TheProjectClass.FindProjectByProjectID(gintProjectID);
                TheFindProductionProjectByProjectIDDataSet = TheProductionProjectClass.FindProductionProjectByProjectID(gintProjectID);

                intRecordsReturned = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID.Rows.Count;

                if (intRecordsReturned < 1)
                {
                    TheMessagesClass.ErrorMessage("The Project Is Not Completely Entered, Please Go To Add Project");
                    return;
                }

                gintTransactionID = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].TransactionID;
                gblnDoNotRun      = true;

                if (gblnProjectExists == true)
                {
                    txtAssignedProjectID.Text = TheFindProjectMatrixByProjectIDDataSet.FindProjectMatrixByProjectID[0].AssignedProjectID;
                }


                if (gblnProjectExists == false)
                {
                    txtCustomerProjectID.Text = TheFindProjectMatrixByProjectIDDataSet.FindProjectMatrixByProjectID[0].CustomerAssignedID;
                }


                txtProjectName.Text  = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectName;
                txtAddress.Text      = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].BusinessAddress;
                txtCity.Text         = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].City;
                txtDateReceived.Text = Convert.ToString(TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].DateReceived);
                txtECDDate.Text      = Convert.ToString(TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].ECDDate);
                txtState.Text        = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].BusinessState;

                intManagerID    = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].ProjectManagerID;
                intStatusID     = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].CurrentStatusID;
                intDepartmentID = TheFindProjectMatrixByProjectIDDataSet.FindProjectMatrixByProjectID[0].DepartmentID;
                intOfficeID     = TheFindProjectMatrixByProjectIDDataSet.FindProjectMatrixByProjectID[0].WarehouseID;

                //loading comboboxes
                intNumberOfRecords = TheFindProductionManagersDataSet.FindProductionManagers.Rows.Count - 1;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    if (intManagerID == TheFindProductionManagersDataSet.FindProductionManagers[intCounter].EmployeeID)
                    {
                        intSelectedIndex = intCounter + 1;
                    }
                }

                cboSelectManager.SelectedIndex = intSelectedIndex;

                intNumberOfRecords = TheFindSortedCustomerLinesDataSet.FindSortedCustomerLines.Rows.Count - 1;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    if (intDepartmentID == TheFindSortedCustomerLinesDataSet.FindSortedCustomerLines[intCounter].DepartmentID)
                    {
                        intSelectedIndex = intCounter + 1;
                    }
                }

                cboSelectDepartment.SelectedIndex = intSelectedIndex;

                intNumberOfRecords = TheFindWarehousesDataSet.FindWarehouses.Rows.Count - 1;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    if (intOfficeID == TheFindWarehousesDataSet.FindWarehouses[intCounter].EmployeeID)
                    {
                        intSelectedIndex = intCounter + 1;
                    }
                }

                cboSelectOffice.SelectedIndex = intSelectedIndex;

                //setting up the buttons
                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;
                }

                const string     message = "Would You Like to Edit the Project Info?";
                const string     caption = "Please Answer";
                MessageBoxResult result  = MessageBox.Show(message, caption, MessageBoxButton.YesNo, MessageBoxImage.Question);

                if (result == MessageBoxResult.Yes)
                {
                    MainWindow.gintProjectID = gintProjectID;

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

                expAddEditProjectInfo.IsEnabled = true;
            }
            catch (Exception Ex)
            {
                TheSendEmailClass.SendEventLog("New Blue Jay ERP // Edit Project // Fill Controls " + Ex.ToString());

                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Edit Projects // Fill Controls " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
Exemple #2
0
        private void AddSaveRecord()
        {
            //setting local variables
            string strPartNumber;
            string strProject;
            int    intPartID    = 0;
            string strMSRNumber = "NOT REQUIRED";
            string strValueForValidation;
            int    intQuantity        = 0;
            bool   blnThereIsAProblem = false;
            bool   blnFatalError      = false;
            string strErrorMessage    = "";
            int    intRecordsFound;
            bool   blnProjectNotFound = false;
            bool   blnPartNotFound    = true;
            bool   blnKeyWordNotFound;
            int    intTotalQuantity;
            int    intProjectID       = 0;
            string strJDEPartNumber   = "";
            int    intEmployeeID      = 0;
            int    intEnterEmployeeID = 0;

            try
            {
                if (btnAdd.Content.ToString() == "Add")
                {
                    //loading controls
                    txtDateEntryComplete.Text = "NO";
                    txtDate.Text = Convert.ToString(DateTime.Now);

                    btnAdd.Content = "Save";
                }
                else
                {
                    if (MainWindow.gstrMenuSelection == "Issue")
                    {
                        if (cboSelectEmployee.SelectedIndex < 1)
                        {
                            blnFatalError    = true;
                            strErrorMessage += "Employee Was Not Selected\n";
                        }
                    }

                    //data validation
                    strProject = txtProjectID.Text;
                    if (strProject == "")
                    {
                        blnFatalError    = true;
                        strErrorMessage += "Project ID Was Not Entered\n";
                    }
                    else
                    {
                        TheFindProjectByAssignedProjectIDDataSet = TheProjectClass.FindProjectByAssignedProjectID(strProject);

                        intRecordsFound = TheFindProjectByAssignedProjectIDDataSet.FindProjectByAssignedProjectID.Rows.Count;

                        if (intRecordsFound == 0)
                        {
                            TheFindProjectByProjectNameDataSet = TheProjectClass.FindProjectByProjectName(strProject);

                            intRecordsFound = TheFindProjectByProjectNameDataSet.FindProjectByProjectName.Rows.Count;

                            if (intRecordsFound == 0)
                            {
                                blnThereIsAProblem = TheDataValidationClass.VerifyIntegerData(strProject);

                                if (blnThereIsAProblem == true)
                                {
                                    blnProjectNotFound = true;
                                }
                                else
                                {
                                    TheFindProjectByProjectIDDataSet = TheProjectClass.FindProjectByProjectID(Convert.ToInt32(strProject));

                                    intRecordsFound = TheFindProjectByProjectIDDataSet.FindProjectByProjectID.Rows.Count;

                                    if (intRecordsFound == 0)
                                    {
                                        blnProjectNotFound = true;
                                    }
                                    else
                                    {
                                        intProjectID = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectID;
                                        strProject   = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].AssignedProjectID;
                                    }
                                }
                            }
                            else
                            {
                                strProject   = TheFindProjectByProjectNameDataSet.FindProjectByProjectName[0].AssignedProjectID;
                                intProjectID = TheFindProjectByProjectNameDataSet.FindProjectByProjectName[0].ProjectID;
                            }
                        }
                        else
                        {
                            intProjectID = TheFindProjectByAssignedProjectIDDataSet.FindProjectByAssignedProjectID[0].ProjectID;
                        }

                        if (blnProjectNotFound == true)
                        {
                            blnFatalError    = true;
                            strErrorMessage += "Project Was Not Found\n";
                        }
                    }
                    if (MainWindow.gstrMenuSelection == "Receive")
                    {
                        strMSRNumber = txtMSRPONumber.Text;
                        if (strMSRNumber == "")
                        {
                            blnFatalError    = true;
                            strErrorMessage += "MSR or PO Number Was Not Entered\n";
                        }
                        else if (strMSRNumber == "NO MSR NUMBER PROVIDED")
                        {
                            blnFatalError    = true;
                            strErrorMessage += "NO MSR NUMBER PROVIDED Cannot Be Entered\n";
                        }
                    }
                    strPartNumber = txtPartNumber.Text;
                    if (strPartNumber == "")
                    {
                        blnFatalError    = true;
                        strErrorMessage += "Part Number Was Not Entered\n";
                    }
                    else
                    {
                        blnPartNotFound = true;

                        blnThereIsAProblem = TheDataValidationClass.VerifyIntegerData(strPartNumber);
                        if (blnThereIsAProblem == false)
                        {
                            intPartID = Convert.ToInt32(strPartNumber);

                            TheFindPartByPartIDDataSet = ThePartNumberClass.FindPartByPartID(intPartID);

                            intRecordsFound = TheFindPartByPartIDDataSet.FindPartByPartID.Rows.Count;

                            if (intRecordsFound == 1)
                            {
                                blnPartNotFound  = false;
                                strPartNumber    = TheFindPartByPartIDDataSet.FindPartByPartID[0].PartNumber;
                                strJDEPartNumber = TheFindPartByPartIDDataSet.FindPartByPartID[0].JDEPartNumber;
                            }
                        }

                        if (blnPartNotFound == true)
                        {
                            TheFindPartByPartNumberDataSet = ThePartNumberClass.FindPartByPartNumber(strPartNumber);

                            intRecordsFound = TheFindPartByPartNumberDataSet.FindPartByPartNumber.Rows.Count;

                            if (intRecordsFound == 1)
                            {
                                blnPartNotFound  = false;
                                intPartID        = TheFindPartByPartNumberDataSet.FindPartByPartNumber[0].PartID;
                                strJDEPartNumber = TheFindPartByPartNumberDataSet.FindPartByPartNumber[0].JDEPartNumber;
                            }

                            if (blnPartNotFound == true)
                            {
                                TheFindPartByJDEPartNumber = ThePartNumberClass.FindPartByJDEPartNumber(strPartNumber);

                                intRecordsFound = TheFindPartByJDEPartNumber.FindPartByJDEPartNumber.Rows.Count;

                                if (intRecordsFound == 1)
                                {
                                    blnPartNotFound  = false;
                                    intPartID        = TheFindPartByJDEPartNumber.FindPartByJDEPartNumber[0].PartID;
                                    strPartNumber    = TheFindPartByJDEPartNumber.FindPartByJDEPartNumber[0].PartNumber;
                                    strJDEPartNumber = TheFindPartByJDEPartNumber.FindPartByJDEPartNumber[0].JDEPartNumber;
                                }
                            }
                        }

                        if (MainWindow.gstrWarehouseName != "TRAINING")
                        {
                            //checking to see if non charter number
                            blnKeyWordNotFound = TheKeyWordClass.FindKeyWord("JH", MainWindow.gstrWarehouseName);

                            if (blnKeyWordNotFound == true)
                            {
                                if (strJDEPartNumber == "NOT REQUIRED")
                                {
                                    blnFatalError    = true;
                                    strErrorMessage += "Using Non Charter Part Number for Charter Warehouse\n";
                                }

                                if (strJDEPartNumber == "NOT PROVIDED")
                                {
                                    blnFatalError    = true;
                                    strErrorMessage += "Using Non Charter Part Number for Charter Warehouse\n";
                                }
                            }
                        }

                        if (blnPartNotFound == true)
                        {
                            blnFatalError    = true;
                            strErrorMessage += "Part Number Not Found\n";
                        }
                    }

                    //validating the Quantity
                    strValueForValidation = txtQuantity.Text;
                    blnThereIsAProblem    = TheDataValidationClass.VerifyIntegerData(strValueForValidation);
                    if (blnThereIsAProblem == true)
                    {
                        blnFatalError    = true;
                        strErrorMessage += "The Quantity Entered is not an Integer\n";
                    }
                    else
                    {
                        intQuantity = Convert.ToInt32(strValueForValidation);
                    }

                    if (blnFatalError == true)
                    {
                        TheMessagesClass.ErrorMessage(strErrorMessage);
                        return;
                    }

                    //checking quantity for issuing
                    if (MainWindow.gstrMenuSelection == "Issue")
                    {
                        TheFindWarehouseInventoryPartDataSet = TheInventoryClass.FindWarehouseInventoryPart(intPartID, MainWindow.gintWarehouseID);

                        intRecordsFound = TheFindWarehouseInventoryPartDataSet.FindWarehouseInventoryPart.Rows.Count;

                        if (intRecordsFound == 0)
                        {
                            intTotalQuantity = 0;
                        }
                        else
                        {
                            intTotalQuantity = TheFindWarehouseInventoryPartDataSet.FindWarehouseInventoryPart[0].Quantity;
                        }

                        intTotalQuantity = CalculateWIPCount(intPartID, MainWindow.gintWarehouseID, intTotalQuantity);

                        if (intQuantity > intTotalQuantity)
                        {
                            TheMessagesClass.ErrorMessage("The Quantity Issued is greater than the Quantity On The Shelf");
                            return;
                        }
                    }

                    if (MainWindow.gstrMenuSelection == "Issue")
                    {
                        intEmployeeID      = gintSelectedEmployeeID;
                        intEnterEmployeeID = MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID;
                    }
                    else
                    {
                        intEmployeeID = MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID;
                    }

                    blnFatalError = TheInventoryWIPClass.InsertDataEntryWIP(MainWindow.gintSessionID, intPartID, strPartNumber, intProjectID, strProject, strMSRNumber, MainWindow.gintWarehouseID, intQuantity, intEmployeeID, MainWindow.gstrMenuSelection.ToUpper());

                    if (blnFatalError == true)
                    {
                        TheMessagesClass.ErrorMessage("There Has Been A Problem. Contact IT");
                        return;
                    }

                    ClearControls();
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Enter Inventory \\ Enter Material \\ Add Button During Save " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //setting local variables
            int     intCounter;
            int     intNumberOfRecords;
            int     intProjectID         = 0;
            int     intTaskID            = 0;
            decimal decTotalFootage      = 0;
            string  strWorkTask          = "";
            string  strAssignedProjectID = "";
            bool    blnItemFound;
            int     intSummaryCounter;
            decimal decHours;
            int     intSecondCounter;
            int     intSecondNumberOfRecords;


            PleaseWait PleaseWait = new PleaseWait();

            PleaseWait.Show();

            gdecTotalHours = 0;

            try
            {
                TheFindEmployeeByEmployeeIDDataSet = TheEmployeeClass.FindEmployeeByEmployeeID(MainWindow.gintEmployeeID);

                MainWindow.gstrFirstName = TheFindEmployeeByEmployeeIDDataSet.FindEmployeeByEmployeeID[0].FirstName;
                MainWindow.gstrLastName  = TheFindEmployeeByEmployeeIDDataSet.FindEmployeeByEmployeeID[0].LastName;

                TheFindEmployeeTaskHoursByEmployeeIDDataSet = TheEmployeeProjectAssignmentClass.FindEmployeeTaskHoursByEmployeeID(MainWindow.gintEmployeeID, MainWindow.gdatStartDate, MainWindow.gdatEndDate);

                intNumberOfRecords = TheFindEmployeeTaskHoursByEmployeeIDDataSet.FindEmployeeTaskHoursByEmployeeID.Rows.Count - 1;

                gintSummaryCounter         = 0;
                gintSummaryNumberOfRecords = 0;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    gdecTotalHours += TheFindEmployeeTaskHoursByEmployeeIDDataSet.FindEmployeeTaskHoursByEmployeeID[intCounter].EmployeeTotalHours;
                    intProjectID    = TheFindEmployeeTaskHoursByEmployeeIDDataSet.FindEmployeeTaskHoursByEmployeeID[intCounter].ProjectID;
                    intTaskID       = TheFindEmployeeTaskHoursByEmployeeIDDataSet.FindEmployeeTaskHoursByEmployeeID[intCounter].TaskID;
                    decHours        = TheFindEmployeeTaskHoursByEmployeeIDDataSet.FindEmployeeTaskHoursByEmployeeID[intCounter].EmployeeTotalHours;
                    blnItemFound    = false;
                    TheFindProjectByProjectIDDataSet = TheProjectClass.FindProjectByProjectID(intProjectID);
                    strAssignedProjectID             = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].AssignedProjectID;
                    TheFindWorkTaskByTaskIDDataSet   = TheWorkTaskClass.FindWorkTaskByWorkTaskID(intTaskID);
                    strWorkTask = TheFindWorkTaskByTaskIDDataSet.FindWorkTaskByWorkTaskID[0].WorkTask;

                    if (gintSummaryCounter > 0)
                    {
                        for (intSummaryCounter = 0; intSummaryCounter <= gintSummaryNumberOfRecords; intSummaryCounter++)
                        {
                            if (strAssignedProjectID == TheEmployeeProjectSummaryDataSet.projectsummary[intSummaryCounter].AssignedProjectID)
                            {
                                if (strWorkTask == TheEmployeeProjectSummaryDataSet.projectsummary[intSummaryCounter].WorkTask)
                                {
                                    TheEmployeeProjectSummaryDataSet.projectsummary[intSummaryCounter].TotalHours += decHours;
                                    blnItemFound = true;
                                }
                            }
                        }
                    }

                    if (blnItemFound == false)
                    {
                        EmployeeProjectSummaryDataSet.projectsummaryRow NewTaskRow = TheEmployeeProjectSummaryDataSet.projectsummary.NewprojectsummaryRow();

                        NewTaskRow.AssignedProjectID  = strAssignedProjectID;
                        NewTaskRow.TotalFootagePieces = decTotalFootage;
                        NewTaskRow.TotalHours         = decHours;
                        NewTaskRow.WorkTask           = strWorkTask;
                        NewTaskRow.TaskID             = intTaskID;
                        NewTaskRow.ProjectID          = intProjectID;

                        TheEmployeeProjectSummaryDataSet.projectsummary.Rows.Add(NewTaskRow);
                        gintSummaryNumberOfRecords = gintSummaryCounter;
                        gintSummaryCounter++;
                    }
                }

                intNumberOfRecords = TheEmployeeProjectSummaryDataSet.projectsummary.Rows.Count - 1;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    intProjectID    = TheEmployeeProjectSummaryDataSet.projectsummary[intCounter].ProjectID;
                    intTaskID       = TheEmployeeProjectSummaryDataSet.projectsummary[intCounter].TaskID;
                    decTotalFootage = 0;

                    TheFindProjectTaskEmployeeStatsDataSet = TheEmployeeProductivityStatsClass.FindProjectTaskEmployeeStats(MainWindow.gintEmployeeID, intProjectID, MainWindow.gdatStartDate, MainWindow.gdatEndDate);

                    intSecondNumberOfRecords = TheFindProjectTaskEmployeeStatsDataSet.FindProjectTaskEmployeeStats.Rows.Count - 1;

                    if (intSecondNumberOfRecords > -1)
                    {
                        for (intSecondCounter = 0; intSecondCounter <= intSecondNumberOfRecords; intSecondCounter++)
                        {
                            if (intTaskID == TheFindProjectTaskEmployeeStatsDataSet.FindProjectTaskEmployeeStats[intSecondCounter].WorkTaskID)
                            {
                                decTotalFootage += TheFindProjectTaskEmployeeStatsDataSet.FindProjectTaskEmployeeStats[intSecondCounter].FootagePieces;
                            }
                        }
                    }

                    TheEmployeeProjectSummaryDataSet.projectsummary[intCounter].TotalFootagePieces = decTotalFootage;
                }

                txtTotalHours.Text     = Convert.ToString(gdecTotalHours);
                dgrResults.ItemsSource = TheEmployeeProjectSummaryDataSet.projectsummary;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Find Employee Hours // Generate Report Menu Item " + Ex.Message);

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

            PleaseWait.Close();
        }
Exemple #4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            int    intCounter;
            int    intNumberOfRecords;
            string strUpdate = "";
            int    intStatusID;

            try
            {
                TheFindProjectMatrixByProjectProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByProjectID(MainWindow.gintProjectID);
                TheFindProjectByProjectIDDataSet           = TheProjectClass.FindProjectByProjectID(MainWindow.gintProjectID);
                TheFindProductionProjectByProjectIDDataSet = TheProductionProjectClass.FindProductionProjectByProjectID(MainWindow.gintProjectID);

                txtAssignedProjectID.Text = TheFindProjectMatrixByProjectProjectIDDataSet.FindProjectMatrixByProjectID[0].AssignedProjectID;
                txtCustomerProjectID.Text = TheFindProjectMatrixByProjectProjectIDDataSet.FindProjectMatrixByProjectID[0].CustomerAssignedID;
                txtProjectName.Text       = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectName;
                intStatusID          = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].CurrentStatusID;
                txtProjectNotes.Text = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].ProjectNotes;

                TheFindProductionProjectUpdateByProjectIDDataSet = TheProductionProjectUpdatesClass.FindProductionProjectUpdateByProjectID(MainWindow.gintProjectID);

                intNumberOfRecords = TheFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID.Rows.Count;

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

                txtProjectUpdates.Text = strUpdate;

                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;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Update Selected Project // Window Loaded Method " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
Exemple #5
0
        private void CheckProject()
        {
            //setting local variables
            string   strProjectID;
            int      intRecordsReturned;
            DateTime datTransactionDate = DateTime.Now;
            DateTime datTodaysDate      = DateTime.Now;
            bool     blnFatalError      = false;
            int      intEmployeeID;
            decimal  decHours;
            DateTime datEndDate;
            int      intHours;
            int      intRemainder;

            try
            {
                datEndDate = TheDateSearchClass.SubtractingDays(datTodaysDate, 21);

                blnFatalError = TheDataValidationClass.VerifyDateData(txtEnterDate.Text);
                if (blnFatalError == true)
                {
                    TheMessagesClass.ErrorMessage("The Date Entered is not a Date");
                    return;
                }
                else
                {
                    datTransactionDate = Convert.ToDateTime(txtEnterDate.Text);
                }
                if (datTransactionDate > datTodaysDate)
                {
                    TheMessagesClass.ErrorMessage("The Date Entered is in the Future");
                    return;
                }

                blnFatalError = TheDataValidationClass.VerifyDoubleData(txtEnterHours.Text);
                if (blnFatalError == true)
                {
                    TheMessagesClass.ErrorMessage("Total Hours is not Numeric");
                    return;
                }

                if (gblnProjectFound == false)
                {
                    strProjectID = txtEnterProjectID.Text;

                    TheFindProjectMatrixByCustomerProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByCustomerProjectID(strProjectID);

                    intRecordsReturned = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID.Rows.Count;

                    if (intRecordsReturned == 0)
                    {
                        TheFindProjectMatrixByAssignedProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByAssignedProjectID(strProjectID);

                        intRecordsReturned = TheFindProjectMatrixByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID.Rows.Count;

                        if (intRecordsReturned == 0)
                        {
                            TheMessagesClass.ErrorMessage("Project Not Found, A Valid Project Must Be Entered");
                            return;
                        }
                        else
                        {
                            MainWindow.gintProjectID = TheFindProjectMatrixByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID[0].ProjectID;
                        }
                    }
                    else
                    {
                        MainWindow.gintProjectID = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].ProjectID;
                    }

                    if (MainWindow.gintProjectID == 104330)
                    {
                        TheMessagesClass.ErrorMessage("You do not have to Enter the Project Shop.  Place the hours for Non-Productive Time in the Non-Prod Time Box");
                        gblnProjectFound = false;
                        return;
                    }

                    TheFindProjectByProjectIDDataSet = TheProjectClass.FindProjectByProjectID(MainWindow.gintProjectID);

                    MainWindow.gstrAssignedProjectID = strProjectID;

                    txtProjectName.Text = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectName;

                    gblnProjectFound = true;
                    intEmployeeID    = MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID;
                    decHours         = Convert.ToDecimal(txtEnterHours.Text);

                    intHours = Convert.ToInt32(decHours * 100);

                    intRemainder = intHours % 25;

                    if (intRemainder > 0)
                    {
                        TheMessagesClass.ErrorMessage("The Hours Inputted are not a .25, .5, .75. .00. The Transaction is Rejected");
                        return;
                    }

                    blnFatalError = TheProductivityDataEntryClass.InsertProductivityDataEntry(intEmployeeID, MainWindow.gintProjectID, datTodaysDate, decHours, 0, 0);

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

                    TheFindProductivityDataEntryByDateDataSet = TheProductivityDataEntryClass.FindProductivityDataEntryByDate(datTodaysDate);

                    gintDataEntryTransactionID = TheFindProductivityDataEntryByDateDataSet.FindProductivtyDataEntryByDate[0].TransactionID;

                    gintEmployeeCounter = 0;
                    gintTaskCounter     = 0;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Add Project Labor // Check Project " + Ex.Message);

                TheSendEmailClass.SendEventLog("New Blue Jay ERP // Add Project Labor // Check Project " + Ex.ToString());

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
Exemple #6
0
        private void btnFind_Click(object sender, RoutedEventArgs e)
        {
            //setting local variables
            int      intRecordsReturned = 0;
            string   strProject;
            int      intProjectID         = 0;
            string   strAssignedProjectID = "";
            string   strProjectName       = "";
            DateTime datTransactionDate   = DateTime.Now;
            bool     blnNotInteger;
            bool     blnItemNotFound = true;

            try
            {
                //data validation
                strProject = txtEnterProject.Text;
                if (strProject == "")
                {
                    TheMessagesClass.ErrorMessage("Project Information was not Entered");
                    return;
                }

                //checking to see if this is an integer
                blnNotInteger = TheDataValidationClass.VerifyIntegerData(strProject);

                if (blnNotInteger == false)
                {
                    intProjectID = Convert.ToInt32(strProject);

                    //checking to see if project exists
                    MainWindow.TheFindProjectByProjectIDDataSet = TheProjectClass.FindProjectByProjectID(intProjectID);

                    intRecordsReturned = MainWindow.TheFindProjectByProjectIDDataSet.FindProjectByProjectID.Rows.Count;

                    if (intRecordsReturned != 0)
                    {
                        blnItemNotFound      = false;
                        intProjectID         = MainWindow.TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectID;
                        strAssignedProjectID = MainWindow.TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].AssignedProjectID;
                        strProjectName       = MainWindow.TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectName;
                        datTransactionDate   = MainWindow.TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].TransactionDate;
                    }
                }

                if (blnItemNotFound == true)
                {
                    MainWindow.TheFindProjectsByAssignedProjectIDDataSet = TheProjectClass.FindProjectByAssignedProjectID(strProject);

                    intRecordsReturned = MainWindow.TheFindProjectsByAssignedProjectIDDataSet.FindProjectByAssignedProjectID.Rows.Count;

                    if (intRecordsReturned != 0)
                    {
                        blnItemNotFound      = false;
                        intProjectID         = MainWindow.TheFindProjectsByAssignedProjectIDDataSet.FindProjectByAssignedProjectID[0].ProjectID;
                        strAssignedProjectID = MainWindow.TheFindProjectsByAssignedProjectIDDataSet.FindProjectByAssignedProjectID[0].AssignedProjectID;
                        strProjectName       = MainWindow.TheFindProjectsByAssignedProjectIDDataSet.FindProjectByAssignedProjectID[0].ProjectName;
                        datTransactionDate   = MainWindow.TheFindProjectsByAssignedProjectIDDataSet.FindProjectByAssignedProjectID[0].TransactionDate;
                    }
                }

                if (blnItemNotFound == true)
                {
                    MainWindow.TheFindProjectByProjectNameDataSet = TheProjectClass.FindProjectByProjectName(strProject);

                    intRecordsReturned = MainWindow.TheFindProjectByProjectNameDataSet.FindProjectByProjectName.Rows.Count;

                    if (intRecordsReturned != 0)
                    {
                        blnItemNotFound      = false;
                        intProjectID         = MainWindow.TheFindProjectByProjectNameDataSet.FindProjectByProjectName[0].ProjectID;
                        strAssignedProjectID = MainWindow.TheFindProjectByProjectNameDataSet.FindProjectByProjectName[0].AssignedProjectID;
                        strProjectName       = MainWindow.TheFindProjectByProjectNameDataSet.FindProjectByProjectName[0].ProjectName;
                        datTransactionDate   = MainWindow.TheFindProjectByProjectNameDataSet.FindProjectByProjectName[0].TransactionDate;
                    }
                }

                if (blnItemNotFound == true)
                {
                    TheMessagesClass.InformationMessage("Project Not Found");
                    return;
                }

                txtAssignedProjectID.Text = strAssignedProjectID;
                txtProjectID.Text         = Convert.ToString(intProjectID);
                txtProjectName.Text       = strProjectName;
                txtTransactionDate.Text   = Convert.ToString(datTransactionDate);
                mitSave.IsEnabled         = true;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Edit Project // Find Button " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
        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());
            }
        }
        private void txtEnterLastLame_TextChanged(object sender, TextChangedEventArgs e)
        {
            //setting local variables
            string   strProjectID;
            int      intRecordsReturned;
            string   strLastName;
            int      intLength;
            int      intCounter;
            int      intNumberOfRecords;
            DateTime datTransactionDate = DateTime.Now;
            DateTime datTodaysDate      = DateTime.Now;
            bool     blnFatalError      = false;
            int      intEmployeeID;
            decimal  decHours;
            DateTime datEndDate;


            try
            {
                datEndDate = TheDateSearchClass.SubtractingDays(datTodaysDate, 21);

                blnFatalError = TheDataValidationClass.VerifyDateData(txtTransactionDate.Text);
                if (blnFatalError == true)
                {
                    TheMessagesClass.ErrorMessage("The Date Entered is not a Date");
                    return;
                }
                else
                {
                    datTransactionDate = Convert.ToDateTime(txtTransactionDate.Text);
                }
                if (datTransactionDate > datTodaysDate)
                {
                    TheMessagesClass.ErrorMessage("The Date Entered is in the Future");
                    return;
                }

                if (gblnProjectFound == false)
                {
                    strProjectID = txtEnterProjectID.Text;

                    TheFindProjectMatrixByCustomerProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByCustomerProjectID(strProjectID);

                    intRecordsReturned = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID.Rows.Count;

                    if (intRecordsReturned == 0)
                    {
                        TheFindProjectMatrixByAssignedProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByAssignedProjectID(strProjectID);

                        intRecordsReturned = TheFindProjectMatrixByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID.Rows.Count;

                        if (intRecordsReturned == 0)
                        {
                            TheMessagesClass.ErrorMessage("Project Not Found, A Valid Project Must Be Entered");
                            return;
                        }
                        else
                        {
                            MainWindow.gintProjectID = TheFindProjectMatrixByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID[0].ProjectID;
                        }
                    }
                    else
                    {
                        MainWindow.gintProjectID = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].ProjectID;
                    }

                    TheFindProjectByProjectIDDataSet = TheProjectClass.FindProjectByProjectID(MainWindow.gintProjectID);

                    MainWindow.gstrAssignedProjectID = strProjectID;

                    txtProjectName.Text = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectName;

                    gblnProjectFound = true;
                    intEmployeeID    = MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID;
                    decHours         = Convert.ToDecimal(txtEnterHours.Text);

                    blnFatalError = TheProductivityDataEntryClass.InsertProductivityDataEntry(intEmployeeID, MainWindow.gintProjectID, datTodaysDate, decHours, 0, 0);

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

                    TheFindProductivityDataEntryByDateDataSet = TheProductivityDataEntryClass.FindProductivityDataEntryByDate(datTodaysDate);

                    gintDataEntryTransactionID = TheFindProductivityDataEntryByDateDataSet.FindProductivtyDataEntryByDate[0].TransactionID;

                    gintEmployeeCounter = 0;
                    gintTaskCounter     = 0;
                }

                strLastName = txtEnterLastLame.Text;
                intLength   = strLastName.Length;

                if (intLength > 2)
                {
                    cboSelectEmployee.Items.Clear();
                    cboSelectEmployee.Items.Add("Select Employee");

                    TheFindEmployeeByLastNameEndDateDataSet = TheEmployeeClass.FindEmployeeByLastNameEndDate(strLastName, datEndDate);

                    intNumberOfRecords = TheFindEmployeeByLastNameEndDateDataSet.FindEmployeesByLastNameEndDate.Rows.Count - 1;

                    if (intNumberOfRecords == -1)
                    {
                        TheMessagesClass.InformationMessage("Employee Not Found");
                        return;
                    }
                    else
                    {
                        for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                        {
                            cboSelectEmployee.Items.Add(TheFindEmployeeByLastNameEndDateDataSet.FindEmployeesByLastNameEndDate[intCounter].FirstName + " " + TheFindEmployeeByLastNameEndDateDataSet.FindEmployeesByLastNameEndDate[intCounter].LastName);
                        }
                    }

                    cboSelectEmployee.SelectedIndex = 0;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Add Project Labor // Enter Last Name Text Change Event " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
Exemple #9
0
        private void txtCustomerProjectID_TextChanged(object sender, TextChangedEventArgs e)
        {
            string strCustomerProjectID;
            int    intLength;
            int    intCounter;
            int    intNumberOfRecords;
            int    intRecordsReturned;
            int    intManagerID;
            int    intDepartmentID;
            int    intOfficeID;
            int    intSelectedIndex = 0;
            int    intStatusID;
            string strCustomerIDProjectID;
            string strAssignedProjectID;

            try
            {
                strCustomerProjectID = txtCustomerProjectID.Text;
                intLength            = strCustomerProjectID.Length;
                //ClearDateEntryControls();

                if (intLength > 3)
                {
                    TheFindProjectByAssignedProjectIDDataSet = TheProjectClass.FindProjectByAssignedProjectID(strCustomerProjectID);

                    intRecordsReturned = TheFindProjectByAssignedProjectIDDataSet.FindProjectByAssignedProjectID.Rows.Count;

                    if (intRecordsReturned < 1)
                    {
                        TheFindProjectMatrixByCustomerProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByCustomerProjectID(strCustomerProjectID);

                        intRecordsReturned = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID.Rows.Count;

                        if (intRecordsReturned < 1)
                        {
                            gblnProjectExists = false;
                        }
                        else if (intRecordsReturned > 0)
                        {
                            txtAssignedProjectID.Text = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].AssignedProjectID;
                        }
                    }
                    else
                    {
                        gblnProjectExists = true;

                        gintProjectID = TheFindProjectByAssignedProjectIDDataSet.FindProjectByAssignedProjectID[0].ProjectID;

                        TheFindDesignProjectsbyAssignedProjectIDDataSet = TheDesignProjectsClass.FindDesignProjectsByAssignedProjectID(strCustomerProjectID);

                        intRecordsReturned = TheFindDesignProjectsbyAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID.Rows.Count;

                        if (intRecordsReturned > 0)
                        {
                            txtAddress.Text      = TheFindDesignProjectsbyAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID[0].ProjectAddress;
                            txtCity.Text         = TheFindDesignProjectsbyAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID[0].City;
                            txtProjectName.Text  = TheFindProjectByAssignedProjectIDDataSet.FindProjectByAssignedProjectID[0].ProjectName;
                            txtDateReceived.Text = Convert.ToString(TheFindDesignProjectsbyAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID[0].DateReceived);

                            intOfficeID = TheFindDesignProjectsbyAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID[0].OfficeID;

                            intNumberOfRecords = TheFindWarehousesDataSet.FindWarehouses.Rows.Count - 1;

                            for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                            {
                                if (intOfficeID == TheFindWarehousesDataSet.FindWarehouses[intCounter].EmployeeID)
                                {
                                    intSelectedIndex = intCounter + 1;
                                    cboSelectOffice.SelectedIndex = intSelectedIndex;
                                }
                            }
                        }

                        TheFindProjectMatrixByProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByProjectID(gintProjectID);

                        intRecordsReturned = TheFindProjectMatrixByProjectIDDataSet.FindProjectMatrixByProjectID.Rows.Count;

                        if (intRecordsReturned < 1)
                        {
                            gblnProjectMatrixExists = false;

                            cboSelectStatus.IsEnabled = true;

                            intNumberOfRecords = TheFindWorkOrderStatusSortedDataSet.FindWorkOrderStatusSorted.Rows.Count - 1;

                            for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                            {
                                cboSelectStatus.Items.Add(TheFindWorkOrderStatusSortedDataSet.FindWorkOrderStatusSorted[intCounter].WorkOrderStatus);

                                if (TheFindWorkOrderStatusSortedDataSet.FindWorkOrderStatusSorted[intCounter].WorkOrderStatus == "OPEN")
                                {
                                    intSelectedIndex = intCounter + 1;
                                }
                            }

                            cboSelectStatus.SelectedIndex = intSelectedIndex;

                            cboSelectStatus.IsEnabled = false;
                        }
                        else
                        {
                            gblnProjectMatrixExists = true;

                            strCustomerIDProjectID    = TheFindProjectMatrixByProjectIDDataSet.FindProjectMatrixByProjectID[0].CustomerAssignedID;
                            strAssignedProjectID      = TheFindProjectMatrixByProjectIDDataSet.FindProjectMatrixByProjectID[0].AssignedProjectID;
                            txtAssignedProjectID.Text = strAssignedProjectID;

                            TheFindProductionProjectByProjectIDDataSet = TheProductionProjectClass.FindProductionProjectByProjectID(gintProjectID);

                            intRecordsReturned = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID.Rows.Count;

                            if (intRecordsReturned < 1)
                            {
                                TheFindDesignProjectsbyAssignedProjectIDDataSet = TheDesignProjectsClass.FindDesignProjectsByAssignedProjectID(strCustomerIDProjectID);

                                intRecordsReturned = TheFindDesignProjectsbyAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID.Rows.Count;

                                if (intRecordsReturned > 0)
                                {
                                    txtAddress.Text = TheFindDesignProjectsbyAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID[0].ProjectAddress;
                                    txtCity.Text    = TheFindDesignProjectsbyAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID[0].City;
                                }

                                TheMessagesClass.InformationMessage("The Project Has Been Entered, but is Missing Some Information");

                                SetControlsReadOnly(false);
                            }
                            else if (intRecordsReturned > 0)
                            {
                                SetControlsReadOnly(true);
                                txtAddress.Text                  = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].BusinessAddress;
                                txtCity.Text                     = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].City;
                                txtDateReceived.Text             = Convert.ToString(TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].DateReceived);
                                txtECDDate.Text                  = Convert.ToString(TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].ECDDate);
                                TheFindProjectByProjectIDDataSet = TheProjectClass.FindProjectByProjectID(gintProjectID);
                                txtProjectName.Text              = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectName;
                                txtPRojectNotes.Text             = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].ProjectNotes;
                                txtState.Text                    = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].BusinessState;

                                //setting the combo boxes;
                                intNumberOfRecords = TheFindWorkOrderStatusSortedDataSet.FindWorkOrderStatusSorted.Rows.Count - 1;
                                intStatusID        = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].CurrentStatusID;

                                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                                {
                                    if (intStatusID == TheFindWorkOrderStatusSortedDataSet.FindWorkOrderStatusSorted[intCounter].StatusID)
                                    {
                                        intSelectedIndex = intCounter + 1;
                                    }
                                }

                                cboSelectStatus.SelectedIndex = intSelectedIndex;

                                intManagerID = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].ProjectManagerID;

                                intNumberOfRecords = TheFindProductionManagersDataSet.FindProductionManagers.Rows.Count - 1;

                                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                                {
                                    if (intManagerID == TheFindProductionManagersDataSet.FindProductionManagers[intCounter].EmployeeID)
                                    {
                                        intSelectedIndex = intCounter + 1;
                                    }
                                }

                                cboSelectManager.SelectedIndex = intSelectedIndex;

                                intDepartmentID = TheFindProjectMatrixByProjectIDDataSet.FindProjectMatrixByProjectID[0].DepartmentID;

                                intNumberOfRecords = TheFindSortedCustomerLinesDataSet.FindSortedCustomerLines.Rows.Count - 1;

                                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                                {
                                    if (intDepartmentID == TheFindSortedCustomerLinesDataSet.FindSortedCustomerLines[intCounter].DepartmentID)
                                    {
                                        intSelectedIndex = intCounter + 1;
                                    }
                                }

                                cboSelectDepartment.SelectedIndex = intSelectedIndex;

                                intOfficeID = TheFindProjectMatrixByProjectIDDataSet.FindProjectMatrixByProjectID[0].WarehouseID;

                                intNumberOfRecords = TheFindWarehousesDataSet.FindWarehouses.Rows.Count - 1;

                                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                                {
                                    if (intOfficeID == TheFindWarehousesDataSet.FindWarehouses[intCounter].EmployeeID)
                                    {
                                        intSelectedIndex = intCounter + 1;
                                    }
                                }

                                cboSelectOffice.SelectedIndex = intSelectedIndex;

                                TheMessagesClass.InformationMessage("The Project Has Been Entered");
                            }
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Add Project // Customer Project ID Text Box " + Ex.Message);

                TheSendEmailClass.SendEventLog("New Blue Jay ERP // Add Project // Customer Project ID Text Box " + Ex.ToString());

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