public Concert(int guid, List<Artiste> artistes, string description, float tarif, string titre, Concert.DispositionCli disposition, int dureeMinute, int nombreLoges) : base(guid, artistes, description, tarif, titre) { mDisposition = disposition; mDureeMinute = dureeMinute; mNombreLoges = nombreLoges; }
public DalManager() { mArtistes = new List<Artiste>(); Artiste artiste_a = new Artiste(1, "Bogtob", "Karim", new DateTime(1212, 12, 12)); mArtistes.Add(artiste_a); Artiste artiste_b = new Artiste(2, "Faure", "Vivien", new DateTime(1111, 11, 11)); mArtistes.Add(artiste_b); Concert concert = new Concert(3, mArtistes, "LES BOGOSS", 2.00f, "LES BOGOSS EN FOLIE", Concert.DispositionCli.SUPERSON, 90, 3); Exposition exposition_a = new Exposition(4, mArtistes, "PEINTURE NEXT GEN", 2.00f, "NEW PEINTURES", 42); mLieux.Add(new Lieu(5, "84 Rue du Troufion", "99999", "Baie des cochons", 999, "CUBA", .2f, "+66666666", "Sierra Maestra")); mLieux.Add(new Lieu(6, "37B Rue des Alouettes", "63201", "Baie des singes", 1999, "FRANCE", .2f, "+06321303", "Clermont-Ferrand")); mPlannings.Add(new PlanningElement(7, new DateTime(2013, 1, 1), new DateTime(2013, 2, 1), concert, mLieux.ElementAt(0), 66)); mPlannings.Add(new PlanningElement(8, new DateTime(2014, 1, 1), new DateTime(2014, 2, 1), concert, mLieux.ElementAt(1), 66)); mPlannings.Add(new PlanningElement(9, new DateTime(2013, 2, 3), new DateTime(2013, 2, 5), exposition_a, mLieux.ElementAt(1), 59)); mUsers.Add("kbogtob", new User("Bogtob", "Karim", "kbogtob", "blabla")); mUsers.Add("vfaure", new User("Faure", "Vivien", "vfaure", "bloblo")); }
/// <see cref="IDal.Cs"/> public List<Evenement> GetEvenementByLieu(string lieu) { List<Evenement> events = new List<Evenement>(); Guid? placeGuid = getPlaceIdByName(lieu); DataTable table = GetDataTable("select ev.GUID, ev.TITLE, ev.DESCRIPTION, ev.PRICE, ev.EVENT_TYPE_GUID from EVENTS ev, EVENT_DATE_PLACE edp, PLACES p WHERE edp.PLACE_GUID = p.GUID AND edp.EVENT_GUID = ev.GUID AND p.GUID = '" + placeGuid + "';"); foreach (DataRow col in table.Rows) { string guid = col["GUID"].ToString(); string title = col["TITLE"].ToString(); string description = col["DESCRIPTION"].ToString(); string price = col["PRICE"].ToString(); string eventType = col["EVENT_TYPE_GUID"].ToString(); string eventTypeString = GetTypeFromEvent(eventType).ToLower(); Evenement evenement = null; switch (eventTypeString) { case "concert": evenement = new Concert(title, description, float.Parse(price), new Guid(guid), null, 0, 0, GetArtistsForEvent(guid)); break; case "exposition": evenement = new Exposition(title, description, float.Parse(price), new Guid(guid), 0, GetArtistsForEvent(guid)); break; } events.Add(evenement); } return events; }
/// <summary> /// Recherche un événement par son Guid /// </summary> /// <param name="inGuid">Guid de l'événement</param> /// <returns>Evénement concerné</returns> public Evenement GetEventByGuid(string inGuid) { Evenement evenement = null; DataTable table = GetDataTable("select * from EVENTS where GUID = '" + inGuid + "';"); if (table.Rows.Count > 0) { DataRow col = table.Rows[0]; string guid = col["GUID"].ToString(); string title = col["TITLE"].ToString(); string description = col["DESCRIPTION"].ToString(); string price = col["PRICE"].ToString(); string eventType = col["EVENT_TYPE_GUID"].ToString(); string eventTypeString = GetTypeFromEvent(eventType).ToLower(); switch (eventTypeString) { case "concert": evenement = new Concert(title, description, float.Parse(price), new Guid(guid), null, 0, 0, GetArtistsForEvent(guid)); break; case "exposition": evenement = new Exposition(title, description, float.Parse(price), new Guid(guid), 0, GetArtistsForEvent(guid)); break; } } return evenement; }
/// <see cref="IDal.Cs"/> public List<Evenement> GetAllEvenements() { List<Evenement> events = new List<Evenement>(); DataTable table = GetDataTable("select * from EVENTS;"); foreach (DataRow col in table.Rows) { string guid = col["GUID"].ToString(); string title = col["TITLE"].ToString(); string description = col["DESCRIPTION"].ToString(); string price = col["PRICE"].ToString(); string eventType = col["EVENT_TYPE_GUID"].ToString(); string eventTypeString = GetTypeFromEvent(eventType).ToLower(); Evenement evenement = null; switch (eventTypeString) { case "concert": evenement = new Concert(title, description, float.Parse(price), new Guid(guid), null, 0, 0, GetArtistsForEvent(guid)); break; case "exposition": evenement = new Exposition(title, description, float.Parse(price), new Guid(guid), 0, GetArtistsForEvent(guid)); break; } events.Add(evenement); } return events; }
/// <summary> /// Retourne la liste des evenement. /// </summary> /// <returns>La liste des evenement.</returns> public IList<Evenement> GetAllEvenements() { /// Pour éviter de recharger la Base de données alrs que rien n'a été modifié. if (_events == null) { _events = new List<Evenement>(); System.Guid guid; String title; String desc; float price; System.Guid eventType; DateTime? birthDate; String name; DataTable even = GetEvents(); foreach (DataRow row in even.Rows) { guid = (System.Guid)(row[even.Columns[0].ColumnName]); if (!row[even.Columns[1].ColumnName].Equals(System.DBNull.Value)) title = row[even.Columns[1].ColumnName].ToString(); else title = row[even.Columns[1].ColumnName].ToString(); if (!row[even.Columns[2].ColumnName].Equals(System.DBNull.Value)) desc = row[even.Columns[2].ColumnName].ToString(); else desc = null; price = (float)(row[even.Columns[3].ColumnName]); eventType = (System.Guid)row[even.Columns[4].ColumnName]; String str = eventType.ToString(); Evenement evenement = new Concert(desc, guid, price, title); /// On récupère les artistes associés à l'evenement. IList<Artiste> artistes = new List<Artiste>(); DataTable artists = GetArtists(evenement.Guid); foreach (DataRow rowArt in artists.Rows) { guid = (System.Guid)(rowArt[artists.Columns[0].ColumnName]); name = rowArt[artists.Columns[1].ColumnName].ToString(); if (!rowArt[artists.Columns[2].ColumnName].Equals(System.DBNull.Value)) birthDate = (DateTime?)rowArt[artists.Columns[2].ColumnName]; else birthDate = null; artistes.Add(new Artiste(guid, birthDate, name, "")); } evenement.Artistes = artistes; _events.Add(evenement); } } return _events; }
private Evenement getEvenement(string evnmtGuid) { DataTable dt = select("select * from EVENTS WHERE guid = '" + evnmtGuid + "';"); string guid, title, description, event_type_guid, type; float price; Evenement evenementRet; DataRow row = dt.Rows[0]; guid = row["GUID"].ToString(); title = row["TITLE"].ToString(); description = row["DESCRIPTION"].ToString(); event_type_guid = row["EVENT_TYPE_GUID"].ToString(); price = float.Parse(row["PRICE"].ToString()); type = getEventType(guid); if(type.Equals("concert")) { evenementRet = new Concert(getArtisteByEvenement(guid), description, guid, title, price, "aucune disposition particulière", getDureeMinute(guid)); } else { evenementRet = new Exposition(getArtisteByEvenement(guid), description, guid, title, price, 0); } return evenementRet; }
public PlanningElement() { MonEvenement = new Concert(); MonLieu = new Lieu(); }
public EntitiesLayer.Evenement castToEntitiesEvent() { EntitiesLayer.Evenement ev; if (Concert) ev = new EntitiesLayer.Concert(Artistes.castToArtiste(), Description, Guid, Tarif, Titre, DispositionParticuliere, DureeEnMinutes, NombreLoges); else ev = new EntitiesLayer.Exposition(NombreOeuvresExposees, Artistes.castToArtiste(), Description, Guid, Tarif, Titre); return ev; }