@@ -0,0 +1,2505 @@
+package fr.paris10.projet.assogenda.assogenda.model;%0A%0Aimport com.google.firebase.database.Exclude;%0A%0Aimport java.text.DateFormat;%0Aimport java.util.Date;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A/**%0A * Created by wilpiron on 28/02/2017.%0A */%0A%0Apublic class Event %7B%0A    public String id;%0A    public String name;%0A    public Date start;%0A    public Date end;%0A    public String description;%0A    public String location;%0A    public List%3CString%3E tags;%0A    public int price;%0A    public int bail;%0A    public int seat_number;%0A    public int seat_free;%0A    public Association association;%0A    public int logo;%0A%0A    public static DateFormat dateFormat =%0A            DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);%0A%0A    public Event()%7B%0A    %7D%0A%0A    public Event(String name, Date start, Date end, String description, String location,%0A                 int price, int bail, int seat_number, Association association, int logo)%7B%0A        this.name=name;%0A        this.start=start;%0A        this.end=end;%0A        this.description=description;%0A        this.location=location;%0A        this.price=price;%0A        this.bail=bail;%0A        this.seat_number=seat_number;%0A        this.seat_free=seat_number;%0A        this.logo=logo;%0A        this.association=association;%0A    %7D%0A%0A    public Event(String name, Date start, Date end, String description)%7B%0A        this.name=name;%0A        this.start=start;%0A        this.end=end;%0A        this.description=description;%0A    %7D%0A%0A    /**%0A     * Two methods to control the number of seats available%0A     */%0A%0A    public void reserveSeat()%7B%0A        seat_free -= seat_free;%0A    %7D%0A%0A    public void freeSeat()%7B%0A        seat_free += seat_free;%0A    %7D%0A%0A    /**%0A     * Define how data will be stored in database%0A     */%0A    @Exclude%0A    public Map%3CString, Object%3E toMap() %7B%0A        Map%3CString, Object%3E result = new HashMap%3C%3E();%0A        result.put(%22name%22, name);%0A        result.put(%22association%22, association.name);%0A        result.put(%22location%22, location);%0A        result.put(%22start%22, dateFormat.format(start));%0A        result.put(%22end%22,dateFormat.format(end));%0A        return result;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        StringBuilder sb = new StringBuilder();%0A        sb.append(%22name= %22).append(name).append(%22%5Cn%22);%0A        //sb.append(%22association= %22).append(association.name).append(%22%5Cn%22);%0A        sb.append(%22start= %22).append(start).append(%22%5Cn%22);%0A        sb.append(%22end= %22).append(end).append(%22%5Cn%22);%0A        return sb.toString();%0A    %7D%0A%7D%0A

Add class Event to William for use database