Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Verificar se ainda está logado
            if (Session["cadID"] != null)
            {
                objUtils = new utils();
                string acao = Request["acao"];

                switch (acao)
                {
                case "cadastrarCupom":
                    Click();
                    break;

                default:
                    break;
                }
            }
            else
            {
                //DESLOGADO
                Response.Redirect("/login.aspx");
            }

            usuario.InnerHtml += Session["cadNome"].ToString();
            objUtils           = new utils();
            objBD              = new bd();
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            carregaCupons();
        }
Пример #3
0
        //Metodo de cadastrar
        public bool setVeiculo()
        {
            try
            {
                bd banco = new bd();

                string sql = "INSERT INTO tb_veiculo (ID_veiculo, Placa, UF, Renavam, Cor, Fabricante, Modelo, Ano, Categoria, Kilometragem, Status, Foto) VALUES (NULL, @Placa, @UF, @Renavam, @cor, @Fabricante, @Modelo, @Ano, @Categoria, @Kilometragem, @Status, @Foto)";

                MySqlCommand cmd = new MySqlCommand(sql, banco.conecta());
                cmd.Parameters.AddWithValue("@Placa", this.placa);
                cmd.Parameters.AddWithValue("@UF", this.uf);
                cmd.Parameters.AddWithValue("@Renavam", this.renavam);
                cmd.Parameters.AddWithValue("@Cor", this.cor);
                cmd.Parameters.AddWithValue("@Fabricante", this.fabricante);
                cmd.Parameters.AddWithValue("@Modelo", this.modelo);
                cmd.Parameters.AddWithValue("@Ano", this.ano);
                cmd.Parameters.AddWithValue("@Categoria", this.categoria);
                cmd.Parameters.AddWithValue("@Kilometragem", this.kilometragem);
                cmd.Parameters.AddWithValue("@Status", this.status_veiculo);
                cmd.Parameters.AddWithValue("@Foto", this.foto);
                cmd.ExecuteNonQuery();

                banco.desconecta(banco.conecta());

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //Verificar se ainda está logado
            if (Session["cadID"] != null)
            {
                objUtils = new utils();
                string acao = Request["acao"];

                //Verificar se é Cliente Besni
                if (Session["Besni"] != null)
                {
                    if (Session["Besni"].ToString().Length > 15)
                    {
                        tipo = "Sim";
                    }
                }


                link.Attributes.Add("href", "/cadastro.aspx?Editar=" + tipo);
            }
            else
            {
                //DESLOGADO
                Response.Redirect("/login.aspx");
            }

            usuario.InnerHtml += Session["cadNome"].ToString();
            objUtils           = new utils();
            objBD              = new bd();
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            popularGanhadores();
        }
Пример #6
0
 public void Excluir(int Id)
 {
     using (bd = new bd())
     {
         var strQuery = string.Format(" DELETE FROM Tarefas WHERE TarefaId = {0}", Id);
         bd.ExecutaComando(strQuery);
     }
 }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            ProximoSorteio();
            PopularInstagram();
        }
 public void Excluir(int id)
 {
     using (BD = new bd())
     {
         strQuery = string.Format("DELETE FROM usuarios WHERE id = {0}", id);
         BD.ExecutaComando(strQuery);
     }
 }
Пример #9
0
 public void Excluir(int codFuncionario)
 {
     using (bd = new bd())
     {
         var strQuery = string.Format("DELETE FROM Funcionarios WHERE CodFuncionario = '{0}'", codFuncionario);
         bd.ExecutaComando(strQuery);
     }
 }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            PopularDataInicio();
            carregaCompras(Convert.ToInt16(Request["pagina"]));
        }
