Esempio n. 1
0
        private void btnAdminLogin_Click(object sender, EventArgs e)
        {
            string userName     = txtAdminUsername.Text;
            string userPassword = txtAdminPassword.Text;

            if (userName.Equals(""))
            {
                MessageBox.Show("Please enter your Username");
            }
            else if (userPassword.Equals(""))
            {
                MessageBox.Show("Please enter your Password");
            }
            else
            {
                string query = "Select * from UserSignUp Where Username= '******' AND Password = '******'";

                objDbAccess.readDatathroughAdapter(query, dtUsers);

                if (dtUsers.Rows.Count == 1)
                {
                    Admin_class.username = dtUsers.Rows[0]["Username"].ToString();
                    MessageBox.Show("Congratulations, You are logged in Successfully!!");
                    objDbAccess.closeConn();

                    this.Hide();
                    Administrator_Portal admin = new Administrator_Portal();
                    admin.Show();
                }
                else
                {
                    MessageBox.Show("Invalid Credentials!!. Provide Correct Username and Password");
                }
            }
        }
Esempio n. 2
0
        private void btnAdminRemoveFile_Click(object sender, EventArgs e)
        {
            string fileNumber = txtAdminRemoveFile.Text;

            DialogResult dialog = MessageBox.Show("Are you sure you want to Close this file?", "Remove File", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dialog == DialogResult.Yes)
            {
                string query = "DELETE from fileRegistration Where FILE_NO = '" + fileNumber + "'";

                SqlCommand deleteCommand = new SqlCommand(query);

                int row = objDbAccess.executeQuery(deleteCommand);

                if (row == 1)
                {
                    MessageBox.Show("The File is Closed successfully!!");

                    this.Hide();
                    Administrator_Portal portal = new Administrator_Portal();
                    portal.Show();
                }
                else
                {
                    MessageBox.Show("Error Occured while removing the file..! Please try again!!");
                }
            }
        }
Esempio n. 3
0
        private void btnAdminPortal_Click(object sender, EventArgs e)
        {
            this.Hide();
            Administrator_Portal portal = new Administrator_Portal();

            portal.Show();
        }