public FindServerEventLogSecurityAccessDataSet FindServerEventLogSecurityAccess() { try { aFindServerEventLogSecurityAccessDataSet = new FindServerEventLogSecurityAccessDataSet(); aFindServerEventLogSecurityAccessTableAdapter = new FindServerEventLogSecurityAccessDataSetTableAdapters.FindServerEventLogSecurityAccessTableAdapter(); aFindServerEventLogSecurityAccessTableAdapter.Fill(aFindServerEventLogSecurityAccessDataSet.FindServerEventLogSecurityAccess); } catch (Exception Ex) { InsertEventLogEntry(DateTime.Now, "Event Log Class // Find Server Event Log Security Access " + Ex.Message); } return(aFindServerEventLogSecurityAccessDataSet); }
private void ResetControls() { //setting up the variables int intCounter; int intNumberOfRecords; DateTime datTransactionDate; string strLogonName; string strItemAccessed; string strEventNotes; bool blnItemFound = false; int intSecondCounter; try { PleaseWait PleaseWait = new PleaseWait(); PleaseWait.Show(); TheEventLogSecurityDataSet.eventlogsecurity.Rows.Clear(); TheFindServerEventLogSecurityAccessDataSet = TheEventLogClass.FindServerEventLogSecurityAccess(); intNumberOfRecords = TheFindServerEventLogSecurityAccessDataSet.FindServerEventLogSecurityAccess.Rows.Count; gintNumberOfRecords = 0; if (intNumberOfRecords > 0) { for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++) { datTransactionDate = TheFindServerEventLogSecurityAccessDataSet.FindServerEventLogSecurityAccess[intCounter].TransactionDate; strLogonName = "Just Beginging"; strItemAccessed = "Date Goes Here"; strEventNotes = TheFindServerEventLogSecurityAccessDataSet.FindServerEventLogSecurityAccess[intCounter].EventNotes; char[] delims = new[] { '\n', '\t', '\r' }; string[] strNewItems = strEventNotes.Split(delims, StringSplitOptions.RemoveEmptyEntries); strLogonName = strNewItems[5]; strItemAccessed = strNewItems[16]; blnItemFound = false; datTransactionDate = TheDateSearchClass.RemoveTime(datTransactionDate); if (gintNumberOfRecords > 0) { for (intSecondCounter = 0; intSecondCounter < gintNumberOfRecords; intSecondCounter++) { if (datTransactionDate == TheEventLogSecurityDataSet.eventlogsecurity[intSecondCounter].TransactionDate) { if (strLogonName == TheEventLogSecurityDataSet.eventlogsecurity[intSecondCounter].LogonName) { if (strItemAccessed == TheEventLogSecurityDataSet.eventlogsecurity[intSecondCounter].ItemAccessed) { blnItemFound = true; } } } } } if (blnItemFound == false) { EventlLogSecurityDataSet.eventlogsecurityRow NewEventRow = TheEventLogSecurityDataSet.eventlogsecurity.NeweventlogsecurityRow(); NewEventRow.TransactionDate = datTransactionDate; NewEventRow.LogonName = strLogonName; NewEventRow.ItemAccessed = strItemAccessed; TheEventLogSecurityDataSet.eventlogsecurity.Rows.Add(NewEventRow); gintNumberOfRecords++; } } } dgrEventLog.ItemsSource = TheEventLogSecurityDataSet.eventlogsecurity; TheEmployeeDateEntryClass.InsertIntoEmployeeDateEntry(MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID, "New Blue Jay ERP // Server Security Report"); PleaseWait.Close(); } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Event Log Security // Reset Controls " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }