Exemplo n.º 1
0
 public static Boolean save(Vendeur obj)
 {
     if (obj.Id == Guid.Empty)
     {
         return(insert(obj));
     }
     else
     {
         return(update(obj));
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public static Boolean delete(Vendeur obj)
 {
     return(DbManager.delete(Configuration.Config.DB_PATH, TABLE_NAME, TABLE_NAME + ".ID = '" + obj.Id + "'"));
 }
Exemplo n.º 5
0
 public static Boolean update(Vendeur obj)
 {
     return(DbManager.update(Configuration.Config.DB_PATH, TABLE_NAME, COLUMNS, obj.getValues(), TABLE_NAME + ".ID = '" + obj.Id + "'"));
 }
Exemplo n.º 6
0
 public static Boolean insert(Vendeur obj)
 {
     //obj.id = Guid.NewGuid();
     return(DbManager.insert(Configuration.Config.DB_PATH, TABLE_NAME, COLUMNS, obj.getValues()));
 }