예제 #1
0
        private void newToolStripButton_Click(object sender, EventArgs e)
        {
            ItemUpdate it = new ItemUpdate();

            it.Show();
            this.Hide();
        }
예제 #2
0
        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();
                }
            }
        }
예제 #3
0
        private void itemToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ItemUpdate iu = new ItemUpdate();

            iu.Show();
        }