Advertisement
Guest User

ModelView

a guest
Apr 20th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.71 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5.  
  6. namespace AAventura.Models
  7. {
  8.     public class PerguntaViewModel
  9.     {
  10.         public PerguntaViewModel(Pergunta p, Zona z, int conquistada)
  11.         {
  12.             this.PerguntaId = p.PerguntaId;
  13.             this.Descricao = p.Descricao;
  14.             this.Hipotese1 = p.Hipoteses.ElementAt(0).Resposta;
  15.             this.Hipotese2 = p.Hipoteses.ElementAt(1).Resposta;
  16.             this.Hipotese3 = p.Hipoteses.ElementAt(2).Resposta;
  17.             this.Hipotese4 = p.Hipoteses.ElementAt(3).Resposta;
  18.             this.Hipotese1Descricao = p.Hipoteses.ElementAt(0).Descricao;
  19.             this.Hipotese2Descricao = p.Hipoteses.ElementAt(1).Descricao;
  20.             this.Hipotese3Descricao = p.Hipoteses.ElementAt(2).Descricao;
  21.             this.Hipotese4Descricao = p.Hipoteses.ElementAt(3).Descricao;
  22.             this.Imagem = p.Path;
  23.             this.AjudaPergunta = p.Ajuda;
  24.             this.ZonaNome = z.Nome;
  25.             this.Conq = conquistada;
  26.         }
  27.  
  28.         public int PerguntaId { get; set; }
  29.         public int Conq { get; set; }
  30.         public string Descricao { get; set; }
  31.         public string Hipotese1 { get; set; }
  32.         public string Hipotese2 { get; set; }
  33.         public string Hipotese3 { get; set; }
  34.         public string Hipotese4 { get; set; }
  35.         public string Hipotese1Descricao { get; set; }
  36.         public string Hipotese2Descricao { get; set; }
  37.         public string Hipotese3Descricao { get; set; }
  38.         public string Hipotese4Descricao { get; set; }
  39.         public string Imagem { get; set; }
  40.         public string ZonaNome { get; set; }
  41.         public string AjudaPergunta { get; set; }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement