Example #1
0
 public Jogo(int id,string nome, Selo selo, string descricao, Cliente cliente = null)
 {
     this.Id = id;
     this.Cliente = cliente;
     this.Selo = selo;
     this.Descricao = descricao;
     this.Nome = nome;
 }
 public JogoDetalheModel(int id, string nome, Categoria categoria, string imagem, Selo selo, string video, string descricao)
 {
     this.Id = id;
     this.Nome = nome;
        // this.Preco = preco;
     this.Categoria = categoria;
     this.Imagem = imagem;
     this.Selo = selo;
     this.Video = video;
     this.Descricao = descricao;
 }
        private void PreencherPropriedades(Selo selo)
        {
            switch (selo)
            {
                case Selo.Ouro:
                    Preco = 15.00m;
                    DataEntrega = DateTime.Now.AddDays(1);
                    break;

                case Selo.Prata:
                    Preco = 10.00m;
                    DataEntrega = DateTime.Now.AddDays(1);
                    break;

                case Selo.Bronze:
                    Preco = 5.00m;
                    DataEntrega = DateTime.Now.AddDays(1);
                    break;
            }
        }
Example #4
0
        public void DefinirValorEDataDevolucao(Selo selo)
        {
            int dias;

            if (selo.Equals("Bronze"))
            {
                ValorJogo = 5;
                dias = 3;

            }
            else if (selo.Equals("Prata"))
            {
                ValorJogo = 10;
                dias = 2;
            }
            else
            {
                ValorJogo = 15;
                dias = 1;
            }

            this.ValorJogo = ValorJogo;
            DataDevolucao = (DateTime.Now.Date.AddDays(dias)).ToString("dd/MM/yyyy");
        }
        public JogoDetalhesModel ConverterJogoParaModel(Jogo jogo)
        {
            this.Id = jogo.Id;
            this.Nome = jogo.Nome;
            this.Descricao = jogo.Descricao;
            this.Categoria = jogo.Categoria;
            this.Imagem = jogo.Imagem;
            this.Selo = jogo.Selo;

            return this;
        }
Example #6
0
 private void DefinirSeloNaCriacao()
 {
     if (this.Preco > 35 && this.Preco <= 55)
     {
         this.Selo = Selo.Prata;
     }
     else if (this.Preco > 55)
     {
         this.Selo = Selo.Ouro;
     }
     else
     {
         this.Selo = Selo.Bronze;
     }
 }