Package models

Examples of models.Nature


    List<Nature> q =  Nature.find.all();
    return ok(index.render(q));
  }

  public static Result create() {
    Nature existingNature = new Nature();
    return ok(create.render(natureForm.fill(existingNature)));
  }
View Full Code Here


    Nature existingNature = new Nature();
    return ok(create.render(natureForm.fill(existingNature)));
  }

  public static Result edit(Integer id) {
    Nature existingNature = Nature.find.byId(id);
        return ok(edit.render(natureForm.fill(existingNature)));
  }
View Full Code Here

    Nature existingNature = Nature.find.byId(id);
        return ok(edit.render(natureForm.fill(existingNature)));
  }

  public static Result delete(Integer id) {
    Nature existingNature = Nature.find.byId(id);
    existingNature.delete();
    List<Nature> q =  Nature.find.all();
    return redirect("/nature");
  }
View Full Code Here

    Form<Nature> filledForm = natureForm.bindFromRequest();
       
        if(filledForm.hasErrors()) {
            return badRequest(edit.render(filledForm));
        } else {
            Nature updated = filledForm.get();
            updated.ID = id;
            updated.update();
            flash("success", "Nature mise à jours");
            return ok(edit.render(natureForm.fill(updated)));
        }
  }
View Full Code Here

  public static Result insert() {
    Form<Nature> filledForm = natureForm.bindFromRequest();
        if(filledForm.hasErrors()) {
            return ok(create.render(filledForm));
        } else {
            Nature created = filledForm.get();
            created.save();
            flash("success", "Nature ajoutée");
            return redirect("/nature");
        }
    }
View Full Code Here

TOP

Related Classes of models.Nature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.