private void button4_Click(object sender, EventArgs e) { Receptionist r = new Receptionist(); this.Hide(); r.Show(); }
private void BackBtn_Click(object sender, EventArgs e) { Receptionist bl = new Receptionist(); this.Hide(); bl.Show(); }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "user") { if (IsvalidUser(textBox1.Text, textBox2.Text)) { Receptionist r = new Receptionist(); this.Hide(); r.Show(); } else { MessageBox.Show("UserName and password do not match"); } } else { if (IsvalidUser(textBox1.Text, textBox2.Text)) { Admin ad = new Admin(); this.Hide(); ad.Show(); } else { MessageBox.Show("UserName and password do not match"); } } }
static void Main(string[] args) { Surgeon Jenny = new Surgeon("Jenny", 234, "Operating", false); Surgeon Meredith = new Surgeon("Meredith", 645, "Operating", true); Nurse Sonny = new Nurse("Sonny", 789, "Patient_Care", 6); Nurse Anthony = new Nurse("Anthony", 123, "Patient_Care", 4); Receptionist Tom = new Receptionist("Tom", 951, "Patient_Care", true); Console.WriteLine(Jenny.EmployeeName + " " + Jenny.EmployeeNumber + " " + Jenny.SpecialtyArea + " " + Jenny.CurrentlyOperating); Console.WriteLine(Meredith.EmployeeName + " " + Meredith.EmployeeNumber + " " + Meredith.SpecialtyArea + " " + Meredith.CurrentlyOperating); Console.WriteLine(Sonny.EmployeeName + " " + Sonny.EmployeeNumber + " " + Sonny.Department + " " + Sonny.NumberOfPatients); Console.WriteLine(Anthony.EmployeeName + " " + Anthony.EmployeeNumber + " " + Anthony.Department + " " + Anthony.NumberOfPatients); Console.WriteLine(Tom.EmployeeName + " " + Tom.EmployeeNumber + " " + Tom.Department + " " + Tom.IsOnPhone); }
static void Main(string[] args) { //Employees Doctor david = new Doctor("David Jones", 123, "Heart"); Doctor james = new Doctor("James Smith", 342, "Lungs"); Surgeon catherine = new Surgeon("Catherine Vincent", 725, "Brain", true); Surgeon jaime = new Surgeon("Jaime Rodriguez", 843, "Spine", false); Receptionist zachary = new Receptionist("Zachary Black", 186, "Office", true); Receptionist emma = new Receptionist("Emma Thompson", 865, "Customer Service", false); Nurse clara = new Nurse("Clara Kane", 527, "In-Patient", 4); Nurse kyle = new Nurse("Kyle James", 142, "Out-Patient", 2); Console.WriteLine("High St. Hospital Employees: \n"); Console.WriteLine(david.EmployeeInformation() + "\n"); Console.WriteLine(james.EmployeeInformation() + "\n"); Console.WriteLine(catherine.EmployeeInformation() + "\n"); Console.WriteLine(jaime.EmployeeInformation() + "\n"); Console.WriteLine(zachary.EmployeeInformation() + "\n"); Console.WriteLine(emma.EmployeeInformation() + "\n"); Console.WriteLine(clara.EmployeeInformation() + "\n"); Console.WriteLine(kyle.EmployeeInformation() + "\n"); }
static void Main(string[] args) { Console.WriteLine("High St. Hospital Employees \n"); Doctor doctor1 = new Doctor("Dr Gomez", 7832, "Pediatrics"); Console.WriteLine(doctor1.GetInfo()); Console.WriteLine(doctor1.GetPaid()); Surgeon surgeon1 = new Surgeon("Dr Dyko", 8274, "Liver", true); Console.WriteLine(surgeon1.GetInfo()); Console.WriteLine(surgeon1.GetPaid()); Nurse nurse1 = new Nurse("Nurse Brown", 9901, "ICU", 6); Console.WriteLine(nurse1.GetInfo()); Console.WriteLine(nurse1.GetPaid()); Receptionist receptionist1 = new Receptionist("Ms. Nelson", 4421, "ER", true); Console.WriteLine(receptionist1.GetInfo()); Console.WriteLine(receptionist1.GetPaid()); List <string> employees = new List <string>(); employees.Add(doctor1.EmployeeName); //why can't I populate like that? I can only hardcode it? employees.Add("Dr Dyko"); employees.Add("Nurse Brown"); employees.Add(receptionist1.EmployeeName); for (int name = 0; name < employees.Count; name++) { Console.WriteLine(employees[name]); } }
private void button1_Click(object sender, EventArgs e) { Users u = new Users(); //try //{ int user_id = Convert.ToInt32(textBox1.Text); string pass = textBox2.Text; string uname = u.Login(user_id, pass, out string role); if (uname.Equals("")) { throw new FormatException(); } SessionClass.SessionId = user_id; SessionClass.SessionName = uname; this.Hide(); switch (role) { case "Doctor": Doctor doctor = new Doctor(); doctor.ShowDialog(); break; case "Laboratorian": Laboratorian laboratorian = new Laboratorian(); laboratorian.ShowDialog(); break; case "Chemist": Chemist chemist = new Chemist(); chemist.ShowDialog(); break; case "Receptionist": Receptionist receptionist = new Receptionist(); receptionist.ShowDialog(); break; case "Manager": Manager manager = new Manager(); manager.ShowDialog(); break; case "Nurse": Nurse nurse = new Nurse(); nurse.ShowDialog(); break; case "WardManager": WardManager wm = new WardManager(); wm.ShowDialog(); break; case "Admin": Admin a = new Admin(); a.ShowDialog(); break; } /* } * catch (Exception ex) * { * Console.WriteLine(ex.Message.ToString()); * if (ex.GetType().ToString().Equals("System.FormatException")) * MessageBox.Show("User doesn't exists", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); * else * MessageBox.Show("Something went wrong please try agian later", "Error",MessageBoxButtons.OK,MessageBoxIcon.Error); * label8.Text = "NOT FOUND"; * }*/ }