annotate Agendas/trunk/src/Agendas.Domain/Patrocinador.cs @ 138:62791999ad01

Agregando relación entre Evento y Patrocinador
author nelopauselli
date Thu, 28 Jul 2011 10:13:28 -0300
parents 2d1adbaf0373
children 62dc9fb3a03e
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;
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
3 using System.Linq;
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
4 using System.IO;
137
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
5
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
6 namespace AltNetHispano.Agendas.Domain
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
7 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
8 public class Patrocinador : Identificable
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
9 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
10 public virtual string Nombre { get; set; }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
11 public virtual byte[] Logo { get; set; }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
12
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
13 public Patrocinador(string nombre)
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
14 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
15 Nombre = nombre;
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
16 }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
17
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
18 protected Patrocinador()
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
19 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
20 }
138
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
21
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
22 public virtual void LoadLogo(string path)
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
23 {
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
24 var image = Image.FromFile(path);
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
25 var ms = new MemoryStream();
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
26 image.Save(ms, image.RawFormat);
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
27 Logo = ms.ToArray();
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
28 }
137
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
29 }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
30 }