Пример #11
0
        static void Main(string[] args)
        {
            var bd               = new bd();
            var usuario          = new Usuario();
            var usuarioAplicacao = new UsuarioAplicacao();



            SqlConnection conexao = new SqlConnection(@"Server=localhost;Initial Catalog=ExemploBD;Persist Security Info=False;User ID=sa;Password=Poder6645@; MultipleActiveResultSets=True");


            //Abrindo a conexão
            conexao.Open();


            //string strQueryUpdate = "UPDATE usuario SET nome = 'Fabio' WHERE usuarioId = 1";
            //SqlCommand cmdComandoUpdate = new SqlCommand(strQueryUpdate, conn);
            //cmdComandoUpdate.ExecuteNonQuery();

            //string strQueryDelete = "DELETE FROM usuario WHERE usuarioID = 1";
            //SqlCommand cmdComandoDelete = new SqlCommand(strQueryDelete, conn);
            //cmdComandoDelete.ExecuteNonQuery();

            Console.Write("Digite o nome do usuário:");
            string nome = Console.ReadLine();

            Console.Write("Digite o nome do Cargo:");
            string cargo = Console.ReadLine();

            Console.Write("Digite o nome do Data:");
            string date = Console.ReadLine();

            var Usuario = new Usuario
            {
                nome  = nome,
                cargo = cargo,
                data  = DateTime.Parse(date)
            };


            Usuario.Id = 4;

            new UsuarioAplicacao().Salvar(usuario);


            string strQueryInsert = string.Format("INSERT INTO usuario(nome, cargo, date) VALUES ('{0}', '{1}', '{2}')", nome, cargo, date);

            bd.ExecutaComando(strQueryInsert);


            string        strQuerySelect = "SELECT * FROM usuario";
            SqlDataReader dados          = bd.ExecutaComandoComRetorno(strQuerySelect);

            while (dados.Read())
            {
                Console.WriteLine("Id:{0}, Nome:{1}, Cargo:{2}, Date:{3}", dados["usuarioId"], dados["nome"], dados["cargo"], dados["date"]);
            }
        }
Пример #12
0
 public List <Tarefas> ListarTodos()
 {
     using (bd = new bd())
     {
         var strQuery = "SELECT * FROM Tarefas";
         var retorno  = bd.ExecutaComandoComRetorno(strQuery);
         return(ReaderEmLista(retorno));
     }
 }
 public Usuarios ListarPorId(int id)
 {
     using (var bd = new bd())
     {
         var strQuery = string.Format("SELECT  * FROM usuarios WHERE id = {0}", id);
         var retorno  = bd.ExecutaComandoComRetorno(strQuery);
         return(ReaderLista(retorno).FirstOrDefault());
     }
 }
 public List <Usuarios> ListarTodos()
 {
     using (var BD = new bd())
     {
         var strQuery = "SELECT  * FROM usuarios";
         var retorno  = BD.ExecutaComandoComRetorno(strQuery);
         return(ReaderLista(retorno));
     }
 }
Пример #15
0
 public Funcionarios ListarPorId(int codFuncionario)
 {
     using (bd = new bd())
     {
         var strQuery = string.Format("SELECT * FROM Funcionarios WHERE CodFuncionario = {0}", codFuncionario);
         var retorno  = bd.ExecutaComandoComRetorno(strQuery);
         return(ReaderEmLista(retorno).FirstOrDefault());
     }
 }
Пример #16
0
 public Tarefas ListarPorId(int id)
 {
     using (bd = new bd())
     {
         var strQuery = string.Format("SELECT * FROM Tarefas WHERE TarefaId = {0}", id);
         var retorno  = bd.ExecutaComandoComRetorno(strQuery);
         return(ReaderEmLista(retorno).FirstOrDefault());
     }
 }
