void Start()
    {
        fonteAtual = ((Rodada)Jogo.partida.rodadas[Jogo.rodadaAtual]).fonte;
        for (int i = 0; i < 6; i++)
        {
            if (i < Jogo.jogadoresAtivos.Count)
            {
                Jogador j = (Jogador)Jogo.jogadoresAtivos [i];
                if (j.eCliente)
                {
                    cliente    = j;
                    rowCliente = rows [i];
                }
                rows [i].pontuacao.text = j.pontuacaoTotal.ToString();
                if (j.acertou)
                {
                    rows [i].avatar.sprite = avatarAcertou [j.fotoID];
                    numeroAcertos++;
                }
                else
                {
                    rows [i].avatar.sprite = avatarErrou [j.fotoID];
                }
            }
            else
            {
                rows [i].gameObject.SetActive(false);
            }
        }

        CalcularPontuacaoCliente();
    }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nome")] Fonte fonte)
        {
            if (id != fonte.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(fonte);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FonteExists(fonte.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(fonte));
        }
Пример #3
0
 public Form(int id, string nome, string titulo, string subTitulo, CodCutter codCutter,
             Trabalho trabalho, string nomeOrientador, bool orientadora, string nomeCoorientador,
             bool coorientadora, int ano, PadraoNumFol tipoFolha, int padraoNumFolId, int numFolhaRomano,
             int numFolhaArabico, Ilustracao tipoIlustracao, bool bibliografia, int alturaFolha,
             string palavrasChave, Fonte tipoFonte, int tamFonte)
 {
     Id               = id;
     Nome             = nome;
     Titulo           = titulo;
     SubTitulo        = subTitulo;
     CodCutter        = codCutter;
     Trabalho         = trabalho;
     NomeOrientador   = nomeOrientador;
     Orientadora      = orientadora;
     NomeCoorientador = nomeCoorientador;
     Coorientadora    = coorientadora;
     Ano              = ano;
     TipoFolha        = tipoFolha;
     PadraoNumFolId   = padraoNumFolId;
     NumFolhaRomano   = numFolhaRomano;
     NumFolhaArabico  = numFolhaArabico;
     TipoIlustracao   = tipoIlustracao;
     Bibliografia     = bibliografia;
     AlturaFolha      = alturaFolha;
     PalavrasChave    = palavrasChave;
     TipoFonte        = tipoFonte;
     TamFonte         = tamFonte;
 }
Пример #4
0
        private async void FormularioListView_Load(object sender, EventArgs e)
        {
            lista = new List <modelocrud>();
            if (Modelo != null)
            {
                lista = await Task.Run(() => Modelo.recuperar(null));
            }
            else
            {
                if (Modelo == null && Tipo == "Fonte")
                {
                    lista = Fonte.recuperarTodasFontes();
                }
            }

            ListView.Dock = DockStyle.Left;

            if (lista != null)
            {
                foreach (var v in lista)
                {
                    ListView.Items.Add(v.ToString());
                }
            }
        }
Пример #5
0
        public void Seed()
        {
            if (_context.Department.Any() ||
                _context.Fonte.Any() ||
                _context.Registro.Any() ||
                _context.Tipo.Any())
            {
                return; //DB has been seeded
            }

            Department d1 = new Department("Revitalize");
            Department d2 = new Department("Realiza");

            Tipo t1 = new Tipo("Imposto");
            Tipo t2 = new Tipo("Fixa");

            Fonte f1 = new Fonte("Sul America");
            Fonte f2 = new Fonte("Amil");

            Registro r1 = new Registro(2200.0, "Condominio", new DateTime(2021, 1, 04), t2, Operacao.Credito, d1, f2);
            Registro r2 = new Registro(1200.0, "Energia", new DateTime(2021, 1, 08), t2, Operacao.Credito, d1, f2);
            Registro r3 = new Registro(200.0, "ISS", new DateTime(2021, 1, 10), t1, Operacao.Credito, d1, f2);
            Registro r4 = new Registro(9000.0, "Faturamento", new DateTime(2021, 1, 15), t1, Operacao.Debito, d1, f1);

            _context.Registro.AddRange(r1, r2, r3, r4);
            _context.Tipo.AddRange(t1, t2);
            _context.Fonte.AddRange(f1, f2);
            _context.Department.AddRange(d1, d2);

            _context.SaveChanges();
        }
Пример #6
0
        public ActionResult DeletarComputador(ComputadorViewModelExclui computadorViewModelExclui)
        {
            try
            {
                Computador computador = Mapper.Map <Computador>(computadorViewModelExclui);

                Fonte       fonte       = Mapper.Map <Fonte>(computadorViewModelExclui);
                HD          hd          = Mapper.Map <HD>(computadorViewModelExclui);
                MemoriaRAM  memoriaRAM  = Mapper.Map <MemoriaRAM>(computadorViewModelExclui);
                PlacaMae    placaMae    = Mapper.Map <PlacaMae>(computadorViewModelExclui);
                Processador processador = Mapper.Map <Processador>(computadorViewModelExclui);

                servicoComputador.Deletar(computador);
                servicoFonte.Deletar(fonte);
                servicoHD.Deletar(hd);
                servicoMemoriaRAM.Deletar(memoriaRAM);
                servicoPlacaMae.Deletar(placaMae);
                servicoProcessador.Deletar(processador);

                TempData["MensagemSucesso"] = "Computador deletado com sucesso!";

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                ViewBag.MensagemErro = "Ocorreu um erro, tente novamente ou entre em contato com nosso suporte. Detalhe do erro: " + ex.Message;

                return(View());
            }
        }
Пример #7
0
        public string InserirReserva(
            string chave, string senha, Reserva reserva,
            List <IMes> mes, Programa programa, Estrutura estrutura,
            Fonte fonte, Regional regional)
        {
            try
            {
                var result = DataHelperProdesp.Procedure_InclusaoReserva(
                    chave, senha, reserva, mes, programa, estrutura, fonte, regional)[0];

                //HttpContext.Current.Session["terminal"] = result.outTerminal;
                HttpContext.Current.Session["terminal"] = result.outTerminal;

                if (result.outErro != "")
                {
                    throw new Exception("Prodesp - " + result.outErro);
                }

                return(result.outDocsNumeroReserva);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.Contains("EntradaCICS_Fora") ? "Erro na comunicação com WebService Prodesp." : ex.Message);
            }
        }
