コード例 #1
0
ファイル: RistourneDao.cs プロジェクト: dowesw/GESTION_CAISSE
 public static List<Ristourne> getListRistourne(String query)
 {
     NpgsqlConnection con = Connexion.Connection();
     try
     {
         List<Ristourne> l = new List<Ristourne>();
         NpgsqlCommand Lcmd = new NpgsqlCommand(query, con);
         NpgsqlDataReader lect = Lcmd.ExecuteReader();
         if (lect.HasRows)
         {
             while (lect.Read())
             {
                 Ristourne a = new Ristourne();
                 a.Id = Convert.ToInt64(lect["id"].ToString());
                 a.Reference = lect["reference"].ToString();
                 a.BaseRistourne = lect["base_ristourne"].ToString();
                 a.Permanent = Convert.ToBoolean((lect["permanent"] != null) ? (!lect["permanent"].ToString().Trim().Equals("") ? lect["permanent"].ToString().Trim() : "false") : "false");
                 a.Grilles = BLL.GrilleRistourneBll.Liste("SELECT * FROM yvs_com_grille_ristourne WHERE remise =" + a.Id);
                 a.Update = true;
                 l.Add(a);
             }
             lect.Close();
         }
         return l;
     }
     catch (NpgsqlException e)
     {
         Messages.Exception(e);
         return null;
     }
     finally
     {
         Connexion.Deconnection(con);
     }
 }
コード例 #2
0
ファイル: RistourneDao.cs プロジェクト: dowesw/GESTION_CAISSE
 public static Ristourne getAjoutRistourne(Ristourne 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);
     }
 }
コード例 #3
0
ファイル: RistourneBll.cs プロジェクト: dowesw/GESTION_CAISSE
 public RistourneBll(Ristourne unRistourne)
 {
     ristourne = unRistourne;
 }
コード例 #4
0
ファイル: RistourneDao.cs プロジェクト: dowesw/GESTION_CAISSE
 public static Ristourne getOneRistourne(long id)
 {
     NpgsqlConnection con = Connexion.Connection();
     try
     {
         String search = "select * from yvs_com_ristourne where id = " + id + "";
         NpgsqlCommand Lcmd = new NpgsqlCommand(search, con);
         NpgsqlDataReader lect = Lcmd.ExecuteReader();
         Ristourne a = new Ristourne();
         if (lect.HasRows)
         {
             while (lect.Read())
             {
                 a.Id = Convert.ToInt64(lect["id"].ToString());
                 a.Reference = lect["reference"].ToString();
                 a.BaseRistourne = lect["base_ristourne"].ToString();
                 a.Permanent = Convert.ToBoolean((lect["permanent"] != null) ? (!lect["permanent"].ToString().Trim().Equals("") ? lect["permanent"].ToString().Trim() : "false") : "false");
                 a.Grilles = BLL.GrilleRistourneBll.Liste("SELECT * FROM yvs_com_grille_ristourne WHERE remise =" + a.Id);
             }
             a.Update = true;
             lect.Close();
         }
         return a;
     }
     catch (NpgsqlException e)
     {
         Messages.Exception(e);
         return null;
     }
     finally
     {
         Connexion.Deconnection(con);
     }
 }
コード例 #5
0
ファイル: RistourneDao.cs プロジェクト: dowesw/GESTION_CAISSE
 public static bool getUpdateRistourne(Ristourne 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);
     }
 }