示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            conn.oleDbConnection1.Open();
            OleDbCommand cmd = new OleDbCommand("Update Customer set Cname=@Cname,City=@City,PH1=@PH1,PH2=@PH2,ContectPerson=@ContectPerson,CreditLimit=@CreditLimit,CStatus=@CStatus where CID=@CID", conn.oleDbConnection1);

            cmd.Parameters.AddWithValue("@Cname", textBox2.Text);
            cmd.Parameters.AddWithValue("@City", textBox3.Text);
            cmd.Parameters.AddWithValue("@PH1", er.textBox59.Text);
            cmd.Parameters.AddWithValue("@PH2", er.textBox58.Text);
            cmd.Parameters.AddWithValue("@ContectPerson", textBox6.Text);
            cmd.Parameters.AddWithValue("@CreditLimit", textBox7.Text);
            cmd.Parameters.AddWithValue("@CStatus", "Active");
            cmd.Parameters.AddWithValue("@CID", textBox1.Text);
            cmd.ExecuteNonQuery();
            conn.oleDbConnection1.Close();
            MessageBox.Show("Congrats! Customer has been Approved", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Hide();
            er.Show();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            conn.oleDbConnection1.Open();
            OleDbCommand    cmd = new OleDbCommand("Select * from Login", conn.oleDbConnection1);
            OleDbDataReader dr  = cmd.ExecuteReader();

            while (dr.Read())
            {
                if (this.textBox1.Text == dr["Username"].ToString() && this.textBox2.Text == dr["Password"].ToString())
                {
                    ERP form = new ERP();
                    this.Hide();
                    form.Show();
                }
                else
                {
                    MessageBox.Show("Incorrect Username or Password!");
                }
            }
            conn.oleDbConnection1.Close();
        }
示例#3
0
        private void button1_Click(object sender, EventArgs e)
        {
            conn.oleDbConnection1.Open();
            OleDbCommand cmd = new OleDbCommand("Insert into vendor(vstatus,vid,vname,vcity,ph1,ph2,vaddress,cpname,vemail,vgroup,cpph)values(@vsatus,@vid,@vname,@vcity,@ph1,@ph2,@vaddress,@cpname,@vemail,@vgroup,@cpph)", conn.oleDbConnection1);

            cmd.Parameters.AddWithValue("@vstatus", "Active");
            cmd.Parameters.AddWithValue("@vid", this.textBox10.Text);
            cmd.Parameters.AddWithValue("@vname", this.textBox9.Text);
            cmd.Parameters.AddWithValue("@vcity", this.textBox8.Text);
            cmd.Parameters.AddWithValue("@ph1", this.textBox7.Text);
            cmd.Parameters.AddWithValue("@ph2", this.textBox6.Text);
            cmd.Parameters.AddWithValue("@vaddress", this.textBox11.Text);
            cmd.Parameters.AddWithValue("@cpname", this.textBox12.Text);
            cmd.Parameters.AddWithValue("@vgroup", this.textBox13.Text);
            cmd.Parameters.AddWithValue("@vemail", this.textBox14.Text);
            cmd.Parameters.AddWithValue("@cpph", this.textBox15.Text);
            cmd.ExecuteNonQuery();
            this.Hide();
            MessageBox.Show("Approved! Your status is Active now.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            conn.oleDbConnection1.Close();
            frm2.Show();
        }