コード例 #1
0
 public static Boolean save(Souhait obj)
 {
     if (obj.Id == Guid.Empty)
     {
         return(insert(obj));
     }
     else
     {
         return(update(obj));
     }
 }
コード例 #2
0
        public static Souhait getFirst(string where)
        {
            Souhait res = null;

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

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

            return(res);
        }
コード例 #3
0
        private static Souhait createEntityFrom(Dictionary <string, object> dict)
        {
            Souhait ob = new Souhait()
            {
                Id     = Guid.Parse((String)dict["id"]),
                Statut = (String)dict["statuts"],
                Type   = (String)dict["types"],
                Surface_habitable_min = Aide.parseInt(dict["surfacehabitemin"].ToString()),
                Surface_parcelle_min  = Aide.parseInt(dict["surfaceparcellemin"].ToString()),
                Chambre_min           = Aide.parseInt(dict["nombrechambremin"].ToString()),
                Cave         = (String)dict["aveccaves"],
                Garage       = (String)dict["avecgarages"],
                Ville        = (String)dict["villes"],
                Prix_max     = Aide.parseFloat(dict["prixmax"].ToString()),
                Id_acheteur  = (String)dict["idacheteur"],
                Nom_acheteur = (String)dict["nomacheteur"]
            };

            return(ob);
        }
コード例 #4
0
 public static Boolean delete(Souhait obj)
 {
     return(DbManager.delete(Configuration.Config.DB_PATH, TABLE_NAME, TABLE_NAME + ".ID = '" + obj.Id + "'"));
 }
コード例 #5
0
 public static Boolean update(Souhait obj)
 {
     return(DbManager.update(Configuration.Config.DB_PATH, TABLE_NAME, COLUMNS, obj.getValues(), TABLE_NAME + ".ID = '" + obj.Id + "'"));
 }
コード例 #6
0
 public static Boolean insert(Souhait obj)
 {
     //obj.id = Guid.NewGuid();
     return(DbManager.insert(Configuration.Config.DB_PATH, TABLE_NAME, COLUMNS, obj.getValues()));
 }