public static Boolean save(Vendeur obj)
 {
     if (obj.Id == Guid.Empty)
     {
         return(insert(obj));
     }
     else
     {
         return(update(obj));
     }
 }
        public static Vendeur getFirst(string where)
        {
            Vendeur res = null;

            var temp = DbManager.getFirst(Configuration.Config.DB_PATH, TABLE_NAME, where);

            if (temp != null)
            {
                res = createEntityFrom(temp);
            }

            return(res);
        }
        private static Vendeur createEntityFrom(Dictionary <string, object> dict)
        {
            Vendeur ob = new Vendeur()
            {
                id          = Guid.Parse((String)dict["id"]),
                Nom         = (String)dict["nom"],
                Prenom      = (String)dict["prenom"],
                Adresse     = (String)dict["adresse"],
                Ville       = (String)dict["ville"],
                Telfixe     = (String)dict["telfixe"],
                Telportable = (String)dict["telportable"],
                Email       = (String)dict["email"]
            };

            return(ob);
        }
 public static Boolean delete(Vendeur obj)
 {
     return(DbManager.delete(Configuration.Config.DB_PATH, TABLE_NAME, TABLE_NAME + ".ID = '" + obj.Id + "'"));
 }
 public static Boolean update(Vendeur obj)
 {
     return(DbManager.update(Configuration.Config.DB_PATH, TABLE_NAME, COLUMNS, obj.getValues(), TABLE_NAME + ".ID = '" + obj.Id + "'"));
 }
 public static Boolean insert(Vendeur obj)
 {
     //obj.id = Guid.NewGuid();
     return(DbManager.insert(Configuration.Config.DB_PATH, TABLE_NAME, COLUMNS, obj.getValues()));
 }