private void dgrOpenProblems_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid     dataGrid;
            DataGridRow  selectedRow;
            DataGridCell ProblemID;
            string       strProblemID;

            try
            {
                if (dgrOpenProblems.SelectedIndex > -1)
                {
                    //setting local variable
                    dataGrid     = dgrOpenProblems;
                    selectedRow  = (DataGridRow)dataGrid.ItemContainerGenerator.ContainerFromIndex(dataGrid.SelectedIndex);
                    ProblemID    = (DataGridCell)dataGrid.Columns[0].GetCellContent(selectedRow).Parent;
                    strProblemID = ((TextBlock)ProblemID.Content).Text;

                    //find the record
                    MainWindow.gintProblemID = Convert.ToInt32(strProblemID);

                    TheFindVehicleMainProblemByProblemIDDataSet = TheVehicleProblemClass.FindVehicleMainProblemByProblemID(MainWindow.gintProblemID);

                    txtProblem.Text = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].Problem;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Vehicle Dashboard // Vehicle In Shop // Problems Grid Selection " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
        public FindVehicleMainProblemByProblemIDDataSet FindVehicleMainProblemByProblemID(int intProblemID)
        {
            try
            {
                aFindVehicleMainProblemByProblemIDDataSet      = new FindVehicleMainProblemByProblemIDDataSet();
                aFindVehicleMainProblemByProblemIDTableAdapter = new FindVehicleMainProblemByProblemIDDataSetTableAdapters.FindVehicleMainProblemByProblemIDTableAdapter();
                aFindVehicleMainProblemByProblemIDTableAdapter.Fill(aFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID, intProblemID);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Vehicle Problem Class // Find Vehicle Main Problem By Problem ID " + Ex.Message);
            }

            return(aFindVehicleMainProblemByProblemIDDataSet);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                TheFindVehicleProblemByProblemIDDataSet = TheVehicleProblemClass.FindVehicleMainProblemByProblemID(MainWindow.gintProblemID);
                txtVehicleProblem.Text = TheFindVehicleProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].Problem;
                txtVehicleNumber.Text  = TheFindVehicleProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].VehicleNumber;

                TheFindVehicleProblemDocumentationByProblemIDDataSet = TheVehicleProblemDocumentClass.FindVehicleProblemDocumentationByProblemID(MainWindow.gintProblemID);

                dgrResults.ItemsSource = TheFindVehicleProblemDocumentationByProblemIDDataSet.FindVehicleProblemDocumentationByProblemID;

                cboSelectDocumentType.Items.Add("Select Document Type");
                cboSelectDocumentType.Items.Add("DOCUMENT");
                cboSelectDocumentType.Items.Add("PICTURE");
                cboSelectDocumentType.SelectedIndex = 0;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Load View Vehicle Problem Documentation // Window Loaded " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
        /* private void HideTextBoxes()
         * {
         *   txtInspectionNotes.Visibility = Visibility.Hidden;
         *   txtVehicleProblem.Visibility = Visibility.Hidden;
         * } */

        private void dgrWorkOrders_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int          intSelectedIndex;
            DataGrid     OpenOrderGrid;
            DataGridRow  OpenOrderRow;
            DataGridCell ProblemID;
            string       strProblemID;
            int          intRecordsReturned;

            try
            {
                intSelectedIndex = dgrWorkOrders.SelectedIndex;
                //HideTextBoxes();

                if (intSelectedIndex > -1)
                {
                    SetReadOnlyControls(true);
                    OpenOrderGrid = dgrWorkOrders;
                    OpenOrderRow  = (DataGridRow)OpenOrderGrid.ItemContainerGenerator.ContainerFromIndex(OpenOrderGrid.SelectedIndex);
                    ProblemID     = (DataGridCell)OpenOrderGrid.Columns[0].GetCellContent(OpenOrderRow).Parent;
                    strProblemID  = ((TextBlock)ProblemID.Content).Text;

                    gintProblemID = Convert.ToInt32(strProblemID);

                    if (intSelectedIndex > 0)
                    {
                        TheFindVehicleMainProblemByProblemIDDataSet = TheVehicleProblemClass.FindVehicleMainProblemByProblemID(gintProblemID);

                        MainWindow.gstrVehicleProblem = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].Problem;

                        txtInspectionNotes.Text = MainWindow.gstrVehicleProblem;

                        txtInspectionNotes.IsReadOnly = true;
                    }

                    if (gintProblemID == -1)
                    {
                        cboSelectEmployee.IsEnabled   = true;
                        cboSelectManager.IsEnabled    = true;
                        txtFleetNotes.Text            = "";
                        txtManagerNotes.Text          = "";
                        txtInspectionNotes.Text       = "";
                        txtInspectionNotes.IsReadOnly = false;
                        gblnNewWorkOrder           = true;
                        txtFleetNotes.IsReadOnly   = false;
                        txtManagerNotes.IsReadOnly = false;
                    }
                    else if (gintProblemID > -1)
                    {
                        gblnNewWorkOrder = false;

                        TheFindVehicleInspectionProblemByProblemIDDataSet = TheInspectionClass.FindVehicleInspectionProblemByProblemID(gintProblemID);

                        intRecordsReturned = TheFindVehicleInspectionProblemByProblemIDDataSet.FindVehicleInspectionProblemByProblemID.Rows.Count;

                        if (intRecordsReturned > 0)
                        {
                            gintManagerID        = TheFindVehicleInspectionProblemByProblemIDDataSet.FindVehicleInspectionProblemByProblemID[0].ManagerID;
                            gintFleetEmployeeID  = TheFindVehicleInspectionProblemByProblemIDDataSet.FindVehicleInspectionProblemByProblemID[0].FleetEmployeeID;
                            txtFleetNotes.Text   = TheFindVehicleInspectionProblemByProblemIDDataSet.FindVehicleInspectionProblemByProblemID[0].FleetEmployeeNotes;
                            txtManagerNotes.Text = TheFindVehicleInspectionProblemByProblemIDDataSet.FindVehicleInspectionProblemByProblemID[0].ManagerNotes;

                            LoadComboBoxBoxes(gintManagerID, gintFleetEmployeeID);

                            //txtInspectionNotes.IsReadOnly = true;
                            //txtManagerNotes.IsReadOnly = true;
                            //txtFleetNotes.IsReadOnly = true;
                            //cboSelectEmployee.IsEnabled = false;
                            //cboSelectManager.IsEnabled = false;
                        }
                    }


                    txtInspectionNotes.Visibility = Visibility.Visible;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Vehicle Inspection Problem // Open Problems Grid " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //local variables
            int    intInvoiceID;
            string strProblemUpdates = "";
            int    intCounter;
            int    intNumberOfRecords;
            string strVendorName;
            string strVehicleNumber;

            try
            {
                TheFindVehicleMainProblemByProblemIDDataSet = TheVehicleProblemClass.FindVehicleMainProblemByProblemID(MainWindow.gintProblemID);

                txtProblemID.Text       = Convert.ToString(TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].ProblemID);
                txtTransactionDate.Text = Convert.ToString(TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].TransactionDAte);
                txtProblem.Text         = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].Problem;
                txtProblemStatus.Text   = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].ProblemStatus;
                strVehicleNumber        = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].VehicleNumber;

                TheFindActiveVehicleByVehicleNumberDataSet = TheVehicleMainClass.FindActiveVehicleMainByVehicleNumber(strVehicleNumber);

                MainWindow.gintVehicleID = TheFindActiveVehicleByVehicleNumberDataSet.FindActiveVehicleMainByVehicleNumber[0].VehicleID;

                strVendorName = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].VendorName;

                TheFindVendorByVendorNameDataSet = TheVendorsClass.FindVendorByVendorName(strVendorName);

                MainWindow.gintVendorID = TheFindVendorByVendorNameDataSet.FindVendorByVendorName[0].VendorID;

                if (TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].IsProblemResolutionNull() == false)
                {
                    txtProblemResolution.Text = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].ProblemResolution;
                }

                if (TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].IsInvoiceIDNull() == false)
                {
                    intInvoiceID = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].InvoiceID;

                    if (intInvoiceID > 999)
                    {
                        TheFindVehicleInvoiceByInvoiceIDDataSet = TheVehicleProblemDocumentClass.FindVehicleInvoiceByInvoiceID(intInvoiceID);

                        txtInvoiceAmount.Text = Convert.ToString(TheFindVehicleInvoiceByInvoiceIDDataSet.FindVehicleInvoiceByInvoiceID[0].InvoiceAmount);
                        txtInvoicePath.Text   = TheFindVehicleInvoiceByInvoiceIDDataSet.FindVehicleInvoiceByInvoiceID[0].InvoicePath;
                    }
                }

                TheFindVehicleMainProblemUpdateByProblemIDDataSet = TheVehicleProblemClass.FindVehicleMainProblemUpdateByProblemID(MainWindow.gintProblemID);

                intNumberOfRecords = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID.Rows.Count;

                if (intNumberOfRecords > 0)
                {
                    for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                    {
                        strProblemUpdates += Convert.ToString(TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].TransactionDate);
                        strProblemUpdates += " ";
                        strProblemUpdates += TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].ProblemUpdate;
                        strProblemUpdates += "\n\n";
                    }
                }

                txtCurrentUpdates.Text = strProblemUpdates;

                TheFindVenicleProblemDocumentationByProblemIDDataSet = TheVehicleProblemDocumentClass.FindVehicleProblemDocumentationByProblemID(MainWindow.gintProblemID);

                dgrProblemDocumentation.ItemsSource = TheFindVenicleProblemDocumentationByProblemIDDataSet.FindVehicleProblemDocumentationByProblemID;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Edit Selected Vehicle Problem // Window Loaded " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
        public bool PrintVehicleProblemInfo()
        {
            //setting local controls
            bool   blnFatalEDrror = false;
            int    intCounter;
            int    intNumberOfRecords;
            string strVehicleNumber;
            string strProblem;
            int    intCurrentRow = 0;
            int    intColumns;

            try
            {
                PrintDialog pdVehicleHProblemHistory = new PrintDialog();

                TheFindVehicleMainProblemByProblemIDDataSet = TheVehicleProblemClass.FindVehicleMainProblemByProblemID(MainWindow.gintProblemID);
                strVehicleNumber = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].VehicleNumber;
                strProblem       = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].Problem;
                TheFindActiveVehicleMainByVehicleNumberDataSet    = TheVehicleMainClass.FindActiveVehicleMainByVehicleNumber(strVehicleNumber);
                TheFindVehicleMainProblemUpdateByProblemIDDataSet = TheVehicleProblemClass.FindVehicleMainProblemUpdateByProblemID(MainWindow.gintProblemID);
                ThePrintProblemUpdateDataSet.problemupdate.Rows.Clear();

                intNumberOfRecords = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID.Rows.Count - 1;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    PrintProblemUpdateDataSet.problemupdateRow NewUpdateRow = ThePrintProblemUpdateDataSet.problemupdate.NewproblemupdateRow();

                    NewUpdateRow.TransactionDate = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].TransactionDate;
                    NewUpdateRow.FirstName       = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].FirstName;
                    NewUpdateRow.LastName        = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].LastName;
                    NewUpdateRow.Update          = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].ProblemUpdate;

                    ThePrintProblemUpdateDataSet.problemupdate.Rows.Add(NewUpdateRow);
                }

                if (pdVehicleHProblemHistory.ShowDialog().Value)
                {
                    FlowDocument fdAcceptLetter = new FlowDocument();
                    Paragraph    Title          = new Paragraph(new Run("BLUE JAY COMMUNICATIONS, INC"));
                    Title.FontSize      = 20;
                    Title.TextAlignment = TextAlignment.Center;
                    Title.LineHeight    = 1;
                    fdAcceptLetter.Blocks.Add(Title);
                    Paragraph Title2 = new Paragraph(new Run("7500 Associates Avenue"));
                    Title2.FontSize      = 16;
                    Title2.LineHeight    = 1;
                    Title2.TextAlignment = TextAlignment.Center;
                    fdAcceptLetter.Blocks.Add(Title2);
                    Paragraph Title3 = new Paragraph(new Run("Brooklyn, OH 44144"));
                    Title3.FontSize      = 16;
                    Title3.LineHeight    = 1;
                    Title3.TextAlignment = TextAlignment.Center;
                    fdAcceptLetter.Blocks.Add(Title3);
                    fdAcceptLetter.ColumnWidth = 900;
                    Paragraph Space1 = new Paragraph(new Run());
                    Space1.LineHeight = 1;
                    fdAcceptLetter.Blocks.Add(Space1);
                    Paragraph Title4 = new Paragraph(new Run(""));
                    Title4.TextDecorations = TextDecorations.Underline;
                    Title4.FontSize        = 16;
                    Title4.LineHeight      = 1;
                    Title4.TextAlignment   = TextAlignment.Center;
                    fdAcceptLetter.Blocks.Add(Title4);
                    Paragraph Title5 = new Paragraph(new Run("Problem Number " + Convert.ToString(MainWindow.gintProblemID) + " For Vehicle " + strVehicleNumber));
                    Title5.TextDecorations = TextDecorations.Underline;
                    Title5.FontSize        = 16;
                    Title5.LineHeight      = 1;
                    Title5.TextAlignment   = TextAlignment.Center;
                    fdAcceptLetter.Blocks.Add(Title5);
                    Paragraph Title6 = new Paragraph(new Run("For The Problem Of " + strProblem));
                    Title6.TextDecorations = TextDecorations.Underline;
                    Title6.FontSize        = 16;
                    Title6.LineHeight      = 1;
                    Title6.TextAlignment   = TextAlignment.Center;
                    fdAcceptLetter.Blocks.Add(Title6);
                    Paragraph Space2 = new Paragraph(new Run());
                    Space1.LineHeight = 2;
                    fdAcceptLetter.Blocks.Add(Space2);

                    //getting the customer information
                    //Set Up Table Columns
                    Table ProjectReportTable = new Table();
                    fdAcceptLetter.Blocks.Add(ProjectReportTable);
                    ProjectReportTable.CellSpacing = 0;
                    intColumns = ThePrintProblemUpdateDataSet.problemupdate.Columns.Count;
                    fdAcceptLetter.ColumnWidth           = 10;
                    fdAcceptLetter.IsColumnWidthFlexible = false;


                    for (int intColumnCounter = 0; intColumnCounter < intColumns; intColumnCounter++)
                    {
                        ProjectReportTable.Columns.Add(new TableColumn());
                    }
                    ProjectReportTable.RowGroups.Add(new TableRowGroup());

                    //Title row
                    ProjectReportTable.RowGroups[0].Rows.Add(new TableRow());
                    TableRow newTableRow = ProjectReportTable.RowGroups[0].Rows[intCurrentRow];

                    ProjectReportTable.RowGroups[0].Rows.Add(new TableRow());
                    intCurrentRow++;
                    newTableRow = ProjectReportTable.RowGroups[0].Rows[intCurrentRow];
                    newTableRow.Cells.Add(new TableCell(new Paragraph(new Run("Date"))));
                    newTableRow.Cells.Add(new TableCell(new Paragraph(new Run("First Nasme"))));
                    newTableRow.Cells.Add(new TableCell(new Paragraph(new Run("Last Name"))));
                    newTableRow.Cells.Add(new TableCell(new Paragraph(new Run("Problem"))));

                    //Format Header Row
                    for (intCounter = 0; intCounter < intColumns; intCounter++)
                    {
                        newTableRow.Cells[intCounter].FontSize        = 16;
                        newTableRow.Cells[intCounter].FontFamily      = new FontFamily("Times New Roman");
                        newTableRow.Cells[intCounter].BorderBrush     = Brushes.Black;
                        newTableRow.Cells[intCounter].TextAlignment   = TextAlignment.Center;
                        newTableRow.Cells[intCounter].BorderThickness = new Thickness();
                    }

                    intNumberOfRecords = ThePrintProblemUpdateDataSet.problemupdate.Rows.Count;

                    //Data, Format Data

                    for (int intReportRowCounter = 0; intReportRowCounter < intNumberOfRecords; intReportRowCounter++)
                    {
                        ProjectReportTable.RowGroups[0].Rows.Add(new TableRow());
                        intCurrentRow++;
                        newTableRow = ProjectReportTable.RowGroups[0].Rows[intCurrentRow];
                        for (int intColumnCounter = 0; intColumnCounter < intColumns; intColumnCounter++)
                        {
                            newTableRow.Cells.Add(new TableCell(new Paragraph(new Run(ThePrintProblemUpdateDataSet.problemupdate[intReportRowCounter][intColumnCounter].ToString()))));

                            newTableRow.Cells[intColumnCounter].FontSize = 12;
                            newTableRow.Cells[0].FontFamily = new FontFamily("Times New Roman");
                            newTableRow.Cells[intColumnCounter].BorderBrush     = Brushes.LightSteelBlue;
                            newTableRow.Cells[intColumnCounter].BorderThickness = new Thickness(0, 0, 0, 1);
                            newTableRow.Cells[intColumnCounter].TextAlignment   = TextAlignment.Center;
                            //if (intColumnCounter == 3)
                            //{
                            //newTableRow.Cells[intColumnCounter].ColumnSpan = 2;
                            //}
                        }
                    }

                    //Set up page and print
                    fdAcceptLetter.ColumnWidth = pdVehicleHProblemHistory.PrintableAreaWidth;
                    fdAcceptLetter.PageHeight  = pdVehicleHProblemHistory.PrintableAreaHeight;
                    fdAcceptLetter.PageWidth   = pdVehicleHProblemHistory.PrintableAreaWidth;
                    intCurrentRow = 0;

                    pdVehicleHProblemHistory.PrintDocument(((IDocumentPaginatorSource)fdAcceptLetter).DocumentPaginator, "Blue Jay Communications Acceptance");
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Vehicle Problem Print Class // Print Vehicle Problem Info " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());

                blnFatalEDrror = true;
            }

            return(blnFatalEDrror);
        }
