private void Window_Loaded(object sender, RoutedEventArgs e) { //setting up the variables int intCounter; int intNumberOfRecords; try { //loading billing codes TheFindSortedWOVBillingCodes = TheWOVInvoicingClass.FindSortedWOVBillingCodes(); intNumberOfRecords = TheFindSortedWOVBillingCodes.FindSortedWOVBillingCodes.Rows.Count - 1; cboSelectBillingCode.Items.Add("Select Billing Code"); for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { cboSelectBillingCode.Items.Add(TheFindSortedWOVBillingCodes.FindSortedWOVBillingCodes[intCounter].BillingDescription); } cboSelectBillingCode.SelectedIndex = 0; TheFindDesignProjectsByAssignedProjectIDDataSet = TheDesignProjectsClass.FindDesignProjectsByAssignedProjectID(MainWindow.gstrAssignedProjectID); txtAddress.Text = TheFindDesignProjectsByAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID[0].ProjectAddress; txtJobType.Text = TheFindDesignProjectsByAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID[0].JobType; txtProjectID.Text = MainWindow.gstrAssignedProjectID; txtProjectName.Text = TheFindDesignProjectsByAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID[0].ProjectName; MainWindow.gintProjectID = TheFindDesignProjectsByAssignedProjectIDDataSet.FindDesignProjectsByAssignedProjectID[0].ProjectID; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Adding Billing Codes to Project // Window Loaded Method " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
private void MitProcess_Click(object sender, RoutedEventArgs e) { int intOfficeCounter; int intOfficeNumberOfRecords; int intBillingCounter; int intBillingNumberOfRecords; string strWarehouse; bool blnFatalError = false; try { MainWindow.TheFindWarehousesDataSet = TheEmployeeClass.FindWarehouses(); TheFindSortedWOVBillingCodesDataSet = TheWOVInvoicingClass.FindSortedWOVBillingCodes(); intOfficeNumberOfRecords = MainWindow.TheFindWarehousesDataSet.FindWarehouses.Rows.Count - 1; intBillingNumberOfRecords = TheFindSortedWOVBillingCodesDataSet.FindSortedWOVBillingCodes.Rows.Count - 1; //Office Loop for (intOfficeCounter = 0; intOfficeCounter <= intOfficeNumberOfRecords; intOfficeCounter++) { //loading office variables MainWindow.gintWarehouseID = MainWindow.TheFindWarehousesDataSet.FindWarehouses[intOfficeCounter].EmployeeID; strWarehouse = MainWindow.TheFindWarehousesDataSet.FindWarehouses[intOfficeCounter].FirstName; for (intBillingCounter = 0; intBillingCounter <= intBillingNumberOfRecords; intBillingCounter++) { MainWindow.gintBillingID = TheFindSortedWOVBillingCodesDataSet.FindSortedWOVBillingCodes[intBillingCounter].BillingID; gblnDisplayInvoice = false; if (strWarehouse == "CLEVELAND") { blnFatalError = LoadClevelandInvoice(MainWindow.gintWarehouseID, MainWindow.gintBillingID); if (blnFatalError == true) { throw new Exception(); } } else if (strWarehouse == "MILWAUKEE") { MainWindow.TheWisconsinDesignProjectInvoicingDataSet.wisconsindesigninvoice.Rows.Clear(); blnFatalError = LoadWisconsinInvoice(MainWindow.gintWarehouseID, MainWindow.gintBillingID); if (blnFatalError == true) { throw new Exception(); } } } } ResetControls(); } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Design Peroject Invoicing // Process Menu Item " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }