private void button1_Click_1(object sender, EventArgs e)
        {
            string[] param = { "a_email", "a_pass" };
            string[] val   = { txt_email.Text, txt_pass.Text };

            if (!_validate.checkEmpty(val))
            {
                Admin ad = _sqlmng.Login("a_login", param, val);
                if (ad.a_id > 0)
                {
                    if (ad.a_status != 'P')
                    {
                        Admin _admin = new Admin();
                        this.Hide();
                        DashboardAdmin db = new DashboardAdmin(_sqlmng, ad);
                        db.Show();
                    }
                    else
                    {
                        MessageBox.Show("Account Request Waiting for approval");
                    }
                }
                else
                {
                    MessageBox.Show("Invalid Username Password");
                }
            }
            else
            {
                MessageBox.Show("Please enter Id and Password Both");
            }
        }
        private void btn_PassConfrim_Click(object sender, EventArgs e)
        {
            String sp_Name = "sp_ChangePassword";

            string[] param = { "std_Id", "std_Pass" };
            string[] val   = { _student.ID.ToString(), txt_ChangePass.Text };

            if (!_validate.checkEmpty(val))
            {
                _sql.ProcessDB(sp_Name, param, val);
                MessageBox.Show("Password Changed");
            }
            else if (!(txt_ChangePass.Text.Equals(txt_ChangePassConfirm)))
            {
                MessageBox.Show("Passwords Not Same!");
            }
            else
            {
                MessageBox.Show("Please Fill the fields");
            }
        }
Ejemplo n.º 3
0
        //SqlMng mng = new SqlMng();
        private void btn_AddSlots_Click(object sender, EventArgs e)
        {
            string[] param = { "s_name" };
            string[] val = { txt_Slot.Text };

            if (!_validate.checkEmpty(val))
            {
                _sqlMng.insertDB("sp_addSlot", param, val);
            }
            else
            {

            }

        }
Ejemplo n.º 4
0
        //SqlMng mng = new SqlMng();



        private void btn_AddDevice_Click(object sender, EventArgs e)
        {
            string[] param = { "d_name" };
            string[] val   = { txt_Devices.Text };
            if (!_validate.checkEmpty(val))
            {
                _sqlMng.insertDB("add_device", param, val);
                _utils.Load_DataGrid(dgv_Devices, _sqlMng, "sp_getDevices");
            }
            else
            {
                MessageBox.Show("Please provide the Device Name");
            }

            // dataGridView1.Refresh();
        }
Ejemplo n.º 5
0
        private void btn_ChangePass_click(object sender, EventArgs e)
        {
            string[] fields  = { _admin.a_id.ToString(), txt_currrent.Text, txt_new.Text };
            string[] param   = { "a_ID", "a_Pass", "a_NewPass" };
            string   sp_Name = "sp_ChangeAdminPass";


            if (!_validate.checkEmpty(fields))
            {
                _sql.ProcessDB(sp_Name, param, fields);
                MessageBox.Show("Password Updated");
            }
            else
            {
                MessageBox.Show("Failed");
            }
        }
        private void btn_submit_Click(object sender, EventArgs e)
        {
            bool IsValidPass  = _validate.IsValidPassword(txt_pass.Text);
            bool IsValidEmail = _validate.IsValidEmail(txt_email.Text);
            bool EmailPresent = _validate.EmailPresent(txt_email.Text);

            if (txt_pass.Text.Equals(txt_c_pass.Text) && IsValidPass && IsValidEmail && !EmailPresent)
            {
                string[] param  = { "a_name", "a_email", "a_pass" };
                string[] values = { txt_name.Text, txt_email.Text, txt_pass.Text };
                //SqlMng mng = new SqlMng();

                if (!_validate.checkEmpty(values))
                {
                    sqlMng.insertDB("admin_signup", param, values);
                    MessageBox.Show("Your request has been sent");
                }
                else
                {
                    MessageBox.Show("All Fields are required!");
                }
            }
            else if (!IsValidPass)
            {
                MessageBox.Show("Password must be more then 6 characters!");
            }
            else if (!IsValidEmail)
            {
                MessageBox.Show("Enter a proper Email");
            }
            else if (EmailPresent)
            {
                MessageBox.Show("Email already in use");
            }
            else if (!txt_pass.Text.Equals(txt_c_pass.Text))
            {
                MessageBox.Show("Passwords do not match");
            }
        }
Ejemplo n.º 7
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            string[] param     = { "std_ID", "std_pass" };
            string[] value     = { txt_Id.Text, txt_Pass.Text };
            string   spName    = "Student_Login";
            bool     emptyFlag = _validate.checkEmpty(value);

            if (!emptyFlag)
            {
                try
                {
                    _student = _sql.Login(spName, param, value);
                }
                catch
                {
                }

                if (_student != null && _student.ID != 0 && _student.Status == "A")
                {
                    Dashboard _dashboard = new Dashboard(_student);
                    Entry     _entery    = new Entry();
                    _dashboard.Show();
                    this.TopLevelControl.Hide();
                }
                else if (_student.Status == "P")
                {
                    MessageBox.Show("Your Approval is still pending");
                }
                else
                {
                    MessageBox.Show("ID or Password do not match!");
                }
            }
            else
            {
                MessageBox.Show("All Fields are required!");
            }
        }
Ejemplo n.º 8
0
        private void btn_SignUp_Click(object sender, EventArgs e)
        {
            InitVariables();

            bool isValidEmail = vl.IsValidEmail(txt_Email.Text);
            bool emptyFlag    = vl.checkEmpty(fields);
            bool isValidPhone = vl.IsValidPhone(txt_Phone.Text);
            bool isValidPass  = vl.IsValidPassword(txt_Pass.Text);
            bool IdPresent    = vl.IdPresent(txt_Id.Text);

            if (emptyFlag == false && isValidEmail && isValidPhone && IdPresent == false && isValidPass)
            {
                sql.ProcessDB(sp_Name, param, value);
                MessageBox.Show("You are Registered!");
            }
            else if (IdPresent)
            {
                MessageBox.Show("You are already Registered");
            }
            else if (!isValidPass)
            {
                MessageBox.Show("Password should be more then 6 characters!");
            }
        }