示例#1
0
        public PolicePendingRequest(PoliceHome ph)
        {
            InitializeComponent();
            this.ph = ph;
            this.Da = new DataAccess();

            this.PopulateGridView();
        }
示例#2
0
        private void BtnLoginLogin_Click(object sender, EventArgs e)
        {
            string sql = @"select category from login where nid='" + this.txtboxNidLogin.Text + "' and password='******';";

            this.Ds = this.Da.ExecuteQuery(sql);
            title   = this.Ds.Tables[0].Rows[0]["category"].ToString();



            try
            {
                if (title == "citizen")
                {
                    MessageBox.Show("Login Approved");
                    CitizenHome ch = new CitizenHome(this, this.txtboxNidLogin.Text);

                    ch.Visible   = true;
                    this.Visible = false;

                    txtboxNidLogin.Text      = "";
                    txtBoxPasswordLogin.Text = "";
                }

                else if (title == "citycorp")
                {
                    MessageBox.Show("Login Approved");
                    AuthorityHome ah = new AuthorityHome(this);
                    ah.Visible   = true;
                    this.Visible = false;

                    txtboxNidLogin.Text      = "";
                    txtBoxPasswordLogin.Text = "";
                }

                else if (title == "police")
                {
                    MessageBox.Show("Login Approved");
                    PoliceHome ph = new PoliceHome(this);
                    ph.Visible   = true;
                    this.Visible = false;

                    txtboxNidLogin.Text      = "";
                    txtBoxPasswordLogin.Text = "";
                }
                else
                {
                    MessageBox.Show("Login Declined");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Password didnot match");
                //MessageBox.Show("Exception: " + ex);
            }
        }