예제 #1
0
        private void BtnHome_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            FormDoctor fd = new FormDoctor(this.GetId);

            fd.Visible = true;
        }
예제 #2
0
        //Login button
        private void TileLogin_Click(object sender, EventArgs e)
        {
            //If all fields are okay
            if (!string.IsNullOrWhiteSpace(this.txtId.Text) && !string.IsNullOrWhiteSpace(this.txtPassword.Text) && this.cmbRole.SelectedIndex != -1)
            {
                if (LoginConfirmation())
                {
                    MessageBox.Show("Login Succesfull!");

                    //Check Role Condition
                    if (this.cmbRole.Text == "Admin")
                    {
                        this.Visible = false;
                        Admin.FormAdmin fa = new Admin.FormAdmin(this.txtId.Text);
                        fa.Visible = true;
                    }

                    else if (this.cmbRole.Text == "Doctor")
                    {
                        this.Visible = false;
                        Doctor.FormDoctor fd = new Doctor.FormDoctor(this.txtId.Text);
                        fd.Visible = true;
                    }

                    else if (this.cmbRole.Text == "Patient")
                    {
                        this.Visible = false;
                        Patient.FormPatient fp = new Patient.FormPatient(this.txtId.Text);
                        fp.Visible = true;
                    }

                    else if (this.cmbRole.Text == "Hospital")
                    {
                        this.Visible = false;
                        Hospital.FormHp fh = new Hospital.FormHp(this.txtId.Text);
                        fh.Visible = true;
                    }
                }

                else
                {
                    MessageBox.Show("Invalid Credentials");
                }
            }

            else
            {
                MessageBox.Show("Enter all the fields first!");
            }
        }