annotate Agendas/trunk/src/Agendas.Domain/Patrocinador.cs @ 162:557c386fcecc

Ticket 153: UI de Publicar.
author juanjose.montesdeocaarbos
date Fri, 05 Aug 2011 22:02:23 -0300
parents 62dc9fb3a03e
children 5346c0500594
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 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
6 public class Patrocinador : Identificable
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
7 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
8 public virtual string Nombre { get; set; }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
9 public virtual byte[] Logo { get; set; }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
10
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
11 public Patrocinador(string nombre)
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
12 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
13 Nombre = nombre;
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
14 }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
15
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
16 protected Patrocinador()
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
17 {
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
18 }
138
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
19
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
20 public virtual void LoadLogo(string path)
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 var image = Image.FromFile(path);
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
23 var ms = new MemoryStream();
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
24 image.Save(ms, image.RawFormat);
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
25 Logo = ms.ToArray();
62791999ad01 Agregando relación entre Evento y Patrocinador
nelopauselli
parents: 137
diff changeset
26 }
137
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
27 }
2d1adbaf0373 CRUD de Patrocinador
nelopauselli
parents:
diff changeset
28 }