Exemple #1
0
 public void insert(VenteCarte carte)
 {
     try
     {
         venteCarteDAO.insert(carte);
     }
     catch (Exception e)
     {
         throw new Exception("Erreur dans VenteCarteService => insert:" + e.Message + e.StackTrace);
     }
 }
Exemple #2
0
 public void remove(VenteCarte carte)
 {
     try
     {
         venteCarteDAO.remove(carte);
     }
     catch (Exception e)
     {
         throw new Exception("Erreur dans VenteCarteService => remove:" + e.Message);
     }
 }
Exemple #3
0
 public void remove(VenteCarte carte)
 {
     conn = new DB().getConn();
     try
     {
         string query = "delete * from vente_carte where id = " + carte.Id;
         cmd = new NpgsqlCommand(query, conn);
         cmd.ExecuteNonQuery();
     }
     catch (Exception e)
     {
         throw new Exception("Erreur dans VenteCarteDAO=>remove " + e.Message);
     }
     finally
     {
         conn.Close();
     }
 }
Exemple #4
0
        public ActionResult VenteCarte(int livraison, int quantite, string pointDeVente, string date_vente)
        {
            //insertion vente carte
            venteCarteService = new VenteCarteService();
            pointVenteService = new PointDeVenteService();

            LivraisonCarte         liv        = new LivraisonCarte(livraison);
            PointDeVenteVue        pv         = new PointDeVenteVue(0, pointDeVente);
            List <PointDeVenteVue> listPV     = new PointDeVenteDAO().search(pv);
            PointDeVente           pointVente = new PointDeVente(listPV[0].Id);

            DateTime   date  = DateTime.Parse(date_vente);
            VenteCarte vente = new VenteCarte(liv, quantite, pointVente, date);

            venteCarteService.insert(vente);

            return(new EmptyResult());
        }
Exemple #5
0
 public void insert(VenteCarte carte)
 {
     conn = new DB().getConn();
     try
     {
         string query = "insert into vente_carte (id,livraison,quantite,point_de_vente,date_vente) values (nextval('seq_carte_vente')," + carte.Livraison.Id + ","
                        + carte.Quantite + "," + carte.Point_de_vente.Id + ",'" + carte.Date_vente + "')";
         Debug.WriteLine(query);
         cmd = new NpgsqlCommand(query, conn);
         cmd.ExecuteNonQuery();
     }
     catch (Exception e)
     {
         throw new Exception("Erreur dans VenteCarteDAO=>insert" + e.Message);
     }
     finally
     {
         conn.Close();
     }
 }