Example #7
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //setting local variables
            int intCounter;
            int intNumberOfRecords;

            try
            {
                TheFindVehicleMainProblemByProblemIDDataSet = TheVehicleProblemClass.FindVehicleMainProblemByProblemID(MainWindow.gintProblemID);

                txtProblemID.Text       = Convert.ToString(TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].ProblemID);
                txtProblem.Text         = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].Problem;
                txtTransactionDate.Text = Convert.ToString(TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].TransactionDAte);
                txtVendor.Text          = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].VendorName;

                if (TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].IsInvoiceIDNull() == false)
                {
                    gintInvoiceID = TheFindVehicleMainProblemByProblemIDDataSet.FindVehicleMainProblemByProblemID[0].InvoiceID;
                }
                else
                {
                    gintInvoiceID = -1;
                }

                TheFindVehicleMainProblemUpdateByProblemIDDataSet = TheVehicleProblemClass.FindVehicleMainProblemUpdateByProblemID(MainWindow.gintProblemID);

                intNumberOfRecords = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID.Rows.Count - 1;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    SelectedProblemUpdatesDataSet.selectedproblemupdatesRow NewUpdateRow = TheSelectedProblemUpdatesDataSet.selectedproblemupdates.NewselectedproblemupdatesRow();

                    NewUpdateRow.Date      = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].TransactionDate;
                    NewUpdateRow.FirstName = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].FirstName;
                    NewUpdateRow.LastName  = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].LastName;
                    NewUpdateRow.Updates   = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].ProblemUpdate;

                    TheSelectedProblemUpdatesDataSet.selectedproblemupdates.Rows.Add(NewUpdateRow);
                }

                dgrProblemUpdates.ItemsSource = TheSelectedProblemUpdatesDataSet.selectedproblemupdates;

                TheFindVehicleProblemDocumentationByProblemID = TheVehicleProblemDocumentClass.FindVehicleProblemDocumentationByProblemID(MainWindow.gintProblemID);

                intNumberOfRecords = TheFindVehicleProblemDocumentationByProblemID.FindVehicleProblemDocumentationByProblemID.Rows.Count - 1;

                if (intNumberOfRecords > -1)
                {
                    for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                    {
                        SelectedProblemDocumentationDataSet.problemdocumentationRow NewDocumentRow = TheSelectedProblemDocumentationDataSet.problemdocumentation.NewproblemdocumentationRow();

                        NewDocumentRow.Date         = TheFindVehicleProblemDocumentationByProblemID.FindVehicleProblemDocumentationByProblemID[intCounter].TransactionDate;
                        NewDocumentRow.DocumentType = TheFindVehicleProblemDocumentationByProblemID.FindVehicleProblemDocumentationByProblemID[intCounter].DocumentType;
                        NewDocumentRow.DocumentPath = TheFindVehicleProblemDocumentationByProblemID.FindVehicleProblemDocumentationByProblemID[intCounter].DocumentPath;

                        TheSelectedProblemDocumentationDataSet.problemdocumentation.Rows.Add(NewDocumentRow);
                    }
                }

                TheFindVehicleByInvoiceIDDataSet = TheVehicleProblemDocumentClass.FindVehicleInvoiceByInvoiceID(gintInvoiceID);

                intNumberOfRecords = TheFindVehicleByInvoiceIDDataSet.FindVehicleInvoiceByInvoiceID.Rows.Count - 1;

                if (intNumberOfRecords > -1)
                {
                    for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                    {
                        SelectedProblemDocumentationDataSet.problemdocumentationRow NewDocumentRow = TheSelectedProblemDocumentationDataSet.problemdocumentation.NewproblemdocumentationRow();

                        NewDocumentRow.Date         = TheFindVehicleByInvoiceIDDataSet.FindVehicleInvoiceByInvoiceID[intCounter].InvoiceDate;
                        NewDocumentRow.DocumentType = "INVOICE";
                        NewDocumentRow.DocumentPath = TheFindVehicleByInvoiceIDDataSet.FindVehicleInvoiceByInvoiceID[intCounter].InvoicePath;

                        TheSelectedProblemDocumentationDataSet.problemdocumentation.Rows.Add(NewDocumentRow);
                    }
                }

                dgrProblemDocumentation.ItemsSource = TheSelectedProblemDocumentationDataSet.problemdocumentation;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // View Selected Vehicle Problem // Window Loaded " + Ex.Message);

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