Example #1
0
        public FormSessao()
        {
            InitializeComponent();
            AtualizarMaximoCaracteres();
            cbTipo.Items.AddRange(TiposDeSessaoHuman.Types);
            this.ActiveControl = txTituloSessao;

            this.sessao = new Sessao();
        }
Example #2
0
 public static void ObterObjetosFilhos(Sessao sessao)
 {
     sessao.CCs       = CCPorSessaoService.GetAllCCBySessaoId(sessao.Id);
     sessao.Instrucao = InstrucaoService.GetById(sessao.IdInstrucao);
 }
 public LogController(Sessao sessao, LogR reposLog)
 {
     _sessao   = sessao;
     _reposLog = reposLog;
 }
 public void Atualiza(Sessao sessao)
 {
     session.Update(sessao);
 }
 private void btn_pesquisa_item_Click(object sender, RoutedEventArgs e)
 {
     Sessao.AbrirPrograma(new Portaria.CadastroItemIO(item), this);
 }
 private void btn_pesquisar_empresa_Click(object sender, RoutedEventArgs e)
 {
     Sessao.AbrirPrograma(new Portaria.CadastroEmpresa(empresa), this);
 }
Example #7
0
 public void Deletar(CertificadoDigital entity)
 {
     Sessao.Delete(entity);
 }
Example #8
0
 public IEnumerable <CertificadoDigital> Lista()
 {
     return(Sessao.QueryOver <CertificadoDigital>().List <CertificadoDigital>());
 }
Example #9
0
        public ActionResult Index()
        {
            Sessao.ExisteSessao();

            return(View());
        }
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     Sessao.AbrirPrograma(new Programas.Logistica.Produtos(produto), this);
 }
        private void button5_Click(object sender, RoutedEventArgs e)
        {
            if (verificador())
            {
                if (MsgBox.Show.Pergunta("Quer mesmo realizar essa expedição?"))
                {
                    Banco.checklist chk   = new Banco.checklist();
                    CheckListFinal  final = new CheckListFinal();
                    final.ShowDialog();
                    if (final.finalizou)
                    {
                        chk = final.checklist;
                    }
                    else
                    {
                        MsgBox.Show.Error("Não foi possível realizar esta expedição por que o checkList não foi preenchido!");
                        return;
                    }


                    BuscarProximoId();

                    List <string> colunas = new List <string>();
                    colunas.Add("idmotorista");
                    colunas.Add("idtransportadoras");
                    colunas.Add("idcaminhao");
                    colunas.Add("data");
                    colunas.Add("liquido");
                    colunas.Add("bruto");
                    colunas.Add("idcd");
                    colunas.Add("criador");

                    List <dynamic> valores = new List <dynamic>();
                    valores.Add(cbo_motorista.SelectedValue);
                    valores.Add(cbo_transportadora.SelectedValue);
                    valores.Add(cbo_caminhao.SelectedValue);
                    valores.Add(dt_data.DisplayDate);
                    valores.Add(liquido);
                    valores.Add(bruto);
                    valores.Add(cbo_cd.SelectedValue);
                    valores.Add(Sessao.usuario.Nome);

                    if (ExecuteNonSql.Executar("romaneio", TipoDeOperacao.Tipo.Insert, colunas, valores, null) != -1)
                    {
                        colunas.Clear();
                        valores.Clear();

                        colunas.Add("idromaneio");
                        colunas.Add("idprodutos");
                        colunas.Add("nota");
                        colunas.Add("data");
                        colunas.Add("cidade");
                        colunas.Add("estado");
                        colunas.Add("lote");
                        colunas.Add("liquido");
                        colunas.Add("bruto");
                        colunas.Add("cliente");

                        List <string> coluna1 = new List <string>();
                        coluna1.Add("nota");
                        List <dynamic> valores1 = new List <dynamic>();


                        for (int a = 0; a < notas.Count; a++)
                        {
                            valores.Add(idromaneio);
                            valores.Add(notas[a].idproduto);
                            valores.Add(notas[a].notaFiscal);
                            valores.Add(notas[a].emissao);
                            valores.Add(notas[a].cidade);
                            valores.Add(notas[a].uf);
                            valores.Add(notas[a].lote);
                            valores.Add(notas[a].liquido);
                            valores.Add(notas[a].bruto);
                            valores.Add(notas[a].cliente);
                        }

                        if (ExecuteNonSql.Executar("expedicao", TipoDeOperacao.Tipo.InsertMultiplo, colunas, valores, null) != -1)
                        {
                            DataTable nots = Select.SelectSQL("select distinct nota from expedicao where idromaneio=" + idromaneio + "");

                            for (int a = 0; a < nots.Rows.Count; a++)
                            {
                                valores1.Add(nots.Rows[a][0] + "");
                            }

                            if (ExecuteNonSql.Executar("entrega", TipoDeOperacao.Tipo.InsertMultiplo, coluna1, valores1, null) != -1)
                            {
                                chk.Idromaneio = idromaneio;
                                if (chk.Inserir() == -1)
                                {
                                    MsgBox.Show.Error("Erro ao inserir checklist");
                                }

                                MsgBox.Show.Info("Expedido com Sucesso!");
                                Sessao.FecharPrograma(this);
                                Programas.RelatorioHTML novo = new RelatorioHTML(GerarHtmlRomaneio.Gerar(idromaneio + ""), false);
                                Programas.RelatorioHTML nova = new RelatorioHTML(GerarChecklist.Gerar(idromaneio + ""), false);
                                novo.Show();
                                nova.Show();
                            }
                            else
                            {
                                MsgBox.Show.Error("Erro ao ingressar novas notas para entrega!");
                                Programas.RelatorioHTML novo = new RelatorioHTML(GerarHtmlRomaneio.Gerar(idromaneio + ""), false);
                                Programas.RelatorioHTML nova = new RelatorioHTML(GerarChecklist.Gerar(idromaneio + ""), false);
                                novo.Show();
                                nova.Show();
                            }
                        }
                        else
                        {
                            MsgBox.Show.Error("Erro ao Fazer Expedição");
                        }
                    }
                    else
                    {
                        MsgBox.Show.Error("Erro ao Fazer Româneio!");
                    }
                }
            }
        }
