Ejemplo n.º 1
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            AddBook ap = new AddBook();

            this.Close();
            AdminProfile ab = new AdminProfile();

            ab.Show();
        }
        private void btnHomePage_Click(object sender, EventArgs e)
        {
            ViewMembers vb = new ViewMembers();

            this.Hide();
            AdminProfile ap = new AdminProfile();

            ap.Show();
        }
Ejemplo n.º 3
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            Register r = new Register();

            this.Hide();
            AdminProfile ap = new AdminProfile();

            ap.Show();
        }
Ejemplo n.º 4
0
        /**
         * Name:Harsh patel
         * Description: this below even authiticate users
         * */
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (validateMe())
            {
                string email    = txtEmail.Text.Trim();
                string password = txtPassword.Text.Trim();
                int    role     = ddlRole.SelectedIndex;

                tblLogin = checkLogin.GetDataByLogin(email, password, role);

                if (tblLogin.Count == 1)
                {
                    Program.UserID = email;
                    MessageBox.Show("Welcome " + email);
                    LoginForm f1 = new LoginForm();
                    this.Hide();
                    if (ddlRole.SelectedIndex == 1)
                    {
                        AdminProfile ap = new AdminProfile();
                        ap.Show();
                    }
                    else if (ddlRole.SelectedIndex == 2)
                    {
                        WindowsFormsApp1.LibrarianPage librarianPage = new WindowsFormsApp1.LibrarianPage();
                        librarianPage.Show();
                    }
                    else if (ddlRole.SelectedIndex == 3)
                    {
                        // Open Librarian Members/Students Page
                        MemberPage mp = new MemberPage();
                        mp.Show();
                    }
                }
                else
                {
                    lblErrorMsg.Text      = "UserName or Password not correct.. Please Try Again !!";
                    lblErrorMsg.ForeColor = System.Drawing.Color.Red;
                    txtEmail.Clear();
                    txtPassword.Clear();
                    ddlRole.SelectedIndex = 0;
                    txtEmail.Focus();
                }
            }
        }