Пример #8
0
    void Start()
    {
        fonteAtual = ((Rodada)Jogo.partida.rodadas [Jogo.rodadaAtual]).fonte;
        for (int i = 0; i < 6; i++) {
            if (i < Jogo.jogadoresAtivos.Count) {

                Jogador j = (Jogador)Jogo.jogadoresAtivos [i];
                if (j.eCliente) {
                    cliente = j;
                    rowCliente = rows [i];
                }
                rows [i].pontuacao.text = j.pontuacaoTotal.ToString ();
                if (j.acertou) {
                    rows [i].avatar.sprite = avatarAcertou [j.fotoID];
                    numeroAcertos++;
                } else {
                    rows [i].avatar.sprite = avatarErrou [j.fotoID];
                }
            } else {
                rows [i].gameObject.SetActive (false);
            }
        }

        CalcularPontuacaoCliente ();
        DefineVencedor();
    }
Пример #9
0
 public int Add(Fonte entity)
 {
     return(DataHelper.Get <int>("PR_FONTE_INCLUIR",
                                 new SqlParameter("@cd_fonte", entity.Codigo),
                                 new SqlParameter("@ds_fonte", entity.Descricao)
                                 ));
 }
Пример #10
0
    public static Fonte fontWithName(string nome)
    {
        Fonte f = new Fonte ();
        f.name = nome;
        f.dificuldade = DificuldadeFonte (nome);

        return f;
    }
Пример #11
0
 public int Edit(Fonte entity)
 {
     return(DataHelper.Get <int>("PR_FONTE_ALTERAR",
                                 new SqlParameter("@id_fonte", entity.Id),
                                 new SqlParameter("@cd_fonte", entity.Codigo),
                                 new SqlParameter("@ds_fonte", entity.Descricao)
                                 ));
 }
