Exemplo n.º 1
0
 public static Boolean save(Acheteur obj)
 {
     if (obj.Id == Guid.Empty)
     {
         return(insert(obj));
     }
     else
     {
         return(update(obj));
     }
 }
Exemplo n.º 2
0
        public static Acheteur getFirst(string where)
        {
            Acheteur 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 Acheteur createEntityFrom(Dictionary <string, object> dict)
        {
            Acheteur ob = new Acheteur()
            {
                id          = Guid.Parse((String)dict["id"]),
                Nom         = (String)dict["nomacheteur"],
                Prenom      = (String)dict["prenomacheteur"],
                Adresse     = (String)dict["adresseacheteur"],
                Telfixe     = (String)dict["telfixeacheteur"],
                Telportable = (String)dict["telmobileacheteur"],
                Email       = (String)dict["emailacheteur"],
                Idagent     = (String)dict["idagent"]
            };

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