Ejemplo n.º 1
0
        private void Lblcategory_Click(object sender, EventArgs e)
        {
            categorylists cat = new categorylists();
            cat.TopLevel = false;
            panel3.Controls.Add(cat);
            cat.BringToFront();
            cat.loadItems();

            cat.Show();
        }
Ejemplo n.º 2
0
        private void Btnsave_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("Are you sure you want to add this Item?", "Saving Item", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    conn.Open();
                    comm = new SqlCommand("INSERT INTO tblitems(item_code,item_name,quantity) VALUES (@item_code,@item_name,@quantity)", conn);
                    comm.Parameters.AddWithValue("@item_code", txtId.Text);
                    comm.Parameters.AddWithValue("@item_name", txtName.Text);
                    comm.Parameters.AddWithValue("@quantity", txtQuantity.Text);

                    comm.ExecuteNonQuery();
                    conn.Close();
                    MessageBox.Show("Item Sucessfully added!");
                    Clear();
                    flist.loadItems();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }