Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form13 obj = new Form13();

            obj.Show();
            this.Hide();
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form13 obj = new Form13();

            obj.Show();
            this.Hide();
            Personal_Number = null;
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && textBox2.Text != "")
            {
                SqlConnection con   = new SqlConnection(cs);
                String        query = "select * from user_information where  mobile_number=@mobile_number and pass=@pass ";
                SqlCommand    cmd   = new SqlCommand(query, con);
                cmd.Parameters.AddWithValue("@mobile_number ", textBox1.Text);
                cmd.Parameters.AddWithValue("@pass", textBox2.Text);

                con.Open();

                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.HasRows == true)
                {
                    MessageBox.Show("Login successful", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    n = textBox1.Text;
                    dr.Read();
                    if (dr[4].ToString() == "Admin" || dr[4].ToString() == "Admin ")
                    {
                        Form9 obj = new Form9();
                        obj.Show();
                        this.Hide();
                    }
                    else if (dr[4].ToString() == "Personal User " || dr[4].ToString() == "Personal User")
                    {
                        Form2 obj = new Form2();
                        obj.Show();
                        this.Hide();
                    }
                    else if (dr[4].ToString() == "Agent " || dr[4].ToString() == "Agent")
                    {
                        Form8 obj = new Form8();
                        obj.Show();
                        this.Hide();
                    }
                    else if (dr[4].ToString() == "Merchandiser " || dr[4].ToString() == "Merchandiser")
                    {
                        Form13 obj = new Form13();
                        obj.Show();
                        this.Hide();
                    }
                }
                else
                {
                    MessageBox.Show("Wrong Mobile Number or password", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                con.Close();
            }
            else
            {
                MessageBox.Show("Please fill up the information");
            }
        }