Пример #1
0
        public static void AddProduct()
        {
            Frm_product _owner = new Frm_product();

            SqlCommand    cmd  = new SqlCommand();
            SqlConnection conn = new SqlConnection();

            conn.ConnectionString = ConfigurationManager.ConnectionStrings["connGlobal"].ToString();

            conn.Open();
            cmd.Connection = conn;
            string INSERT = "INSERT INTO tbl_ProductInfo(Product_Code,Description,Barcode,Category,Unit_Price,Stock,Reorder_level)VALUES(@proCode,@description,@barCode,@category,@unitPrice,@quantityStock,@reorderLevel)";

            cmd.Parameters.AddWithValue("proCode", Frm_product.productCode);
            cmd.Parameters.AddWithValue("description", Frm_product.description);
            cmd.Parameters.AddWithValue("barCode", Frm_product.barcode);
            cmd.Parameters.AddWithValue("category", Frm_product.category);
            cmd.Parameters.AddWithValue("unitPrice", Frm_product.unitPrice);
            cmd.Parameters.AddWithValue("quantityStock", Frm_product.quantityStock);
            cmd.Parameters.AddWithValue("reorderLevel", Frm_product.reorderLevel);
            cmd.CommandText = INSERT;
            cmd.ExecuteNonQuery();
            conn.Close();
            cmd.Parameters.Clear();

            Frm_product.productNo     = null;
            Frm_product.productCode   = null;
            Frm_product.description   = null;
            Frm_product.barcode       = null;
            Frm_product.category      = null;
            Frm_product.unitPrice     = null;
            Frm_product.quantityStock = null;
            Frm_product.reorderLevel  = null;
        }
Пример #2
0
        public static void AddVat()
        {
            Frm_product _owner = new Frm_product();

            SqlCommand    cmd  = new SqlCommand();
            SqlConnection conn = new SqlConnection();

            conn.ConnectionString = ConfigurationManager.ConnectionStrings["connGlobal"].ToString();

            conn.Open();
            cmd.Connection = conn;
            string INSERT = "INSERT INTO tbl_VAT(VAT)VALUES(@vat)";

            cmd.Parameters.AddWithValue("vat", Frm_settingsSystem.vat);
            cmd.CommandText = INSERT;
            cmd.ExecuteNonQuery();
            conn.Close();
            cmd.Parameters.Clear();

            Frm_settingsSystem.vat = null;
        }
Пример #3
0
        private void metroTile3_Click(object sender, EventArgs e)
        {
            Frm_product fproduct = new Frm_product();

            fproduct.ShowDialog();
        }
Пример #4
0
        private void invetoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Frm_product fcrud = new Frm_product();

            fcrud.ShowDialog();
        }