Beispiel #1
0
        private void mbtnLogin_Click(object sender, EventArgs e)
        {
            if (this.txtUserName.Text != "" && this.txtPassword.Text != "")
            {
                var user = new UserLoginEntity();
                user.UserName = this.txtUserName.Text.Trim();
                user.UserPass = this.txtPassword.Text.Trim();

                var userRep = new UserLoginRepo();
                if (user.UserName.Substring(0, 1) == "A" || user.UserName.Substring(0, 1) == "a")
                {
                    if (userRep.UserLoginAdmin(user))
                    {
                        MessageBox.Show("Welcome Admin");
                        this.Visible = false;
                        var admin = new AdminDash(txtUserName.Text.Trim());
                        admin.Visible = true;
                    }
                    else
                    {
                        MessageBox.Show("Invalid Id or Password");
                    }
                }
                else if (user.UserName.Substring(0, 1) == "R" || user.UserName.Substring(0, 1) == "r")
                {
                    if (userRep.UserLoginReciptionist(user))
                    {
                        //MessageBox.Show("Hey There");
                        var reciption = new ReceptionistDash(txtUserName.Text.Trim());
                        //this.Visible = false;
                        this.Hide();
                        reciption.Show();
                        //reciption.Visible = true;
                    }
                    else
                    {
                        MessageBox.Show("Invalid Id or Password");
                    }
                }
                else if (user.UserName.Substring(0, 1) == "D" || user.UserName.Substring(0, 1) == "d")
                {
                    if (userRep.UserLoginDoctor(user))
                    {
                        MessageBox.Show("Welcome Doctor");
                        var doctor = new DoctorDash(txtUserName.Text.Trim());
                        this.Visible   = false;
                        doctor.Visible = true;
                    }
                    else
                    {
                        MessageBox.Show("Invalid Id or Password");
                    }
                }
            }
        }
 public DoctorTest(DoctorDash dash)
 {
     this.dd = dash;
     InitializeComponent();
 }
Beispiel #3
0
 public DoctorAppointment(DoctorDash dash, string doc)
 {
     this.dd      = dash;
     this.docName = doc;
     InitializeComponent();
 }