コード例 #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     ConnectionClass.UpdateCommand("update product set BusinessTypeName='" + BusinessName.Text + "',Description='" + Description.Text + "' where  BusinessType_ID='" + pidM + "'");
     MessageBox.Show("Successfully Added");
     dgv.DataSource = ConnectionClass.Selectcommand("select * from Product");
     this.Close();
 }
コード例 #2
0
ファイル: ChangePassword.cs プロジェクト: sajeee/KPRA-GIMS
 private void button2_Click(object sender, EventArgs e)
 {
     if (Textbox2.Text == textBox3.Text)
     {
         int a = ConnectionClass.UpdateCommand("update login " +
                                               "set Password='******' where username='******' and Password='******'");
         if (a > 0)
         {
             MessageBox.Show("Successfully Changed", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
             Textbox1.Text = "";
             Textbox2.Text = "";
             textBox3.Text = "";
             label3.Text   = "";
             label6.Text   = "";
             label2.Text   = "";
         }
         else
         {
             MessageBox.Show("Old Password is not valid", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             label2.Text = "Error";
         }
     }
     else
     {
         MessageBox.Show("New Password does not match", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         label3.Text = "Error";
         label6.Text = "Error";
     }
 }
コード例 #3
0
ファイル: Update_Product.cs プロジェクト: sajeee/KPRA-GIMS
        private void button3_Click(object sender, EventArgs e)
        {
            ConnectionClass.UpdateCommand("update product set ProductCode='" + ProductCode.Text + "',ProductName='" + ProductName.Text + "',CostPrice='" + CostPrice.Text + "',SalePrice='" + SalePrice.Text + "',Description='" + Description.Text + "' where productid='" + pid + "'");
            MessageBox.Show("Sucessfully Added !", "Success Message", MessageBoxButtons.OK, MessageBoxIcon.Information);

            dgv.DataSource = ConnectionClass.Selectcommand("select * from Product");
            this.Close();
        }