Пример #17
0
 public void b()
 {
     GC.SuppressFinalize(this);
     this.a();
     this.az.Clear();
     this.n   = null;
     this.ag  = null;
     this.au  = null;
     this.at  = null;
     this.@as = null;
     this.ar  = null;
     this.aq  = null;
     this.ap  = null;
     this.ao  = null;
     this.an  = null;
     this.am  = null;
     this.al  = null;
     this.ak  = null;
     this.aj  = null;
     this.ai  = null;
     this.ah  = null;
     this.af  = null;
     this.ae  = null;
     this.ad  = null;
     this.ac  = null;
     this.ab  = null;
     this.aa  = null;
     this.z   = null;
     this.y   = null;
     this.x   = null;
     this.w   = null;
     this.v   = null;
     this.u   = null;
     this.t   = null;
     this.s   = null;
     this.r   = null;
     this.q   = null;
     this.p   = null;
     this.c   = null;
     this.av  = null;
     this.o   = null;
     this.m   = null;
     this.l   = null;
     this.k   = null;
     this.j   = null;
     this.i   = null;
     this.h   = null;
     this.g   = null;
     this.f   = null;
     this.e   = null;
     this.d   = null;
     this.b   = null;
     this.a   = null;
     this.aw  = null;
     this.ax  = null;
     this.ay  = null;
 }
Пример #18
0
        private void Inserir(Tarefas tarefas)
        {
            var strQuery = "";

            strQuery += "INSERT INTO Tarefas(Tarefa, Status)";
            strQuery += string.Format(" VALUES ('{0}', '{1}')", tarefas.Tarefa, tarefas.Status);

            using (bd = new bd())
            {
                bd.ExecutaComando(strQuery);
            }
        }
Пример #19
0
        private void Inserir(Funcionarios funcionarios)
        {
            var strQuery = "";

            strQuery += "INSERT INTO FUNCIONARIOS(Nome,DataNascimento,Salario,Atividades) ";
            strQuery += string.Format(" values('{0}','{1}','{2}','{3}')", funcionarios.nome, funcionarios.dataNascimento, funcionarios.salario, funcionarios.atividades);

            using (bd = new bd())
            {
                bd.ExecutaComando(strQuery);
            }
        }
        public void Insert(Usuarios usuarios)
        {
            var strQuery = "";

            strQuery += "Insert into usuarios (nome, cargo, data)";
            strQuery += string.Format(" Values ('{0}', '{1}', '{2}')", usuarios.nome, usuarios.cargo, usuarios.data);

            using (BD = new bd())
            {
                BD.ExecutaComando(strQuery);
            }
        }
Пример #21
0
        static void Main(string[] args)
        {
            bd banco = new bd();
            UsuarioAplicacao usuarioAplicacao = UsuarioAplicacaoConstrutor.usuarioApADO();

            ////ATUALIZANDO VALORES DA TABELA
            //string strQueryUpdate = "UPDATE usuarios SET nome='Fabio' WHERE usuarioId=1 ";
            //bd.ExecutaComando(strQueryUpdate);


            ////DELETANDO VALORES DA TABELA
            //string strQueryDelete = "DELETE FROM usuarios WHERE usuarioId= 1 ";
            //bd.ExecutaComando(strQueryDelete);

            Console.Write("Digite o nome do usuário: ");
            string nome = Console.ReadLine();

            Console.Write("Digite o nome do cargo: ");
            string cargo = Console.ReadLine();

            Console.Write("Digite a data do usuário: ");
            string date = Console.ReadLine();

            //////INSERINDO VALORES DA TABELA
            ////string strQueryInsert = string.Format("INSERT INTO usuarios(nome, cargo, date) VALUES('{0}', '{1}', '{2}') ",nome, cargo, date);//Fomata os parametros para string
            ////bd.ExecutaComando(strQueryInsert);

            var usuarios = new Usuarios
            {
                Nome  = nome,
                Cargo = cargo,
                Data  = Convert.ToDateTime(date)
            };

            ////usuarios.Id = 2004;
            usuarioAplicacao.Salvar(usuarios);
            //usuarioAplicacao.Excluir(2006);

            //BUSCANDO TODOS OS USUARIOS DA TABELA USUARIO

            //EXECUTOR DE DADOS
            var dados = usuarioAplicacao.ListarUsuarios(usuarios);


            foreach (var usuario in dados)
            {
                Console.WriteLine("Id:{0}, Nome:{1}, Cargo:{2}, Data:{3}", usuario.Id, usuario.Nome, usuario.Cargo, usuario.Data);
            }
            {
                //EXIBINDO OS DADOS DA TABELA
                //Console.WriteLine("Id:{0}, Nome:{1}, Cargo:{2}, Data:{3}", dados["usuarioId"], dados["nome"], dados["cargo"], dados["date"]);
            }
        }
