private void Window_Loaded(object sender, RoutedEventArgs e) { int intRecordsReturned; int intCounter; int intNumberOfRecords; //this will load up the controls cboJobType.Items.Add("Select Job Type"); TheFindSortedJobTypeDataSet = TheJobTypeClass.FindSortedJobType(); intNumberOfRecords = TheFindSortedJobTypeDataSet.FindSortedJobType.Rows.Count; for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++) { cboJobType.Items.Add(TheFindSortedJobTypeDataSet.FindSortedJobType[intCounter].JobType); } TheFindProductionProjectInfoDataSet = TheProductionProjectClass.FindProductionProjectInfo(MainWindow.gintProjectID); intRecordsReturned = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo.Rows.Count; if (intRecordsReturned > 0) { TheMessagesClass.ErrorMessage("The Production Project Has an Entry Already"); this.Close(); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { bool blnFatalError = false; int intCounter; int intNumberOfRecords; int intSelectedIndex; try { TheFindSortedJobTypeDataSet = TheJobTypeClass.FindSortedJobType(); cboSelectJobType.Items.Add("Select Job Type"); intNumberOfRecords = TheFindSortedJobTypeDataSet.FindSortedJobType.Rows.Count; for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++) { cboSelectJobType.Items.Add(TheFindSortedJobTypeDataSet.FindSortedJobType[intCounter].JobType); } cboSelectJobType.SelectedIndex = 0; blnFatalError = TheEmployeeDateEntryClass.InsertIntoEmployeeDateEntry(MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID, "New Blue Jay ERP // Edit Production Project Info "); if (blnFatalError == true) { throw new Exception(); } TheFindProductionProjectInfoDataSet = TheProductionProjectClass.FindProductionProjectInfo(MainWindow.gintProjectID); intNumberOfRecords = cboSelectJobType.Items.Count; for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++) { cboSelectJobType.SelectedIndex = intCounter; if (cboSelectJobType.SelectedItem.ToString() == TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].JobType) { intSelectedIndex = intCounter; } } cboSelectJobType.SelectedIndex = intCounter; MainWindow.gintTransactionID = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].TransactionID; txtPOAmount.Text = Convert.ToString(TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].POAmount); txtPOC.Text = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].PointOfContact; txtPONumber.Text = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].PONumber; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Edit Production Project Info // Window Loaded Method " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
public FindSortedJobTypeDataSet FindSortedJobType() { try { aFindSortedJobTypeDataSet = new FindSortedJobTypeDataSet(); aFindSortedJobTypeTableAdapter = new FindSortedJobTypeDataSetTableAdapters.FindSortedJobTypeTableAdapter(); aFindSortedJobTypeTableAdapter.Fill(aFindSortedJobTypeDataSet.FindSortedJobType); } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Job Type Class // Find Sorted Job Type " + Ex.Message); } return(aFindSortedJobTypeDataSet); }