Example #1
0
        private void ResetControls()
        {
            int    intCounter;
            int    intNumberOfRecords;
            int    intPartID;
            int    intRecordsReturned;
            string strOldPartNumber;
            bool   blnFatalError = false;

            try
            {
                blnFatalError = TheEmployeeDateEntryClass.InsertIntoEmployeeDateEntry(MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID, "New Blue Jay ERP // Parts List");

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

                ThePartsListReportDataSet.partlistreport.Rows.Clear();

                TheFindPartsListReportDataSet = TheInventoryClass.FindPartsListReport();

                intNumberOfRecords = TheFindPartsListReportDataSet.FindPartsListReport.Rows.Count;

                for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                {
                    intPartID = TheFindPartsListReportDataSet.FindPartsListReport[intCounter].PartID;

                    strOldPartNumber = "NONE FOUND";

                    TheFindMasterPartListByPartIDDataSet = ThePartNumberClass.FindMasterPartByPartID(intPartID);

                    intRecordsReturned = TheFindMasterPartListByPartIDDataSet.FindMasterPartListPartByPartID.Rows.Count;

                    if (intRecordsReturned > 0)
                    {
                        strOldPartNumber = TheFindMasterPartListByPartIDDataSet.FindMasterPartListPartByPartID[0].PartNumber;
                    }

                    PartsListReportDataSet.partlistreportRow NewPartRow = ThePartsListReportDataSet.partlistreport.NewpartlistreportRow();

                    NewPartRow.JDEPartNumber   = TheFindPartsListReportDataSet.FindPartsListReport[intCounter].JDEPartNumber;
                    NewPartRow.OldPartNumber   = strOldPartNumber;
                    NewPartRow.PartDescription = TheFindPartsListReportDataSet.FindPartsListReport[intCounter].PartDescription;
                    NewPartRow.PartID          = intPartID;
                    NewPartRow.PartNumber      = TheFindPartsListReportDataSet.FindPartsListReport[intCounter].PartNumber;

                    ThePartsListReportDataSet.partlistreport.Rows.Add(NewPartRow);
                }

                dgrResult.ItemsSource = ThePartsListReportDataSet.partlistreport;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Parts List // Reset Controls " + Ex.Message);

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