private void frmAmonicAirlinesAutomationSystem_Load(object sender, EventArgs e) { try { DateTime timeLogin = DateTime.Now; FulfilTheOfficeCombobox(); cboOffice.SelectedIndex = 0; if (accession.GetLastTimeLoggingID(accession.GetUserID(Email)) != 0 && accession.LastLogoutTime(Email).ToString(@"hh\:mm\:ss") == "00:00:00") { frmNoLogoutDetected frm = new frmNoLogoutDetected(); frm.lblNotification.Text = "No logout detected for your last login on " + accession.GetLoginDate(Email).ToString("dd/MM/yyyy") + " at " + accession.GetLoginTime(Email).ToString(@"hh\:mm\:ss"); frm.Email = Email; frm.ShowDialog(); } accession.InsertIntoTimeLoggingManagement(Email, timeLogin); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void frmAmonicAirlinesAutomationSystemForUser_Load(object sender, EventArgs e) { try { DateTime timeLogin = DateTime.Now; ShowTimeLoggingOnListView(); lblTimeSpentOnSystem.Text = TotalTimeSpent().ToString(@"hh\:mm\:ss"); lblNumberOfCrashes.Text = CrashesCount() + ""; if (accession.GetLastTimeLoggingID(accession.GetUserID(Email)) != 0 && accession.LastLogoutTime(Email).ToString(@"hh\:mm\:ss") == "00:00:00") { frmNoLogoutDetected frm = new frmNoLogoutDetected(); frm.lblNotification.Text = "No logout detected for your last login on " + accession.GetLoginDate(Email).ToString("dd/MM/yyyy") + " at " + accession.GetLoginTime(Email).ToString(@"hh\:mm\:ss"); frm.Email = Email; frm.ShowDialog(); } accession.InsertIntoTimeLoggingManagement(Email, timeLogin); } catch (Exception ex) { MessageBox.Show(ex.Message); } }