Пример #1
0
        private void Button14_Click(object sender, EventArgs e)
        {
            WarehouseStatusReport w1 = new WarehouseStatusReport();

            this.Hide();
            w1.Show();
        }
Пример #2
0
 private void Button7_Click(object sender, EventArgs e)
 {
     try
     {
         m.Close();
         m.Open();
         SqlCommand cmd = new SqlCommand("delete from [dbo].[warehouse] where Wid='" + textBox1.Text + "'", m);
         int        a   = cmd.ExecuteNonQuery();
         if (a > 0)
         {
             MessageBox.Show("Deleted");
             textBox1.Clear();
             this.Hide();
             WarehouseStatusReport f1 = new WarehouseStatusReport();
             f1.Show();
         }
         else
         {
             MessageBox.Show("Invalid");
         }
         m.Close();
     }
     catch
     {
     }
 }
Пример #3
0
        private void Button8_Click(object sender, EventArgs e)
        {
            try
            {
                m.Close();
                m.Open();
                SqlCommand cmd = new SqlCommand("update [dbo].[warehouse] set Wname = '" + textBox2.Text + "', FoodName = '" + textBox3.Text + "', Quantity = '" + textBox4.Text + "'  where Wid='" + textBox1.Text + "'", m);
                int        a   = cmd.ExecuteNonQuery();
                if (a > 0)
                {
                    MessageBox.Show("Updated");
                    textBox1.Clear();
                    textBox2.Clear();
                    textBox3.Clear();
                    textBox4.Clear();

                    this.Hide();
                    WarehouseStatusReport f1 = new WarehouseStatusReport();
                    f1.Show();
                }
                else
                {
                    MessageBox.Show("Invalid");
                }
                m.Close();
            }
            catch
            {
                MessageBox.Show("Error!!");
            }
        }