public FindProductionProjectUpdateByProjectIDDataSet FindProductionProjectUpdateByProjectID(int intProjectID) { try { aFindProductionProjectUpdateByProjectIDDataSet = new FindProductionProjectUpdateByProjectIDDataSet(); aFindProductionProjectUpdateByProjectIDTableAdapter = new FindProductionProjectUpdateByProjectIDDataSetTableAdapters.FindProductionProjectUpdatesByProjectIDTableAdapter(); aFindProductionProjectUpdateByProjectIDTableAdapter.Fill(aFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID, intProjectID); } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Production Project Update Class // Find Production Project Update By Project ID " + Ex.Message); } return(aFindProductionProjectUpdateByProjectIDDataSet); }
private void Window_Loaded(object sender, RoutedEventArgs e) { int intCounter; int intNumberOfRecords; string strUpdate = ""; int intStatusID; try { TheFindProjectMatrixByProjectProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByProjectID(MainWindow.gintProjectID); TheFindProjectByProjectIDDataSet = TheProjectClass.FindProjectByProjectID(MainWindow.gintProjectID); TheFindProductionProjectByProjectIDDataSet = TheProductionProjectClass.FindProductionProjectByProjectID(MainWindow.gintProjectID); txtAssignedProjectID.Text = TheFindProjectMatrixByProjectProjectIDDataSet.FindProjectMatrixByProjectID[0].AssignedProjectID; txtCustomerProjectID.Text = TheFindProjectMatrixByProjectProjectIDDataSet.FindProjectMatrixByProjectID[0].CustomerAssignedID; txtProjectName.Text = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectName; intStatusID = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].CurrentStatusID; txtProjectNotes.Text = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].ProjectNotes; TheFindProductionProjectUpdateByProjectIDDataSet = TheProductionProjectUpdatesClass.FindProductionProjectUpdateByProjectID(MainWindow.gintProjectID); intNumberOfRecords = TheFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID.Rows.Count; if (intNumberOfRecords > 0) { for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++) { strUpdate += Convert.ToString(TheFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID[intCounter].TransactionDate) + " - "; strUpdate += TheFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID[intCounter].ProjectUpdate + "\n\n"; } } txtProjectUpdates.Text = strUpdate; if (intStatusID == 1001) { rdoOpen.IsChecked = true; } else if (intStatusID == 1002) { rdoConComplete.IsChecked = true; } else if (intStatusID == 1003) { rdoOnHold.IsChecked = true; } else if (intStatusID == 1004) { rdoCancel.IsChecked = true; } else if (intStatusID == 1005) { rdoInProcess.IsChecked = true; } else if (intStatusID == 1006) { rdoClosed.IsChecked = true; } else if (intStatusID == 1007) { rdoInvoiced.IsChecked = true; } else if (intStatusID == 1008) { rdoSubmitted.IsChecked = true; } } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Update Selected Project // Window Loaded Method " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
private void btnFind_Click(object sender, RoutedEventArgs e) { string strCustomerProjectID; string strAssignedProjectID = ""; string strProjectName; string strProjectUpdates = ""; int intRecordsReturned; int intCounter; int intNumberOfRecords; int intStatusID; string strProjectNotes; bool blnFatalError = false; try { //getting project id strCustomerProjectID = txtEnterProjectID.Text; if (strCustomerProjectID.Length < 1) { TheMessageClass.ErrorMessage("The Project Information Was Not Entered"); return; } TheFindProjectMatrixByCustomerProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByCustomerProjectID(strCustomerProjectID); intRecordsReturned = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID.Rows.Count; if (intRecordsReturned > 1) { TheMessageClass.ErrorMessage("The Project Has Been Entered More Than Once, Contact Admin"); return; } else if (intRecordsReturned < 1) { strAssignedProjectID = strCustomerProjectID; TheFindProjectMatrxiByAssignedProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByAssignedProjectID(strAssignedProjectID); intRecordsReturned = TheFindProjectMatrxiByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID.Rows.Count; if (intRecordsReturned == 0) { TheMessageClass.ErrorMessage("Project Not Found"); return; } else if (intRecordsReturned > 1) { TheMessageClass.InformationMessage("There are Multiple Projects with this Project ID, Please use the Customer Assigned ID"); return; } else if (intRecordsReturned == 1) { MainWindow.gintProjectID = TheFindProjectMatrxiByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID[0].ProjectID; strCustomerProjectID = TheFindProjectMatrxiByAssignedProjectIDDataSet.FindProjectMatrixByAssignedProjectID[0].CustomerAssignedID; } } else if (intRecordsReturned == 1) { MainWindow.gintProjectID = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].ProjectID; strAssignedProjectID = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].AssignedProjectID; } TheFindProductionProjectByProjectIDDataSet = TheProductionProjectClass.FindProductionProjectByProjectID(MainWindow.gintProjectID); TheFindProjectByProjectIDDataSet = TheProjectClass.FindProjectByProjectID(MainWindow.gintProjectID); strProjectName = TheFindProjectByProjectIDDataSet.FindProjectByProjectID[0].ProjectName; strProjectNotes = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].ProjectNotes; intStatusID = TheFindProductionProjectByProjectIDDataSet.FindProductionProjectByProjectID[0].CurrentStatusID; ClearRadioButtons(); if (intStatusID == 1001) { rdoOpen.IsChecked = true; } else if (intStatusID == 1002) { rdoConComplete.IsChecked = true; } else if (intStatusID == 1003) { rdoOnHold.IsChecked = true; } else if (intStatusID == 1004) { rdoCancel.IsChecked = true; } else if (intStatusID == 1005) { rdoInProcess.IsChecked = true; } else if (intStatusID == 1006) { rdoClosed.IsChecked = true; } else if (intStatusID == 1007) { rdoInvoiced.IsChecked = true; } else if (intStatusID == 1008) { rdoSubmitted.IsChecked = true; } txtAssignedProjectID.Text = strAssignedProjectID; txtCustomerProjectID.Text = strCustomerProjectID; txtProjectName.Text = strProjectName; txtProjectNotes.Text = strProjectNotes; TheFindProductionProjectUpdateByProjectIDDataSet = TheProductionProjectUpdatesClass.FindProductionProjectUpdateByProjectID(MainWindow.gintProjectID); intNumberOfRecords = TheFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID.Rows.Count; if (intNumberOfRecords > 0) { for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++) { strProjectUpdates += Convert.ToString(TheFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID[intCounter].TransactionDate) + " - "; strProjectUpdates += TheFindProductionProjectUpdateByProjectIDDataSet.FindProductionProjectUpdatesByProjectID[intCounter].ProjectUpdate + "\n\n"; } } txtProjectUpdates.Text = strProjectUpdates; TheFindProductionProjectInfoDataSet = TheProductionProjectClass.FindProductionProjectInfo(MainWindow.gintProjectID); intRecordsReturned = TheFindProductionProjectInfoDataSet.FindProductionProjectInfo.Rows.Count; if (intRecordsReturned < 1) { blnFatalError = TheProductionProjectClass.InsertProductionProjectInfo(MainWindow.gintProjectID, 0, " ", " ", 0); if (blnFatalError == true) { throw new Exception(); } } else if (intRecordsReturned > 0) { if (TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].HardRestoration == true) { chkHardRestoration.IsChecked = true; } else { chkHardRestoration.IsEnabled = false; } if (TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].QCPerformed == true) { chkQCPerformed.IsChecked = true; } else { chkQCPerformed.IsChecked = false; } if (TheFindProductionProjectInfoDataSet.FindProductionProjectInfo[0].SplicingComple == true) { chkSplicingComplete.IsChecked = true; } else { chkSplicingComplete.IsChecked = false; } } expViewDocuments.IsEnabled = true; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Update Project // Find Button " + Ex.Message); TheMessageClass.ErrorMessage(Ex.ToString()); } }