public void LoginDetails() { myStudentItem = new List <StudentItem>(); myStudentItem.Clear(); string logStatus = myStudentCollection.LoadLogStudentsFromDb(txtStdFname.text, txtStdLname.text); if (logStatus == "Name Not Found") { pbWarning.Visible = true; lblWarning.Visible = true; } else { foreach (var popStudentItem in myStudentCollection.pubStudentCollect) { var myItem = new StudentItem(); myItem.Std_FName = popStudentItem.Std_FName; myItem.Std_LName = popStudentItem.Std_LName; myItem.Std_Id = popStudentItem.Std_Id; myStudentItem.Add(myItem); } var passForm = new PasswordForm(); passForm.Owner = this; passForm.holdStdList = myStudentItem; passForm.lblPassword.Text = "Enter Id:"; passForm.btnLogin.ButtonText = "Enter"; this.Hide(); passForm.ShowDialog(); txtStdFname.text = ""; txtStdLname.text = ""; passForm.Dispose(); myStudentItem.Clear(); GC.Collect(); } }
public void LoginDetails() { myStaffItem = new List <StaffItem>(); myStaffItem.Clear(); string logStatus = myStaffCollection.LoadLogStaffFromDb(txtUserName.text); if (logStatus == "Name Not Found") { pbWarning.Visible = true; lblWarning.Visible = true; } else { foreach (var popStaffItem in myStaffCollection.pubStaffCollect) { var myItem = new StaffItem(); myItem.Staff_FName = popStaffItem.Staff_FName; myItem.Staff_LName = popStaffItem.Staff_LName; myItem.Staff_Username = popStaffItem.Staff_Username; myItem.Staff_Password = popStaffItem.Staff_Password; myStaffItem.Add(myItem); } var passForm = new PasswordForm(); passForm.Owner = this; passForm.holdStaffList = myStaffItem; this.Hide(); passForm.ShowDialog(); txtUserName.text = ""; passForm.Dispose(); myStaffItem.Clear(); GC.Collect(); } }