Ejemplo n.º 1
0
 public static List<ModePaiement> getListModePaiement(String query)
 {
     NpgsqlConnection con = Connexion.Connection();
     try
     {
         List<ModePaiement> l = new List<ModePaiement>();
         NpgsqlCommand Lcmd = new NpgsqlCommand(query, con);
         NpgsqlDataReader lect = Lcmd.ExecuteReader();
         if (lect.HasRows)
         {
             while (lect.Read())
             {
                 ModePaiement a = new ModePaiement();
                 a.Id = Convert.ToInt64(lect["id"].ToString());
                 a.TypePaiement = lect["type_paiement"].ToString();
                 a.Update = true;
                 l.Add(a);
             }
             lect.Close();
         }
         return l;
     }
     catch (NpgsqlException e)
     {
         Messages.Exception(e);
         return null;
     }
     finally
     {
         Connexion.Deconnection(con);
     }
 }
Ejemplo n.º 2
0
 public static ModePaiement getAjoutModePaiement(ModePaiement a)
 {
     NpgsqlConnection con = Connexion.Connection();
     try
     {
         string insert = "";
         NpgsqlCommand cmd = new NpgsqlCommand(insert, con);
         cmd.ExecuteNonQuery();
         a.Id = getCurrent();
         return a;
     }
     catch
     {
         return null;
     }
     finally
     {
         Connexion.Deconnection(con);
     }
 }
Ejemplo n.º 3
0
 public ModePaiementBll(ModePaiement unModePaiement)
 {
     mode = unModePaiement;
 }
Ejemplo n.º 4
0
 public static ModePaiement getOneModePaiement(long id)
 {
     NpgsqlConnection con = Connexion.Connection();
     try
     {
         String search = "select * from yvs_mode_paiement where id = " + id + "";
         NpgsqlCommand Lcmd = new NpgsqlCommand(search, con);
         NpgsqlDataReader lect = Lcmd.ExecuteReader();
         ModePaiement a = new ModePaiement();
         if (lect.HasRows)
         {
             while (lect.Read())
             {
                 a.Id = Convert.ToInt64(lect["id"].ToString());
                 a.TypePaiement = lect["type_paiement"].ToString();
                 a.Update = true;
             }
             lect.Close();
         }
         return a;
     }
     catch (NpgsqlException e)
     {
         Messages.Exception(e);
         return null;
     }
     finally
     {
         Connexion.Deconnection(con);
     }
 }
Ejemplo n.º 5
0
 public static bool getUpdateModePaiement(ModePaiement a)
 {
     NpgsqlConnection con = Connexion.Connection();
     try
     {
         string update = "";
         NpgsqlCommand Ucmd = new NpgsqlCommand(update, con);
         Ucmd.ExecuteNonQuery();
         return true;
     }
     catch (Exception e)
     {
         Messages.Exception(e);
         return false;
     }
     finally
     {
         Connexion.Deconnection(con);
     }
 }