}   //End Of Insert Function

        public static void InsertData(InvoiceProductClass stock)
        {
            string query = "INSERT INTO InvoiceProductTable (ProductId, ProductQuantity, Total ) VALUES('" + stock.ProductId.ToUpper() + "','" + stock.Quantity.ToUpper() + "','" + stock.Totel + "' );";

            try
            {
                DataTable _dtable = null;

                _dtable = dbAccess.ReadDataFromDb(query);
            }
            catch (Exception ex)
            { throw ex; }
        }   //End Of Insert Function
Beispiel #2
0
        private void Savebtn_Click(object sender, EventArgs e)
        {
            InvoiceProductClass ss = new InvoiceProductClass();

            try
            {
                ss.ProductId = textBox1Product.Text.Trim();
                ss.Quantity  = textBoxQuantity.Text.Trim();
                ss.Totel     = textBoxTotel.Text;
                QueryClass.InsertData(ss);
                MessageBox.Show("Add Successfully");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error", ex.Message);
            }
        }