public void AdminRole() { string username = userNameTextBox.Text; string password = passwordTextBox.Text; string message = ""; if (username == "admin" && password == "admin") { Admin admin = new Admin(); this.Hide(); admin.Closed += (s, args) => this.Close(); <<<<<<< HEAD >>>>>>> a640082b294a1601a6267f275da3d884eee2ab5c ======= >>>>>>> a640082b294a1601a6267f275da3d884eee2ab5c admin.Show(); } else { int flag = 1; foreach (Stuff stuff in aStuffList) { if ((stuff.Username == username) && (stuff.Password == password)) { DateTime aDateTime = DateTime.Today.Date.Date; aStuffManager.AttendanceSubmit(aDateTime, stuff.Id, out message); MessageBox.Show(message); userNameTextBox.Text = passwordTextBox.Text = ""; flag = 0; break; } <<<<<<< HEAD <<<<<<< HEAD ======= >>>>>>> a640082b294a1601a6267f275da3d884eee2ab5c ======= >>>>>>> a640082b294a1601a6267f275da3d884eee2ab5c } if (flag == 1) MessageBox.Show("Invalid username or password"); } <<<<<<< HEAD <<<<<<< HEAD ======= >>>>>>> a640082b294a1601a6267f275da3d884eee2ab5c ======= >>>>>>> a640082b294a1601a6267f275da3d884eee2ab5c }
private void submitButton_Click(object sender, EventArgs e) { string username = userNameTextBox.Text; string password = passwordTextBox.Text; string message=""; if (username == "admin" && password == "admin") { Admin admin=new Admin(); this.Hide(); admin.Closed+=(s,args)=>this.Close(); admin.Show(); } else { int flag = 1; foreach (Stuff stuff in aStuffList) { if ((stuff.Username == username) && (stuff.Password == password)) { DateTime aDateTime = DateTime.Today.Date.Date; aStuffManager.AttendanceSubmit(aDateTime, stuff.Id, out message); MessageBox.Show(message); userNameTextBox.Text = passwordTextBox.Text = ""; flag = 0; break; } } if (flag == 1) MessageBox.Show("Invalid username or password"); } }
public void AdminRole() { string username = userNameTextBox.Text; string password = passwordTextBox.Text; string message = ""; if (username == "admin" && password == "admin") { Admin admin = new Admin(); this.Hide(); admin.Closed += (s, args) => this.Close(); admin.Show(); } else { MessageBox.Show("Admin username and password is incorrect", "Error",MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void submitButton_Click(object sender, EventArgs e) { string username = userNameTextBox.Text; string password = passwordTextBox.Text; string message=""; if (username == "admin" && password == "admin") { Admin admin=new Admin(); this.Hide(); admin.Closed+=(s,args)=>this.Close(); ======= ======= >>>>>>> a640082b294a1601a6267f275da3d884eee2ab5c IntialCondition(); } private DateTime timeStart = DateTime.Parse("6:00");