示例#1
0
        private void BotaoPesquisar_Click(object sender, EventArgs e)
        {
            limparFormulario();
            Pesquisar pesqForm = new Pesquisar();

            pesqForm.ShowDialog();
        }
示例#2
0
 private void txtSeqconvenio_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (txtSeqconvenio.Text.Length > 0)
     {
         PesquisarConvenio(txtSeqconvenio.Text);
     }
     else
     {
         Pesquisar.MostrarConvenio();
     }
 }
示例#3
0
 private void btnPesquisar_Click(object sender, EventArgs e)
 {
     if (txtPlaca.Text.Length > 0)
     {
         PesquisarPlaca(txtPlaca.Text);
     }
     else if (txtPlaca.Text.Length == 0)
     {
         Pesquisar.MostrarMovtoPlaca();
         txtSeqmovto.Text = Properties.Settings.Default.sequencia;
     }
 }
示例#4
0
 private void btnPesquisar_Click(object sender, EventArgs e)
 {
     if (txtSequsuario.Text.Length > 0)
     {
         PesquisarUsuario(txtSequsuario.Text);
     }
     else
     {
         Pesquisar.MostrarUsuario();
         txtSequsuario.Text = Properties.Settings.Default.sequencia;
     }
     modo = false;
 }
示例#5
0
 private void txtPlaca_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Return && txtPlaca.Text.Length > 0)
     {
         PesquisarPlaca(txtPlaca.Text);
     }
     else if (e.KeyChar == (char)Keys.Return && txtPlaca.Text.Length == 0)
     {
         Pesquisar.MostrarMovtoPlaca();
         txtSeqmovto.Text = Properties.Settings.Default.sequencia;
     }
     txtSeqmodelo.Focus();
 }
示例#6
0
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            if (txtSeqpessoa.Text.Length > 0)
            {
                PesquisarPessoa(txtSeqpessoa.Text);
                dgvTelefone.DataSource = TelefoneController.listarTelefoneBySeqpessoa(txtSeqpessoa.Text);
            }


            else
            {
                Pesquisar.MostrarPessoa();
                txtSeqpessoa.Text = Properties.Settings.Default.sequencia;
            }
        }
示例#7
0
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            if (txtSeqconvenio.Text.Length > 0)
            {
                PesquisarConvenio(txtSeqconvenio.Text);
            }
            else
            {
                Pesquisar.MostrarConvenio();
                txtSeqconvenio.Text = Properties.Settings.Default.sequencia;
            }

            LiberarBotoes(false, true, false, true);
            LiberarCampos(false, true, true);
            txtSeqpessoa.Focus();
        }
示例#8
0
        private void frmMovimento_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F2)
            {
                btnPesquisar.PerformClick();
            }

            if (e.KeyCode == Keys.F3)
            {
                Pesquisar.MostrarConvenio();
            }

            if (e.KeyCode == Keys.F5)
            {
                btnGravar.PerformClick();
            }

            if (e.KeyCode == Keys.Escape)
            {
                btnLimpar.PerformClick();
            }
        }
示例#9
0
 public PacienteHelper(Pesquisar pesquisar)
 {
     this.contextoPesquisar = pesquisar;
 }
        private void btnpesquisar_Click(object sender, EventArgs e)
        {
            Pesquisar pesquisar = new Pesquisar();

            pesquisar.Show();
        }
示例#11
0
 public ConsultaHelper(Pesquisar contexto)
 {
     this.contextoPesquisa = contexto;
 }
示例#12
0
        /// <summary>
        /// funcao - carrega os menus 
        /// </summary>
        /// <param name="filtrar"></param>
        /// <param name="pesquisar"></param>
        public static void CarregarMenus(Filtrar filtrar,
                                         Pesquisar pesquisar)
        {
            if (_connection.State != ConnectionState.Closed)
            {
                _connection.Close();
                _connection.Dispose();
            }
            try
            {
                ArrayList.Clear();
                using (_connection = new MySqlConnection(MainWindow.Interface.ConnectionString))
                {

                    _connection.Open();
                    var comandosql = @"SELECT `MOD.TIPO`," +
                                     "`MOD.NOME`," +
                                     "`MOD.DESCRICAO`," +
                                     "`MOD.PRIVILEGIO`" +
                                     "FROM   `v101_tab_modulo`";
                    switch (filtrar)
                    {

                        case Filtrar.Todos:
                            if (LikeByText != string.Empty)
                            {
                                switch (pesquisar)
                                {
                                    case Pesquisar.Modulo:
                                        comandosql = string.Concat(comandosql,
                                        " WHERE `MOD.NOME` LIKE '%" + LikeByText + "%'");
                                        break;
                                    case Pesquisar.Descricao:
                                        comandosql = string.Concat(comandosql,
                                        " WHERE `MOD.DESCRICAO` LIKE '%" + LikeByText + "%'");
                                        break;
                                    case Pesquisar.Privilegio:
                                        comandosql = string.Concat(comandosql,
                                        " WHERE `MOD.PRIVILEGIO` LIKE '%" + LikeByText + "%'");
                                        break;
                                }
                            }
                            break;
                        case Filtrar.Aplicacao:
                            comandosql = string.Concat(comandosql,
                            " WHERE `MOD.TIPO` = 'APLICACAO'");
                            break;
                        case Filtrar.Modulo:
                            comandosql = string.Concat(comandosql,
                            " WHERE `MOD.TIPO` = 'MENU'");
                            break;
                    }
                    switch (pesquisar)
                    {
                       case Pesquisar.Modulo:
                            if (LikeByText != string.Empty && filtrar != Filtrar.Todos)
                            {
                                comandosql = string.Concat(comandosql,
                                " AND `MOD.NOME` LIKE '%" + LikeByText + "%'");
                            }
                            break;
                       case Pesquisar.Descricao:
                            if (LikeByText != string.Empty && filtrar != Filtrar.Todos)
                            {
                                comandosql = string.Concat(comandosql,
                                " AND `MOD.DESCRICAO` LIKE '%" + LikeByText + "%'");
                            }
                            break;
                       case Pesquisar.Privilegio:
                            if (LikeByText != string.Empty && filtrar != Filtrar.Todos)
                            {
                                comandosql = string.Concat(comandosql,
                                " AND `MOD.PRIVILEGIO` LIKE '%" + LikeByText + "%'");
                            }
                            break;
                    }
                    using (MySqlCommand command = new MySqlCommand(comandosql,_connection))
                    {
                        MySqlDataReader sqlDataReader = command.ExecuteReader();
                        while (sqlDataReader.Read())
                        {
                            if (sqlDataReader.GetString(1) != @"MNU000")
                            {
                                var t = new UiMenu()
                                {
                                    Tipo = sqlDataReader.GetString(0),
                                    Modulo = sqlDataReader.GetString(1),
                                    Descricao = sqlDataReader.GetString(2),
                                    Privilegio = sqlDataReader.GetString(3)
                                };
                                ArrayList.Add(t);
                            }
                        }
                    }
                }
            }
            catch (MySqlException e)
            {
                Console.WriteLine(e.ToString());
            }
            finally
            {
                if (_connection.State != ConnectionState.Closed)
                {
                    _connection.Close();
                    _connection.Dispose();
                }
            }
        }
