annotate Agendas/trunk/src/Agendas.Domain/Evento.cs @ 73:76567a0d1e44

Eliminando algunas propiedades que no se estaban usando
author nelopauselli
date Mon, 23 May 2011 19:54:05 -0300
parents c7264bfc4b71
children bc46e7426c80
rev   line source
1
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
1 using System;
12
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
2 using System.Collections.Generic;
1
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
3
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
4 namespace AltNetHispano.Agendas.Domain
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
5 {
56
65bbcdd5d357 Pasando la responsabilidad de generar el Id al repositorio
nelopauselli
parents: 54
diff changeset
6 public class Evento : Identificable
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
7 {
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
8 private readonly IList<Track> _tracks;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
9 private IList<string> _enlaces;
42
d18d40f49439 Mi comentario
Daniel@DYD00
parents: 41
diff changeset
10
57
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
11 public static Evento Proponer(string titulo, Ponente ponente)
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
12 {
57
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
13 var evento = new Evento { Titulo = titulo, Ponente = ponente };
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
14 evento.AddTracks(new Track(Accion.Proponer));
61
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
15
57
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
16 return evento;
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
17 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
18
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
19 public static Evento Publicar(string titulo, Ponente ponente, DateTime fecha, string urlInvitacion)
57
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
20 {
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
21 var evento = new Evento { Titulo = titulo };
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
22 evento.Publicar(ponente, fecha, urlInvitacion);
57
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
23
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
24 return evento;
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
25 }
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
26
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
27 protected Evento()
57
3d9e6d56d903 Refactoring del track de cambios de un evento
nelopauselli
parents: 56
diff changeset
28 {
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
29 _enlaces = new List<string>();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
30 _tracks = new List<Track>();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
31 }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
32
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
33 public virtual string Titulo { get; private set; }
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
34 public virtual DateTime? Fecha { get; private set; }
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
35
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
36 /// <summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
37 /// Url con la invitacion realizada por el ponente (en la mayoria de los casos va a ser un link al thread de la lista de correo)
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
38 /// </summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
39 public virtual string UrlInvitacion { get; private set; }
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
40
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
41 /// <summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
42 /// Url a la pagina de la wiki con el video de la reunion virtual
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
43 /// </summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
44 public virtual string UrlWiki { get; private set; }
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
45
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
46 /// <summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
47 /// Numero de orden en el historico de reuniones virtuales
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
48 /// </summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
49 public virtual short NumeroOrden { get; private set; }
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
50
61
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
51 private Ponente _ponente;
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
52 public virtual Ponente Ponente
61
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
53 {
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
54 get { return _ponente; }
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
55 private set
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
56 {
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
57 if (value == null && _ponente != null || value != _ponente && _ponente != null)
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
58 _ponente.RemoveEvento(this);
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
59 if (value != null)
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
60 value.AddEvento(this);
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
61 _ponente = value;
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
62 }
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
63 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
64
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
65 public virtual IEnumerable<Track> Tracks
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
66 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
67 get { return _tracks; }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
68 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
69
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
70 public virtual void Actualizar(Ponente ponente, DateTime? fecha)
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
71 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
72 Ponente = ponente;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
73 Fecha = fecha;
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
74
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
75 AddTracks(new Track(Accion.Modificar));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
76 }
41
07c47ea2ac00 movimos el AddTrack a cada acción dentro de Evento
nelopauselli
parents: 39
diff changeset
77
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
78 public virtual void CambiarTitulo(string titulo)
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
79 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
80 Titulo = titulo;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
81 AddTracks(new Track(Accion.CambiarTitulo));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
82 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
83
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
84 public virtual void Publicar(Ponente ponente, DateTime? fecha, string urlInvitacion)
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
85 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
86 Ponente = ponente;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
87 Fecha = fecha;
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
88 UrlInvitacion = urlInvitacion;
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
89 AddTracks(new Track(Accion.Publicar));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
90 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
91
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
92 private void AddTracks(Track track)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
93 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
94 _tracks.Add(track);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
95 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
96 }
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
97 }