Exemplo n.º 1
0
        public void ExecuteInsertVanzareServiciuProcedure(ItemGVTotalModel Serviciu, int IdVanzare)
        {
            try
            {
                using (SqlCommand SqlCommand_SC = new SqlCommand("InsertVanzareServiciuProc", DataBaseConnection_SqlCOnnection))
                {
                    SqlCommand_SC.CommandType = CommandType.StoredProcedure;

                    SqlCommand_SC.Parameters.AddWithValue("inputidserviciu", Serviciu.Id);
                    SqlCommand_SC.Parameters.AddWithValue("@inputcantitate", Serviciu.Cantitate);
                    SqlCommand_SC.Parameters.AddWithValue("@inputprettotal", Serviciu.Pret);
                    SqlCommand_SC.Parameters.AddWithValue("@inputidvanzare", IdVanzare);


                    DataBaseConnection_SqlCOnnection.Open();
                    SqlCommand_SC.ExecuteNonQuery();

                    DataBaseConnection_SqlCOnnection.Close();
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        public void ExecuteScadereStocProcedure(ItemGVTotalModel Produs)
        {
            try
            {
                using (SqlCommand SqlCommand_SC = new SqlCommand("ScadereStocProc", DataBaseConnection_SqlCOnnection))
                {
                    SqlCommand_SC.CommandType = CommandType.StoredProcedure;

                    SqlCommand_SC.Parameters.AddWithValue("@inputidprodus", Produs.Id);
                    SqlCommand_SC.Parameters.AddWithValue("@inputcantitate", Produs.Cantitate);


                    DataBaseConnection_SqlCOnnection.Open();
                    SqlCommand_SC.ExecuteNonQuery();

                    DataBaseConnection_SqlCOnnection.Close();
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }