annotate Agendas/trunk/src/Agendas.Domain/Patrocinador.cs @ 285:c8f378272407

#123: Patrocinadores de las vans.
author juanjose.montesdeocaarbos
date Sat, 31 Dec 2011 14:45:55 -0300
parents 6f5ab71614d4
children 9bc60d166c8a
rev   line source
138
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
1 using System.Drawing;
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
2 using System.IO;
137
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
3
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
4 namespace AltNetHispano.Agendas.Domain
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
5 {
274
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
6 public class Patrocinador : Identificable
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
7 {
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
8 public virtual string Nombre { get; set; }
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
9 public virtual byte[] Logo { get; set; }
137
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
10
274
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
11 public Patrocinador(string nombre)
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
12 {
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
13 Nombre = nombre;
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
14 }
137
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
15
274
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
16 protected Patrocinador()
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
17 {
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
18 }
138
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
19
274
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
20 public virtual void LoadLogo(string path)
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
21 {
278
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 274
diff changeset
22 using (var image = Image.FromFile(path))
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 274
diff changeset
23 {
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 274
diff changeset
24 var ms = new MemoryStream();
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 274
diff changeset
25 image.Save(ms, image.RawFormat);
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 274
diff changeset
26 Logo = ms.ToArray();
6f5ab71614d4 #125: ABM de patrocinadores.
juanjose.montesdeocaarbos
parents: 274
diff changeset
27 }
274
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
28 }
72a96459f910 Ticket #123: Patrocinadores de las vans.
juanjose.montesdeocaarbos
parents: 200
diff changeset
29 }
137
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
30 }