Example #12
0
        public ItemVenda ItemCarrinho(Produto produto)
        {
            string carrinhoId = Sessao.RetornarCarrinhoId().ToString();

            return(context.ItensVenda.Include("ProdutoVenda").FirstOrDefault(x => x.ProdutoVenda.ProdutoID == produto.ProdutoID && x.CarrinhoId.Equals(carrinhoId)));
        }
Example #13
0
        /*public List<ItemVenda> BuscarItensVendaPorCarrinhoId(string carrinhoId)
         * {
         *  return context.ItensVenda.Include("ProdutoVenda").Where(x => x.CarrinhoId.Equals(carrinhoId)).ToList();
         * }*/

        public static List <ItemVenda> BuscarItensVendaPorCarrinhoId()
        {
            string carrinhoId = Sessao.RetornarCarrinhoId();

            return(context.ItensVenda.Include("ProdutoVenda").Where(x => x.CarrinhoId.Equals(carrinhoId)).ToList());
        }
Example #14
0
 public Uf CarregarPorId(int id)
 {
     return(Sessao.Get <Uf>(id));
 }
Example #15
0
 public IEnumerable <Uf> Lista()
 {
     return(Sessao.QueryOver <Uf>().List <Uf>());
 }
Example #16
0
        public IEnumerable <Cidade> Lista()
        {
            var lista = Sessao.QueryOver <Cidade>().List <Cidade>();

            return(lista);
        }