Пример #12
0
        public ActionResult DeleteConfirmed(int id)
        {
            Fonte fonte = db.Fontes.Find(id);

            db.Fontes.Remove(fonte);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #13
0
 public IEnumerable <Fonte> DuplicateCheck(Fonte entity)
 {
     return(DataHelper.List <Fonte>("PR_FONTE_ALTERAR_DUPLICADO",
                                    new SqlParameter("@id_fonte", entity.Id),
                                    new SqlParameter("@cd_fonte", entity.Codigo),
                                    new SqlParameter("@ds_fonte", entity.Descricao)
                                    ));
 }
Пример #14
0
 public IEnumerable <Fonte> Fetch(Fonte entity)
 {
     return(DataHelper.List <Fonte>("PR_FONTE_CONSULTAR",
                                    new SqlParameter("@id_fonte", entity.Id),
                                    new SqlParameter("@cd_fonte", entity.Codigo),
                                    new SqlParameter("@ds_fonte", entity.Descricao)
                                    ));
 }
Пример #15
0
    public static Fonte fontWithName(string nome)
    {
        Fonte f = new Fonte();

        f.name        = nome;
        f.dificuldade = DificuldadeFonte(nome);

        return(f);
    }
Пример #16
0
 public PcComumFacede()
 {
     this.processador = new Processador();
     this.discoRigido = new DiscoRigido();
     this.memoriaRAM  = new MemoriaRAM();
     this.fonte       = new Fonte();
     this.gabinete    = new Gabinete();
     this.placaMae    = new PlacaMae();
 }
        public void InserirTest()
        {
            Fonte fontes = new Fonte {
                Codigo = "171", Descricao = "TesteUnitTwo"
            };
            AcaoEfetuada result = App.FonteService.Salvar(fontes, 0, 1);

            Assert.IsTrue(AcaoEfetuada.Sucesso == result);
        }
        public void ExcluirTest()
        {
            Fonte fontes = new Fonte {
                Id = 30
            };
            AcaoEfetuada result = App.FonteService.Excluir(fontes, 0, 3);

            Assert.IsTrue(AcaoEfetuada.Sucesso == result);
        }
Пример #19
0
        // GET: Computador/EditarFonte/5
        public ActionResult EditarFonte(int id)
        {
            Fonte fonte = servicoFonte.RetornarPorID(id);

            FonteViewModelEdita fonteViewModelEdita = Mapper.Map <FonteViewModelEdita>(fonte);

            fonteViewModelEdita.IDComputador = fonte.Computadores[0].IDComputador;

            return(View(fonteViewModelEdita));
        }
Пример #20
0
 public ActionResult Edit([Bind(Include = "Id,Nome,Descricao,Marca,PrecoMedio,Watts,Link")] Fonte fonte)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fonte).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fonte));
 }
Пример #21
0
 public ActionResult Edit([Bind(Include = "FonteId,Nome,Preco")] Fonte fonte)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fonte).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fonte));
 }
Пример #22
0
 public ActionResult Cadastrar(Fonte fonte)
 {
     if (ModelState.IsValid)
     {
         db.Fontes.Add(fonte);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fonte));
 }
Пример #23
0
        public ActionResult Create(string Id)
        {
            if (Id != null)
            {
                App.FuncionalidadeService.SalvarFuncionalidadeAtual(int.Parse(Id));
            }
            Fonte fonte = new Fonte();

            return(View("CreateEdit", fonte));
        }
Пример #24
0
        public override void Draw(Gfx gfx)
        {
            base.Draw(gfx);

            // 7.7.6 Conteúdo do Quadro Dados do Emitente
            // Deverá estar impresso em negrito.A razão social e/ ou nome fantasia deverá ter tamanho
            // mínimo de doze(12) pontos, ou 17 CPP e os demais dados do emitente, endereço,
            // município, CEP, fone / fax deverão ter tamanho mínimo de oito(8) pontos, ou 17 CPP.

            var   rp = BoundingBox.InflatedRetangle(0.75F);
            float alturaMaximaLogoHorizontal = 14F;

            Fonte f2 = Estilo.CriarFonteNegrito(12);
            Fonte f3 = Estilo.CriarFonteRegular(8);

            if (Logo == null)
            {
                var f1 = Estilo.CriarFonteRegular(6);
                gfx.DrawString("IDENTIFICAÇÃO DO EMITENTE", rp, f1, AlinhamentoHorizontal.Centro);
                rp = rp.CutTop(f1.AlturaLinha);
            }
            else
            {
                RectangleF rLogo;

                if (Logo.Size.Width >= Logo.Size.Height)
                {
                    rLogo = new RectangleF(rp.X, rp.Y, rp.Width, alturaMaximaLogoHorizontal);
                    rp    = rp.CutTop(alturaMaximaLogoHorizontal);
                }
                else
                {
                    float lw = rp.Height * Logo.Size.Width / Logo.Size.Height;
                    rLogo = new RectangleF(rp.X, rp.Y, lw, rp.Height);
                    rp    = rp.CutLeft(lw);
                }

                gfx.ShowXObject(Logo, rLogo);
            }

            var emitente = ViewModel.Emitente;
            var nome     = !String.IsNullOrWhiteSpace(emitente.NomeFantasia) ? emitente.NomeFantasia : emitente.RazaoSocial;
            var ts       = new TextStack(rp)
            {
                LineHeightScale = 1
            }
            .AddLine(nome, f2)
            .AddLine(emitente.EnderecoLinha1.Trim(), f3)
            .AddLine(emitente.EnderecoLinha2.Trim(), f3)
            .AddLine(emitente.EnderecoLinha3.Trim(), f3);

            ts.AlinhamentoHorizontal = AlinhamentoHorizontal.Centro;
            ts.AlinhamentoVertical   = AlinhamentoVertical.Centro;
            ts.Draw(gfx);
        }
