private void newToolStripButton_Click(object sender, EventArgs e) { ItemUpdate it = new ItemUpdate(); it.Show(); this.Hide(); }
private void textBox13_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyData == Keys.Enter) { if (isvalid()) { con1.Open(); SqlCommand com2 = new SqlCommand(); com2.Connection = con1; com2.CommandText = "SELECT * FROM Item WHERE ItemCode='" + comboBox1.Text.Trim() + "'"; SqlDataReader dr = com2.ExecuteReader(); if (dr.Read()) { com2.CommandText = "UPDATE Item SET ItemName='" + comboBox3.Text.Trim() + "',Type='" + textBox3.Text.Trim() + "',VID='" + comboBox2.Text.Trim() + "',Catogary='" + textBox5.Text.Trim() + "',UnitType='" + textBox6.Text.Trim() + "',Extra='" + textBox7.Text.Trim() + "',Saleprice='" + textBox8.Text.Trim() + "',LastPrice= '" + 0 + "',Disc= '" + 0 + "',Cost= '" + textBox11.Text.Trim() + "',Warrenty = '" + textBox12.Text.Trim() + "',Qnty = '" + textBox13.Text.Trim() + "' WHERE ItemCode='" + comboBox1.Text.Trim() + "' "; dr.Close(); com2.ExecuteNonQuery(); MessageBox.Show("Updated"); } con1.Close(); ItemUpdate iu = new ItemUpdate(); this.Hide(); iu.Show(); } } }
private void itemToolStripMenuItem1_Click(object sender, EventArgs e) { ItemUpdate iu = new ItemUpdate(); iu.Show(); }