示例#1
0
        private void Btn_login_Click(object sender, EventArgs e)
        {
            LoginRepo lr       = new LoginRepo();
            string    id       = tb_uname.Text;
            string    password = tb_pass.Text;

            Login l = lr.GetUser(id, password);

            if (l != null)
            {
                if (l.Role == 1)
                {
                    Landing_admin_gui lg = new Landing_admin_gui(l);
                    this.Visible = false;
                    lg.Visible   = true;
                }
                else if (l.Role == 2)
                {
                    Landing_hsuper_gui lhg = new Landing_hsuper_gui(l);
                    this.Visible = false;
                    lhg.Visible  = true;
                }
                else if (l.Role == 3)
                {
                    Tenant_landing tl = new Tenant_landing(l);
                    this.Visible = false;
                    tl.Visible   = true;
                }
            }
            else
            {
                MessageBox.Show("Invalid User");
            }
        }
示例#2
0
        private void BackBtn_Click(object sender, EventArgs e)
        {
            Tenant_landing tl = new Tenant_landing(l);

            this.Visible = false;
            tl.Visible   = true;
        }