Пример #25
0
 public IEnumerable <Fonte> Buscar(Fonte obj)
 {
     try
     {
         return(_fonte.Fetch(obj));
     }
     catch (Exception ex)
     {
         throw SaveLog(ex);
     }
 }
Пример #26
0
 public IEnumerable <Fonte> VerificaDuplicado(Fonte obj)
 {
     try
     {
         return(_fonte.Fetch(obj));
     }
     catch (Exception ex)
     {
         throw SaveLog(ex);
     }
 }
Пример #27
0
        public ActionResult Editar(Fonte fonte)
        {
            if (ModelState.IsValid)
            {
                db.Entry(fonte).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fonte));
        }
Пример #28
0
        public ActionResult Create([Bind(Include = "Id,Nome,Descricao,Marca,PrecoMedio,Watts,Link")] Fonte fonte)
        {
            if (ModelState.IsValid)
            {
                db.Fontes.Add(fonte);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fonte));
        }
Пример #29
0
        public ActionResult Create([Bind(Include = "FonteId,Nome,Preco")] Fonte fonte)
        {
            if (ModelState.IsValid)
            {
                db.Fontes.Add(fonte);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fonte));
        }
Пример #30
0
        public async Task <IActionResult> Create([Bind("Id,Nome")] Fonte fonte)
        {
            if (ModelState.IsValid)
            {
                _context.Add(fonte);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(fonte));
        }
        public void EditarTest()
        {
            Fonte fontes = new Fonte {
                Id = 27
            };

            fontes.Codigo    = "1236";
            fontes.Descricao = "Teste Desc";
            AcaoEfetuada result = App.FonteService.Salvar(fontes, 0, 2);

            Assert.IsTrue(AcaoEfetuada.Sucesso == result);
        }
Пример #32
0
        public AcaoEfetuada Salvar(Fonte obj, int fontesId, short actionId)
        {
            try
            {
                if (obj.Id == 0) //se for insert
                {
                    if (_fonte.Fetch(new Fonte {
                        Descricao = obj.Descricao, Codigo = obj.Codigo
                    }).Any(x => x.Descricao == obj.Descricao))
                    {
                        throw new SidsException("Não é possível realizar cadastro, já existe fonte com a descrição e o código já cadastrada");
                    }


                    if (_fonte.Fetch(new Fonte {
                        Codigo = obj.Codigo
                    }).Any())
                    {
                        throw new SidsException("Não é possível realizar cadastro, já existe fonte com o código já cadastrado");
                    }

                    if (_fonte.Fetch(new Fonte {
                        Descricao = obj.Descricao
                    }).Any(x => x.Descricao == obj.Descricao))
                    {
                        throw new SidsException("Não é possível realizar cadastro, já existe fonte com a descrição já cadastrada");
                    }

                    obj.Id = _fonte.Add(obj);
                }
                else
                {
                    if (_fonte.DuplicateCheck(new Fonte {
                        Id = obj.Id, Codigo = obj.Codigo, Descricao = obj.Descricao
                    }).Any())
                    {
                        throw new SidsException("Registro já existente!");
                    }
                    _fonte.Edit(obj);
                }


                var fontes = (IEnumerator <Fonte>)_fonte.Fetch(new Fonte());
                SetCurrentCache(fontes, "Fonte");

                var arg = $"Fonte {obj.Descricao}, Codigo {obj.Id}";
                return(LogSucesso(actionId, fontesId, arg));
            }
            catch (Exception ex)
            {
                throw SaveLog(ex, actionId: actionId, functionalityId: fontesId);
            }
        }