Example #17
0
    public static void DeletePhysiotherapist()
    {
        int IdFisioterapeuta = GlobalController.instance.admin.idFisioterapeuta;
        int IdPessoa         = GlobalController.instance.admin.persona.idPessoa;

        string nomePessoa = (GlobalController.instance.admin.persona.nomePessoa).Replace(' ', '_');
        string nomePasta  = string.Format("{0}/Movimentos/{1}-{2}", Application.dataPath, IdPessoa, nomePessoa);

        List <Movimento> allMovements            = Movimento.Read();
        List <Sessao>    allSessions             = Sessao.Read();
        List <PontosRotuloFisioterapeuta> allPRF = PontosRotuloFisioterapeuta.Read();
        List <Exercicio>        allExercises     = Exercicio.Read();
        List <MovimentoMusculo> allMovMuscles    = MovimentoMusculo.Read();

        foreach (var movements in allMovements)
        {
            if (movements.idFisioterapeuta == IdFisioterapeuta)
            {
                foreach (var prf in allPRF)
                {
                    if (prf.idMovimento == movements.idMovimento)
                    {
                        PontosRotuloFisioterapeuta.DeleteValue(prf.idRotuloFisioterapeuta);
                    }
                }

                foreach (var mvm in allMovMuscles)
                {
                    if (mvm.idMovimento == movements.idMovimento)
                    {
                        MovimentoMusculo.DeleteValue(mvm.idMovimento, mvm.idMusculo);
                    }
                }

                foreach (var execises in allExercises)
                {
                    if (execises.idMovimento == movements.idMovimento)
                    {
                        Exercicio.DeleteValue(execises.idExercicio);
                    }
                }

                Movimento.DeleteValue(movements.idMovimento);
            }
        }

        foreach (var session in allSessions)
        {
            if (session.idPaciente == IdFisioterapeuta)
            {
                Sessao.DeleteValue(session.idSessao);
            }
        }

        Fisioterapeuta.DeleteValue(IdFisioterapeuta);

        if (Directory.Exists(nomePasta))
        {
            Directory.Delete(nomePasta, true);
        }

        Flow.StaticNewPhysiotherapist();
    }
Example #18
0
 public static Sessao CreateSessao(int ID, bool apresentacao, int reuniaoId)
 {
     Sessao sessao = new Sessao();
     sessao.Id = ID;
     sessao.Apresentacao = apresentacao;
     sessao.ReuniaoId = reuniaoId;
     return sessao;
 }
Example #19
0
 public void SalvarOuAtualizar(CertificadoDigital entity)
 {
     Sessao.SaveOrUpdate(entity);
 }
Example #20
0
 public void AddToSessoes(Sessao sessao)
 {
     base.AddObject("Sessoes", sessao);
 }
 private void btn_pesquisar_nome_Click(object sender, RoutedEventArgs e)
 {
     Sessao.AbrirPrograma(new Portaria.CadastroColaborador(pessoa), this);
 }
        public IHttpActionResult Login(Usuario usuario)
        {
            if (usuario == null || usuario.Login == null || usuario.Senha == null)
            {
                return(BadRequest());
            }

            Contexto db   = new Contexto();
            Usuario  user = db.Usuario.Find(usuario.Login);

            if (user == null)
            {
                return(BadRequest("Usuário não cadastrado!"));
            }
            //if (user.Senha != Convert.ToBase64String(Encoding.UTF8.GetBytes(usuario.Senha))) return BadRequest("Senha incorreta!");
            if (user.Senha != usuario.Senha)
            {
                return(BadRequest("Senha incorreta!"));
            }

            string token = Convert.ToBase64String(Encoding.UTF8.GetBytes(usuario.Login + ":" + usuario.Senha));

            //Verifica se já existe a sessão. Se sim, aumenta a data de expiração, caso contrário, cria uma nova sessão
            Sessao s = db.Sessao.Find(token);

            if (s == null)
            {
                db.Sessao.Add(new Sessao {
                    Chave = token, LoginUsuario = user.Login, Inicio = DateTime.Now, Fim = DateTime.Now.AddHours(6.0)
                });
            }
            else
            {
                s.Fim = DateTime.Now.AddHours(6.0);
            }

            try
            {
                db.SaveChanges();
            }
            catch (Exception e)
            {
                return(InternalServerError(e));
            }

            /*var retorno = new {
             *  Token = token,
             *  Usuario = user.Nome,
             *  Login = user.Login,
             *  Permissoes = user.Permissoes.Select(x => x.PermissaoNome)
             * };*/

            UserInfoDTO u = new UserInfoDTO(user)
            {
                Token      = token,
                Permissoes = user.Permissoes.Select(x => x.PermissaoNome)
            };

            db.Dispose();

            return(Ok(u));
        }
 private void btn_pesquisa_setor_Click(object sender, RoutedEventArgs e)
 {
     Sessao.AbrirPrograma(new Portaria.CadastroSetor(setor), this);
 }
 private void button2_Click(object sender, RoutedEventArgs e)
 {
     Sessao.AbrirPrograma(new Portaria.CadastroCaminhao(caminhao), this);
 }
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     dataGridFiltro1.Odatagrid = ogrid;
     Sessao.ApagaBots();
     Sessao.AddExcel(ogrid);
 }
 private void button3_Click(object sender, RoutedEventArgs e)
 {
     Sessao.AbrirPrograma(new Portaria.CadastroMotorista(motorista), this);
 }