示例#13
0
 public MedicoHelper(Pesquisar pesquisar)
 {
     this.contextoPesquisa = pesquisar;
 }
示例#14
0
        /// <summary>
        /// funcao - carrega os menus
        /// </summary>
        /// <param name="filtrar"></param>
        /// <param name="pesquisar"></param>
        public static void CarregarMenus(Filtrar filtrar,
                                         Pesquisar pesquisar)
        {
            if (_connection.State != ConnectionState.Closed)
            {
                _connection.Close();
                _connection.Dispose();
            }
            try
            {
                ArrayList.Clear();
                using (_connection = new MySqlConnection(MainWindow.Interface.ConnectionString))
                {
                    _connection.Open();
                    var comandosql = @"SELECT `MOD.TIPO`," +
                                     "`MOD.NOME`," +
                                     "`MOD.DESCRICAO`," +
                                     "`MOD.PRIVILEGIO`" +
                                     "FROM   `v101_tab_modulo`";
                    switch (filtrar)
                    {
                    case Filtrar.Todos:
                        if (LikeByText != string.Empty)
                        {
                            switch (pesquisar)
                            {
                            case Pesquisar.Modulo:
                                comandosql = string.Concat(comandosql,
                                                           " WHERE `MOD.NOME` LIKE '%" + LikeByText + "%'");
                                break;

                            case Pesquisar.Descricao:
                                comandosql = string.Concat(comandosql,
                                                           " WHERE `MOD.DESCRICAO` LIKE '%" + LikeByText + "%'");
                                break;

                            case Pesquisar.Privilegio:
                                comandosql = string.Concat(comandosql,
                                                           " WHERE `MOD.PRIVILEGIO` LIKE '%" + LikeByText + "%'");
                                break;
                            }
                        }
                        break;

                    case Filtrar.Aplicacao:
                        comandosql = string.Concat(comandosql,
                                                   " WHERE `MOD.TIPO` = 'APLICACAO'");
                        break;

                    case Filtrar.Modulo:
                        comandosql = string.Concat(comandosql,
                                                   " WHERE `MOD.TIPO` = 'MENU'");
                        break;
                    }
                    switch (pesquisar)
                    {
                    case Pesquisar.Modulo:
                        if (LikeByText != string.Empty && filtrar != Filtrar.Todos)
                        {
                            comandosql = string.Concat(comandosql,
                                                       " AND `MOD.NOME` LIKE '%" + LikeByText + "%'");
                        }
                        break;

                    case Pesquisar.Descricao:
                        if (LikeByText != string.Empty && filtrar != Filtrar.Todos)
                        {
                            comandosql = string.Concat(comandosql,
                                                       " AND `MOD.DESCRICAO` LIKE '%" + LikeByText + "%'");
                        }
                        break;

                    case Pesquisar.Privilegio:
                        if (LikeByText != string.Empty && filtrar != Filtrar.Todos)
                        {
                            comandosql = string.Concat(comandosql,
                                                       " AND `MOD.PRIVILEGIO` LIKE '%" + LikeByText + "%'");
                        }
                        break;
                    }
                    using (MySqlCommand command = new MySqlCommand(comandosql, _connection))
                    {
                        MySqlDataReader sqlDataReader = command.ExecuteReader();
                        while (sqlDataReader.Read())
                        {
                            if (sqlDataReader.GetString(1) != @"MNU000")
                            {
                                var t = new UiMenu()
                                {
                                    Tipo       = sqlDataReader.GetString(0),
                                    Modulo     = sqlDataReader.GetString(1),
                                    Descricao  = sqlDataReader.GetString(2),
                                    Privilegio = sqlDataReader.GetString(3)
                                };
                                ArrayList.Add(t);
                            }
                        }
                    }
                }
            }
            catch (MySqlException e)
            {
                Console.WriteLine(e.ToString());
            }
            finally
            {
                if (_connection.State != ConnectionState.Closed)
                {
                    _connection.Close();
                    _connection.Dispose();
                }
            }
        }