annotate Agendas/trunk/src/Agendas.Domain/Evento.cs @ 70:c7264bfc4b71

agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden) modificaciones en proyecto Agendas.Blog modificacion de viewmodel EventoModel - agregado de UrlInvitacion (no requerido)
author jorge.rowies
date Fri, 20 May 2011 12:21:07 -0300
parents 963b71ea6028
children 76567a0d1e44
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; }
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
35 public virtual string Sintesis { get; private set; }
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
36
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
37 /// <summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
38 /// 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
39 /// </summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
40 public virtual string UrlInvitacion { get; private set; }
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
41
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
42 /// <summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
43 /// 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
44 /// </summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
45 public virtual string UrlWiki { get; private set; }
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
46
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
47 /// <summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
48 /// 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
49 /// </summary>
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
50 public virtual short NumeroOrden { get; private set; }
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
51
61
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
52 private Ponente _ponente;
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
53 public virtual Ponente Ponente
61
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
54 {
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
55 get { return _ponente; }
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
56 private set
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
57 {
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
58 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
59 _ponente.RemoveEvento(this);
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
60 if (value != null)
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
61 value.AddEvento(this);
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
62 _ponente = value;
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
63 }
cb3f7b47c1f0 Relación de Ponente a Eventos de los que es el ponente.
nelopauselli
parents: 57
diff changeset
64 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
65
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
66 public virtual IEnumerable<string> Enlaces
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
67 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
68 get { return _enlaces; }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
69 }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
70
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
71 public virtual IEnumerable<Track> Tracks
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
72 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
73 get { return _tracks; }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
74 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
75
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
76 public virtual void Actualizar(Ponente ponente, DateTime? fecha)
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
77 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
78 Ponente = ponente;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
79 Fecha = fecha;
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
80
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
81 AddTracks(new Track(Accion.Modificar));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
82 }
41
07c47ea2ac00 movimos el AddTrack a cada acción dentro de Evento
nelopauselli
parents: 39
diff changeset
83
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
84 public virtual void CambiarTitulo(string titulo)
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
85 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
86 Titulo = titulo;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
87 AddTracks(new Track(Accion.CambiarTitulo));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
88 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
89
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
90 public virtual void Publicar(Ponente ponente, DateTime? fecha, string urlInvitacion)
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
91 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
92 Ponente = ponente;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
93 Fecha = fecha;
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
94 UrlInvitacion = urlInvitacion;
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
95 AddTracks(new Track(Accion.Publicar));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
96 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
97
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
98 public virtual void Realizado(DateTime fecha, string sintesis, IList<string> enlaces, string urlWiki, short numeroOrden)
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
99 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
100 Fecha = fecha;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
101 Sintesis = sintesis;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
102 _enlaces = enlaces;
70
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
103 UrlWiki = urlWiki;
c7264bfc4b71 agregado de properties en clase Evento (UrlInvitacion, UrlWiki, NumeroOrden)
jorge.rowies
parents: 63
diff changeset
104 NumeroOrden = numeroOrden;
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
105 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
106
63
963b71ea6028 Repositorios con NH
nelopauselli
parents: 61
diff changeset
107 public virtual void Realizado(string sintesis)
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
108 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
109 Sintesis = sintesis;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
110 AddTracks(new Track(Accion.Realizar));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
111 }
41
07c47ea2ac00 movimos el AddTrack a cada acción dentro de Evento
nelopauselli
parents: 39
diff changeset
112
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
113 private void AddTracks(Track track)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
114 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
115 _tracks.Add(track);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
116 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
117 }
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
118 }