Example #27
0
 public ActionResult Logoff(int id)
 {
     Sessao.Limpar(HttpContext);
     return(RedirectToAction("Index", "Home"));
 }
Example #28
0
        public static void TestSessionUpdate()
        {
            using (var conn = new SqliteConnection(GlobalController.path))
            {
                conn.Open();

                Pessoa.Insert("patient name1", "m", "1995-01-01", "6198732711", null);
                Pessoa.Insert("patient name2", "m", "1995-01-02", "6198732712", null);
                Pessoa.Insert("patient name3", "m", "1995-01-03", "6198732713", null);
                Pessoa.Insert("physio name1", "m", "1995-01-04", "6198732714", null);
                Pessoa.Insert("physio name2", "m", "1995-01-05", "6198732715", null);
                Pessoa.Insert("physio name3", "m", "1995-01-06", "6198732716", null);

                Fisioterapeuta.Insert(4, "abracadabra1", "demais1", null, null);
                Fisioterapeuta.Insert(5, "abracadabra2", "demais2", null, null);
                Fisioterapeuta.Insert(6, "abracadabra3", "demais3", null, null);

                Paciente.Insert(1, null);
                Paciente.Insert(2, null);
                Paciente.Insert(3, null);

                Sessao.Insert(1, 1, "2018-03-01", null);
                Sessao.Insert(2, 2, "2018-03-02", "procedimento2");
                Sessao.Insert(3, 3, "2018-03-03", "procedimento3");

                Sessao.Update(1, 3, 3, "2018-04-01", null);
                Sessao.Update(2, 2, 2, "2018-05-01", null);
                Sessao.Update(3, 1, 1, "2018-06-01", null);

                var check = "SELECT * FROM SESSAO;";

                var id     = 0;
                var result = "";
                int i      = 1;

                using (var cmd = new SqliteCommand(check, conn))
                {
                    using (IDataReader reader = cmd.ExecuteReader())
                    {
                        try
                        {
                            while (reader.Read())
                            {
                                if (!reader.IsDBNull(0))
                                {
                                    id = reader.GetInt32(0);
                                    Assert.AreEqual(id, i);
                                }

                                if (!reader.IsDBNull(1))
                                {
                                    id = reader.GetInt32(1);
                                    Assert.AreEqual(id, 4 - i);
                                }

                                if (!reader.IsDBNull(2))
                                {
                                    id = reader.GetInt32(2);
                                    Assert.AreEqual(id, 4 - i);
                                }

                                if (!reader.IsDBNull(3))
                                {
                                    result = reader.GetString(3);
                                    Assert.AreEqual(result, string.Format("2018-0{0}-01", 3 + i));
                                }

                                Assert.AreEqual(reader.IsDBNull(4), true);

                                i++;
                            }
                        }
                        finally
                        {
                            reader.Dispose();
                            reader.Close();
                        }
                    }
                    cmd.Dispose();
                }
                conn.Dispose();
                conn.Close();
            }
        }
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(0, 25, true);
            WriteLiteral("<!DOCTYPE html>\r\n<html>\r\n");
            EndContext();
            BeginContext(25, 406, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("head", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "18e207a4777a4359b6356a2851c4509c", async() => {
                BeginContext(31, 129, true);
                WriteLiteral("\r\n    <meta charset=\"utf-8\" lang=\"pt-br\" />\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\r\n\r\n    ");
                EndContext();
                BeginContext(160, 66, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "53c832cf7970423fbee8e2db2d789891", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(226, 6, true);
                WriteLiteral("\r\n    ");
                EndContext();
                BeginContext(232, 69, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "58290e080d69451dbad3f27f47492d6d", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(301, 6, true);
                WriteLiteral("\r\n    ");
                EndContext();
                BeginContext(307, 59, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "802da793626a4a038660e85457a7e7bd", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(366, 15, true);
                WriteLiteral("\r\n\r\n    <title>");
                EndContext();
                BeginContext(382, 17, false);
#line 11 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                Write(ViewData["Title"]);

#line default
#line hidden
                EndContext();
                BeginContext(399, 25, true);
                WriteLiteral(" - Loja Virtual</title>\r\n");
                EndContext();
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(431, 2, true);
            WriteLiteral("\r\n");
            EndContext();
            BeginContext(433, 4400, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("body", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "2d30e05d2771408fbdc6b5b6a74c4295", async() => {
                BeginContext(439, 123, true);
                WriteLiteral("\r\n    <nav class=\"navbar navbar-expand-md navbar-light\" style=\"background-color: #ade9eb\">\r\n        <a class=\"navbar-brand\"");
                EndContext();
                BeginWriteAttribute("href", " href=\"", 562, "\"", 598, 1);
#line 15 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                WriteAttributeValue("", 569, Url.Action("Inicio", "Home"), 569, 29, false);

#line default
#line hidden
                EndWriteAttribute();
                BeginContext(599, 406, true);
                WriteLiteral(@">Loja Virtual</a>
        <button class=""navbar-toggler"" type=""button"" data-toggle=""collapse"" data-target=""#navbar"" aria-controls=""navbarSupportedContent"" aria-expanded=""false"" aria-label=""Toggle navigation"">
            <span class=""navbar-toggler-icon""></span>
        </button>

        <div class=""collapse navbar-collapse justify-content-start"" id=""navbar"">
            <ul class=""navbar-nav"">
");
                EndContext();
#line 22 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                if (Sessao.ExisteSessao() && Sessao.IdPerfil != (uint)Global.Perfil.Cliente)
                {
#line default
#line hidden
                    BeginContext(1119, 442, true);
                    WriteLiteral(@"                    <li class=""nav-item text-center"">
                        <div class=""dropdown"">
                            <a class=""nav-link"" href=""#"" data-toggle=""dropdown"" aria-haspopup=""true""
                               aria-expanded=""false"" id=""dropdown-produto"">Produtos</a>
                            <div class=""dropdown-menu"" aria-labelledby=""dropdown-produto"">
                                <a class=""dropdown-item""");
                    EndContext();
                    BeginWriteAttribute("href", " href=\"", 1561, "\"", 1602, 1);
#line 29 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                    WriteAttributeValue("", 1568, Url.Action("Cadastro", "Produto"), 1568, 34, false);

#line default
#line hidden
                    EndWriteAttribute();
                    BeginContext(1603, 67, true);
                    WriteLiteral(">Novo</a>\r\n                                <a class=\"dropdown-item\"");
                    EndContext();
                    BeginWriteAttribute("href", " href=\"", 1670, "\"", 1708, 1);
#line 30 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                    WriteAttributeValue("", 1677, Url.Action("Lista", "Produto"), 1677, 31, false);

#line default
#line hidden
                    EndWriteAttribute();
                    BeginContext(1709, 108, true);
                    WriteLiteral(">Listar</a>\r\n                            </div>\r\n                        </div>\r\n                    </li>\r\n");
                    EndContext();
#line 34 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                }

#line default
#line hidden
                BeginContext(1836, 16, true);
                WriteLiteral("                ");
                EndContext();
#line 35 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                if (Sessao.ExisteSessao())
                {
#line default
#line hidden
                    BeginContext(1900, 441, true);
                    WriteLiteral(@"                    <li class=""nav-item text-center"">
                        <div class=""dropdown"">
                            <a class=""nav-link"" href=""#"" data-toggle=""dropdown"" aria-haspopup=""true""
                               aria-expanded=""false"" id=""dropdown-produto"">Pedidos</a>
                            <div class=""dropdown-menu"" aria-labelledby=""dropdown-produto"">
                                <a class=""dropdown-item""");
                    EndContext();
                    BeginWriteAttribute("href", " href=\"", 2341, "\"", 2385, 1);
#line 42 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                    WriteAttributeValue("", 2348, Url.Action("ListaCliente", "Pedido"), 2348, 37, false);

#line default
#line hidden
                    EndWriteAttribute();
                    BeginContext(2386, 19, true);
                    WriteLiteral(">Meus pedidos</a>\r\n");
                    EndContext();
#line 43 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                    if (Sessao.IdPerfil != (uint)Global.Perfil.Cliente)
                    {
#line default
#line hidden
                        BeginContext(2526, 60, true);
                        WriteLiteral("                                    <a class=\"dropdown-item\"");
                        EndContext();
                        BeginWriteAttribute("href", " href=\"", 2586, "\"", 2631, 1);
#line 45 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                        WriteAttributeValue("", 2593, Url.Action("ListaVendedor", "Pedido"), 2593, 38, false);

#line default
#line hidden
                        EndWriteAttribute();
                        BeginContext(2632, 16, true);
                        WriteLiteral(">Gerenciar</a>\r\n");
                        EndContext();
#line 46 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                    }

#line default
#line hidden
                    BeginContext(2683, 95, true);
                    WriteLiteral("                            </div>\r\n                        </div>\r\n                    </li>\r\n");
                    EndContext();
#line 50 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                }

#line default
#line hidden
                BeginContext(2797, 16, true);
                WriteLiteral("                ");
                EndContext();
#line 51 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                if (Sessao.ExisteSessao() && Sessao.IdPerfil == (uint)Global.Perfil.Administrador)
                {
#line default
#line hidden
                    BeginContext(2917, 150, true);
                    WriteLiteral("                    <li class=\"nav-item text-center\">\r\n                        <div class=\"dropdown\">\r\n                            <a class=\"nav-link\"");
                    EndContext();
                    BeginWriteAttribute("href", " href=\"", 3067, "\"", 3105, 1);
#line 55 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                    WriteAttributeValue("", 3074, Url.Action("Lista", "Usuario"), 3074, 31, false);

#line default
#line hidden
                    EndWriteAttribute();
                    BeginContext(3106, 96, true);
                    WriteLiteral(" id=\"dropdown-produto\">Usuários</a>\r\n                        </div>\r\n                    </li>\r\n");
                    EndContext();
#line 58 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                }

#line default
#line hidden
                BeginContext(3221, 35, true);
                WriteLiteral("            </ul>\r\n        </div>\r\n");
                EndContext();
#line 61 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                if (!Sessao.ExisteSessao())
                {
#line default
#line hidden
                    BeginContext(3305, 143, true);
                    WriteLiteral("            <div class=\"row d-md-block d-none\">\r\n                <div class=\"col\">\r\n                    <a class=\"btn btn-sm btn-outline-light\"");
                    EndContext();
                    BeginWriteAttribute("href", " href=\"", 3448, "\"", 3485, 1);
#line 65 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                    WriteAttributeValue("", 3455, Url.Action("Entrar", "Login"), 3455, 30, false);

#line default
#line hidden
                    EndWriteAttribute();
                    BeginContext(3486, 57, true);
                    WriteLiteral(">Entrar</a>\r\n                </div>\r\n            </div>\r\n");
                    EndContext();
#line 68 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                }
                else
                {
#line default
#line hidden
                    BeginContext(3579, 125, true);
                    WriteLiteral("            <div class=\"row\">\r\n                <div class=\"col\">\r\n                    <a class=\"btn btn-sm btn-outline-light\"");
                    EndContext();
                    BeginWriteAttribute("href", " href=\"", 3704, "\"", 3742, 1);
#line 73 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                    WriteAttributeValue("", 3711, Url.Action("Menu", "Carrinho"), 3711, 31, false);

#line default
#line hidden
                    EndWriteAttribute();
                    BeginContext(3743, 662, true);
                    WriteLiteral(@"><i class=""fa fa-shopping-cart""></i></a>
                </div>
                <div class=""col"">
                    <div class=""btn-group dropdown"">
                        <button type=""button"" class=""btn btn-outline-light btn-sm dropdown-toggle"" data-toggle=""dropdown"" aria-haspopup=""true"" aria-expanded=""false"">
                            <i class=""fa fa-user""></i> Conta
                        </button>
                        <div class=""dropdown-menu"">
                            <a class=""dropdown-item"" href=""#"" id=""btn-perfil"" data-toggle=""modal"" data-target=""#modal-perfil"">Perfil</a>
                            <a class=""dropdown-item""");
                    EndContext();
                    BeginWriteAttribute("href", " href=\"", 4405, "\"", 4440, 1);
#line 82 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                    WriteAttributeValue("", 4412, Url.Action("Sair", "Login"), 4412, 28, false);

#line default
#line hidden
                    EndWriteAttribute();
                    BeginContext(4441, 115, true);
                    WriteLiteral(">Sair</a>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n");
                    EndContext();
#line 87 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                }

#line default
#line hidden
                BeginContext(4567, 69, true);
                WriteLiteral("    </nav>\r\n\r\n    <div class=\"container mt-3 body-content\">\r\n        ");
                EndContext();
                BeginContext(4637, 12, false);
#line 91 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                Write(RenderBody());

#line default
#line hidden
                EndContext();
                BeginContext(4649, 12, true);
                WriteLiteral("\r\n\r\n        ");
                EndContext();
                BeginContext(4662, 34, false);
#line 93 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                Write(await Html.PartialAsync("_Perfil"));

#line default
#line hidden
                EndContext();
                BeginContext(4696, 60, true);
                WriteLiteral("\r\n        <footer class=\"text-center mt-5\">\r\n            <p>");
                EndContext();
                BeginContext(4757, 17, false);
#line 95 "C:\Projetos\Loja Virtual\LojaVirtual\Views\Shared\_Layout.cshtml"
                Write(DateTime.Now.Year);

#line default
#line hidden
                EndContext();
                BeginContext(4774, 52, true);
                WriteLiteral(" - Loja Virtual</p>\r\n        </footer>\r\n    </div>\r\n");
                EndContext();
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(4833, 13, true);
            WriteLiteral("\r\n</html>\r\n\r\n");
            EndContext();
            BeginContext(4846, 52, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "9f3e247518e0449bb3885ae676b20f91", async() => {
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(4898, 2, true);
            WriteLiteral("\r\n");
            EndContext();
            BeginContext(4900, 64, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "695f2c235b0b44bf8c9e823ee8932bb6", async() => {
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(4964, 2, true);
            WriteLiteral("\r\n");
            EndContext();
            BeginContext(4966, 55, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "c52775530bc44738972da6c9d385ca6b", async() => {
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(5021, 2, true);
            WriteLiteral("\r\n");
            EndContext();
            BeginContext(5023, 46, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "f7ee59fb7c5e4f8ea17cf0243ea040c1", async() => {
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(5069, 2, true);
            WriteLiteral("\r\n");
            EndContext();
            BeginContext(5071, 45, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "a285e37ac610418c9447334eed8f5e77", async() => {
            }
                                                                        );
            __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_8);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
        }
Example #30
0
        public static void TestSessionDeleteValue()
        {
            using (var conn = new SqliteConnection(GlobalController.path))
            {
                conn.Open();

                Pessoa.Insert("patient name1", "m", "1995-01-01", "6198732711", null);
                Pessoa.Insert("patient name2", "m", "1995-01-02", "6198732712", null);
                Pessoa.Insert("patient name3", "m", "1995-01-03", "6198732713", null);
                Pessoa.Insert("physio name1", "m", "1995-01-04", "6198732714", null);
                Pessoa.Insert("physio name2", "m", "1995-01-05", "6198732715", null);
                Pessoa.Insert("physio name3", "m", "1995-01-06", "6198732716", null);

                Fisioterapeuta.Insert(4, "abracadabra1", "demais1", null, null);
                Fisioterapeuta.Insert(5, "abracadabra2", "demais2", null, null);
                Fisioterapeuta.Insert(6, "abracadabra3", "demais3", null, null);

                Paciente.Insert(1, null);
                Paciente.Insert(2, null);
                Paciente.Insert(3, null);

                Sessao.Insert(1, 1, "2018-03-01", null);
                Sessao.Insert(2, 2, "2018-03-02", "procedimento2");
                Sessao.Insert(3, 3, "2018-03-03", "procedimento3");

                var check = "SELECT EXISTS(SELECT 1 FROM 'SESSAO' WHERE \"idSessao\" = \"1\" LIMIT 1)";

                var result = 0;
                using (var cmd = new SqliteCommand(check, conn))
                {
                    using (IDataReader reader = cmd.ExecuteReader())
                    {
                        try
                        {
                            while (reader.Read())
                            {
                                if (!reader.IsDBNull(0))
                                {
                                    result = reader.GetInt32(0);
                                }
                            }
                        }
                        finally
                        {
                            reader.Dispose();
                            reader.Close();
                        }
                    }
                    cmd.Dispose();
                }

                Assert.AreEqual(result, 1);
                Sessao.DeleteValue(1);

                result = 0;
                using (var cmd = new SqliteCommand(check, conn))
                {
                    using (IDataReader reader = cmd.ExecuteReader())
                    {
                        try
                        {
                            while (reader.Read())
                            {
                                if (!reader.IsDBNull(0))
                                {
                                    result = reader.GetInt32(0);
                                }
                            }
                        }
                        finally
                        {
                            reader.Dispose();
                            reader.Close();
                        }
                    }
                    cmd.Dispose();
                }

                Assert.AreEqual(result, 0);

                conn.Dispose();
                conn.Close();
            }
        }
Example #31
0
 public static void Deletar(Sessao sessao)
 {
     AbstractService.Deletar(sessao, "Sessao");
     CCPorSessaoService.DeletarAllBySessaoId(sessao.Id);
 }
Example #32
0
 public CertificadoDigital CarregarPorId(int id)
 {
     return(Sessao.Get <CertificadoDigital>(id));
 }
Example #33
0
 public Cidade CarregarPorId(int id)
 {
     return(Sessao.Get <Cidade>(id));
 }
 public SegurancaWebService(IUsuarioStore usuarios, Sessao sessao)
 {
     _usuarios = usuarios;
     _sessao = sessao;
 }