예제 #1
0
 public static List<Emplacement> getListEmplacement(String query)
 {
     NpgsqlConnection con = Connexion.Connection();
     try
     {
         List<Emplacement> l = new List<Emplacement>();
         NpgsqlCommand Lcmd = new NpgsqlCommand(query, con);
         NpgsqlDataReader lect = Lcmd.ExecuteReader();
         if (lect.HasRows)
         {
             while (lect.Read())
             {
                 Emplacement a = new Emplacement();
                 a.Id = Convert.ToInt64(lect["id"].ToString());
                 a.Code = lect["code"].ToString();
                 a.Designation = lect["designation"].ToString();
                 a.Defaut = (Boolean)((lect["defaut"] != null) ? (!lect["defaut"].ToString().Trim().Equals("") ? lect["defaut"] : false) : false);
                 //a.Articles = BLL.ArticleDepotBll.Liste("select * from yvs_base_article_depot where emplacement = " + 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
 public static Emplacement getAjoutEmplacement(Emplacement 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
 public static bool getUpdateEmplacement(Emplacement 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);
     }
 }
예제 #4
0
 public EmplacementBll(Emplacement unEmplacement)
 {
     emplacement = unEmplacement;
 }