Beispiel #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            Admin_Screen AS = new Admin_Screen();

            AS.Show();
            this.Hide();
        }
Beispiel #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Admin_Screen ad = new Admin_Screen();

            ad.Show();
            this.Hide();
        }
Beispiel #3
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            conn.Open();
            SqlDataAdapter sda = new SqlDataAdapter("select count(*) from user_n where name='" + textBox1.Text + "' and password='******'", conn);
            DataTable      dt  = new DataTable();

            sda.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                Admin_Screen Ads = new Admin_Screen();
                Ads.Show();
                this.Hide();
            }

            else
            {
                MessageBox.Show("invalid user or password");
            }
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            conn.Open();
            cmd = new SqlCommand("insert into NB(CNAME,PNAME,LANGUAGE,PRICE,DESCRIPTION,COVERAGE,QUANTITY,TOTALPRICE,BILLNO) VALUES(@CNAME,@PNAME,@LANGUAGE,@PRICE,@DESCRIPTION,@COVERAGE,@QUANTITY,@COVERAGE,@BILLNO)", conn);
            cmd.Parameters.AddWithValue("PNAME", this.textBox7.Text);
            cmd.Parameters.AddWithValue("LANGUAGE", this.textBox1.Text);
            cmd.Parameters.AddWithValue("PRICE", this.textBox2.Text);
            cmd.Parameters.AddWithValue("DESCRIPTION", this.textBox3.Text);
            cmd.Parameters.AddWithValue("COVERAGE", this.textBox4.Text);
            cmd.Parameters.AddWithValue("CNAME", this.comboBox1.Text);
            cmd.Parameters.AddWithValue("QUANTITY", this.textBox8.Text);
            cmd.Parameters.AddWithValue("TOTALPRICE", this.textBox5.Text);
            cmd.Parameters.AddWithValue("BILLNO", this.textBox6.Text);

            cmd.ExecuteNonQuery();
            MessageBox.Show("ur record has ben inserted");
            Admin_Screen ad = new Admin_Screen();

            ad.Show();
            conn.Close();
        }