annotate Agendas/trunk/src/Agendas.Domain/Evento.cs @ 54:3059a5f8930f

Code cleanup
author nelopauselli
date Sat, 14 May 2011 13:01:24 -0300
parents 3ebe89c88caa
children 65bbcdd5d357
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 {
12
05996fa19e04 Unificamos Van y Cafe en Evento
nelo@MTEySS.neluz.int
parents: 4
diff changeset
6 public class Evento
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
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
11 public Evento(string titulo)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
12 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
13 Id = Guid.NewGuid();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
14 Titulo = titulo;
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
15
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
16 _enlaces = new List<string>();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
17 _tracks = new List<Track>();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
18 }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
19
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
20 public Guid Id { get; private set; }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
21 public string Titulo { get; private set; }
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
22 public DateTime? Fecha { get; private set; }
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
23 public string Sintesis { get; private set; }
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
24 public Ponente Ponente { get; private set; }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
25 protected string Usuario { get; private set; }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
26
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
27 public IEnumerable<string> Enlaces
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
28 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
29 get { return _enlaces; }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
30 }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
31
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
32 public IEnumerable<Track> Tracks
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
33 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
34 get { return _tracks; }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
35 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
36
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
37 public void Actualizar(Ponente ponente, DateTime? fecha)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
38 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
39 Usuario = IdentityContext.GetUserName();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
40 Ponente = ponente;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
41 Fecha = fecha;
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
42
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
43 AddTracks(new Track(Accion.Modificar));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
44 }
41
07c47ea2ac00 movimos el AddTrack a cada acción dentro de Evento
nelopauselli
parents: 39
diff changeset
45
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
46 public void Actualizar(Ponente ponente)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
47 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
48 Usuario = IdentityContext.GetUserName();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
49 Ponente = ponente;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
50 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
51
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
52 public void CambiarTitulo(string titulo)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
53 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
54 Usuario = IdentityContext.GetUserName();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
55 Titulo = titulo;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
56 AddTracks(new Track(Accion.CambiarTitulo));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
57 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
58
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
59 public void Publicar(Ponente ponente, DateTime? fecha)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
60 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
61 Usuario = IdentityContext.GetUserName();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
62 Ponente = ponente;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
63 Fecha = fecha;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
64 AddTracks(new Track(Accion.Publicar));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
65 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
66
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
67 public void Realizado(DateTime fecha, string sintesis, IList<string> enlaces)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
68 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
69 Usuario = IdentityContext.GetUserName();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
70 Fecha = fecha;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
71 Sintesis = sintesis;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
72 _enlaces = enlaces;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
73 }
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 public void Realizado(string sintesis)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
76 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
77 Usuario = IdentityContext.GetUserName();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
78 Sintesis = sintesis;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
79 AddTracks(new Track(Accion.Realizar));
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
80 }
41
07c47ea2ac00 movimos el AddTrack a cada acción dentro de Evento
nelopauselli
parents: 39
diff changeset
81
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
82 private void AddTracks(Track track)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
83 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
84 _tracks.Add(track);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
85 }
38
3c5657d99727 Cambio de setters de las propiedades a private
nelo@MTEySS.neluz.int
parents: 24
diff changeset
86 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
87
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
88 public class Track
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
89 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
90 public Track(string accion)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
91 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
92 Accion = accion;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
93 }
39
e548379cc314 track de cambios en evento
nelo@MTEySS.neluz.int
parents: 38
diff changeset
94
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
95 public string Accion { get; private set; }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
96 }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
97
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
98 public class Accion
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
99 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
100 public const string Publicar = "Publicar";
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
101 public const string Modificar = "Modificar";
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
102 public const string CambiarTitulo = "CambiarTitulo";
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
103 public const string Realizar = "Realizar";
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
104 }
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
105 }