Пример #22
0
    private void Inserir(Usuario usuario)
    {
        var strQuery = "";

        strQuery += "INSERT INTO usurios(nome, cargo, data)";
        strQuery += string.Format(" VALUES ('{0}', '{1}', '{2}')", usuario.nome, usuario.cargo, usuario.data
                                  );

        using (bd = new bd())
        {
            bd.ExecutaComando(strQuery);
        }
    }
Пример #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            ///objUtils.EnviaEmail("*****@*****.**", "Esqueci a Senha | Promoção Besni", "conteudo", "", "", null, "*****@*****.**", null);
            objUtils.EnviaEmail("*****@*****.**", "teste de envio", "mensagem aqui", "", "", null, "*****@*****.**", "PROMOCAO");

            Contagem();
            //  PegarResultado();
            ExbirResultado();
            resumoImportacao();
        }
Пример #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            /*INICIO DOS TESTES*/
            // DirectoryInfo dirInfo = new DirectoryInfo(@"e:\home\promocaobesni\web\arquivos");
            DirectoryInfo dirInfo = new DirectoryInfo(@"C:\svn\cartao-premiado\trunk\cartaoPremiado\arquivos");

            BuscaArquivos(dirInfo);

            /*FIM DOS TESTES*/
        }
Пример #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();


            if (DateTime.Today.DayOfWeek.ToString() == "Sunday")
            {
                PegarResultado();
            }

            Contagem();
            ExbirResultado();
        }
Пример #26
0
        private void Alterar(Tarefas tarefas)
        {
            var strQuery = "";

            strQuery += "UPDATE tarefas SET ";
            strQuery += string.Format("Tarefa = '{0}',", tarefas.Tarefa);
            strQuery += string.Format("Status = '{0}' ", tarefas.Status);
            strQuery += string.Format("WHERE TarefaId = {0} ", tarefas.TarefaId);

            using (bd = new bd())
            {
                bd.ExecutaComando(strQuery);
            }
        }
Пример #27
0
        private void btnAtualizarTabela_Click(object sender, EventArgs e)
        {
            bd banco = new bd();

            string sql = "SELECT * FROM tb_funcionario";

            MySqlDataAdapter cmd = new MySqlDataAdapter(sql, banco.conecta());
            DataSet          DS  = new DataSet();

            cmd.Fill(DS);
            dgvTab_Funcionario.DataSource = DS.Tables[0];

            banco.desconecta(banco.conecta());
        }
Пример #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            string acao = Request["acao"];

            switch (acao)
            {
            default:
                carregaCupons(Convert.ToInt16(Request["pagina"]));
                break;
            }
        }
        public void Alterar(Usuarios usuarios)
        {
            var strQuery = "";

            strQuery += "UPDATE usuarios SET ";
            strQuery += string.Format("nome= '{0}',", usuarios.nome);
            strQuery += string.Format("cargo= '{0}',", usuarios.cargo);
            strQuery += string.Format("data= '{0}'", usuarios.data);
            strQuery += string.Format("WHERE id = {0}", usuarios.id);

            using (BD = new bd())
            {
                BD.ExecutaComando(strQuery);
            }
        }
Пример #30
0
    public void Alterar(Usuario usuario)
    {
        var strQuery = "";

        strQuery += "UPDATE usuario SET ";
        strQuery += string.Format("Nome = '{0}'", usuario.nome);
        strQuery += string.Format("Cargo = '{0}'", usuario.cargo);
        strQuery += string.Format("Data = '{0}'", usuario.data);
        strQuery += string.Format("WHERE Id = '{0} ", usuario.Id);

        using (bd = new bd())
        {
            bd.ExecutaComando(strQuery);
        }
    }