Ejemplo n.º 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 ManageReceptionist(AdminDash dash)
 {
     this.admin = dash;
     InitializeComponent();
 }
        public AddReceptionist(AdminDash admin)
        {
            this.Admin = admin;

            InitializeComponent();
        }
 public Financials(AdminDash dash)
 {
     this.admin = dash;
     InitializeComponent();
 }
 public ManageTest(AdminDash dash)
 {
     this.admin = dash;
     InitializeComponent();
 }
 public ManageAppointment(AdminDash dash)
 {
     this.admin = dash;
     InitializeComponent();
 }
Ejemplo n.º 7
0
 public AddAdmin(AdminDash admin)
 {
     Admin = admin;
     InitializeComponent();
 }