public FindVehicleMainProblemUpdateByProblemIDDataSet FindVehicleMainProblemUpdateByProblemID(int intProblemID)
        {
            try
            {
                aFindVehicleMainProblemUpdateByProblemIDDataSet      = new FindVehicleMainProblemUpdateByProblemIDDataSet();
                aFindVehicleMainProblemUpdateByProblemIDTableAdapter = new FindVehicleMainProblemUpdateByProblemIDDataSetTableAdapters.FindVehicleMainProblemUpdateByProblemIDTableAdapter();
                aFindVehicleMainProblemUpdateByProblemIDTableAdapter.Fill(aFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID, intProblemID);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Vehlcle Problem Class // Find Vehicle Main Problem UPdate By Problem ID " + Ex.Message);
            }

            return(aFindVehicleMainProblemUpdateByProblemIDDataSet);
        }
Exemple #2
0
        private void dgrProblems_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid     dataGrid;
            DataGridRow  selectedRow;
            DataGridCell ProblemID;
            string       strProblemID;
            int          intCounter;
            int          intNumberOfRecords;

            try
            {
                if (dgrProblems.SelectedIndex > -1)
                {
                    TheProblemNotesDataSet.problemnotes.Rows.Clear();

                    //setting local variable
                    dataGrid     = dgrProblems;
                    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);

                    TheFindVehicleMainProblemUpdateByProblemIDDataSet = TheVehicleProblemClass.FindVehicleMainProblemUpdateByProblemID(MainWindow.gintProblemID);

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

                    for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                    {
                        ProblemNotesDataSet.problemnotesRow NewNotesProblem = TheProblemNotesDataSet.problemnotes.NewproblemnotesRow();

                        NewNotesProblem.TransactionDate = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].TransactionDate;
                        NewNotesProblem.ProblemNotes    = TheFindVehicleMainProblemUpdateByProblemIDDataSet.FindVehicleMainProblemUpdateByProblemID[intCounter].ProblemUpdate;

                        TheProblemNotesDataSet.problemnotes.Rows.Add(NewNotesProblem);
                    }

                    dgrProblemNotes.ItemsSource = TheProblemNotesDataSet.problemnotes;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Vehicle Dashboard // Vehicle In Shop // Problems Grid Selection " + 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);
        }
Exemple #5
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());
            }
        }