private void ResetControls() { txtEndDate.Text = ""; txtStartDate.Text = ""; TheEmployeeDateEntryClass.InsertIntoEmployeeDateEntry(MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID, "New Blue Jay ERP // My Tickets"); TheFindHelpDeskTicketsForUserDataSet = TheHelpDeskClass.FindHelpDeskTicketsForUser(-1, DateTime.Now, DateTime.Now); dgrTickets.ItemsSource = TheFindHelpDeskTicketsForUserDataSet.FindHelpDeskTicketsByUser; }
private void dgrTickets_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataGrid dataGrid; DataGridRow selectedRow; DataGridCell TicketID; string strTicketID; int intRecordsReturned; int intEmployeeID; try { if (dgrTickets.SelectedIndex > -1) { //setting local variable dataGrid = dgrTickets; selectedRow = (DataGridRow)dataGrid.ItemContainerGenerator.ContainerFromIndex(dataGrid.SelectedIndex); TicketID = (DataGridCell)dataGrid.Columns[0].GetCellContent(selectedRow).Parent; strTicketID = ((TextBlock)TicketID.Content).Text; MainWindow.gintTicketID = Convert.ToInt32(strTicketID); //find the record UpdateTicketInformation UpdateTicketInformation = new UpdateTicketInformation(); UpdateTicketInformation.ShowDialog(); intEmployeeID = MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID; TheFindHelpDeskTicketsForUserDataSet = TheHelpDeskClass.FindHelpDeskTicketsForUser(intEmployeeID, gdatStartDate, gdatEndDate); dgrTickets.ItemsSource = TheFindHelpDeskTicketsForUserDataSet.FindHelpDeskTicketsByUser; } } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // My Tickets // Tickets Grid Selection " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }
private void btnProcess_Click(object sender, RoutedEventArgs e) { string strValueForValidation; string strErrorMessage = ""; bool blnFatalError = false; bool blnThereIsAProblem = false; int intEmployeeID; try { strValueForValidation = txtStartDate.Text; blnThereIsAProblem = TheDataValidationClass.VerifyDateData(strValueForValidation); if (blnThereIsAProblem == true) { blnFatalError = true; strErrorMessage += "The Start Date is not a Date\n"; } else { gdatStartDate = Convert.ToDateTime(strValueForValidation); } strValueForValidation = txtEndDate.Text; blnThereIsAProblem = TheDataValidationClass.VerifyDateData(strValueForValidation); if (blnThereIsAProblem == true) { blnFatalError = true; strErrorMessage += "The End Date is not a Date\n"; } else { gdatEndDate = Convert.ToDateTime(strValueForValidation); } if (blnFatalError == true) { TheMessagesClass.ErrorMessage(strErrorMessage); return; } else { blnFatalError = TheDataValidationClass.verifyDateRange(gdatStartDate, gdatEndDate); if (blnFatalError == true) { TheMessagesClass.ErrorMessage("The Start Date is after the End Date"); return; } } intEmployeeID = MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID; TheFindHelpDeskTicketsForUserDataSet = TheHelpDeskClass.FindHelpDeskTicketsForUser(intEmployeeID, gdatStartDate, gdatEndDate); dgrTickets.ItemsSource = TheFindHelpDeskTicketsForUserDataSet.FindHelpDeskTicketsByUser; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // My Tickets // Process Button " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }