private void AdicionarButtonOnClick(object sender, EventArgs e) { ControleTelaMenu.handleOrigem = 0; ControleTelaMenu controleTelaMenu = new ControleTelaMenu(); controleTelaMenu.ControleTela(telaSelecionada); }
private void MenuDataGridViewCellDoubleClick(object sender, DataGridViewCellEventArgs e) { //Passa um handle de origem para abrir o formulário ControleTelaMenu.handleOrigem = BuscarHandleDataGridView(); ControleTelaMenu controleTelaMenu = new ControleTelaMenu(); controleTelaMenu.ControleTela(telaSelecionada); }
private void ControleTelas(String tela) { ControleTelaMenu controleTelaMenu = new ControleTelaMenu(); controleTelaMenu.ControleTela(tela); }
// Esse método é responsável pelos key events, ( precisa dar override no processdialog pois o c# é bugado ) /* protected override bool ProcessDialogKey(Keys keyData) * { * switch (keyData) * { * case Keys.F11: * TN_TECNOLOGIA.EditorSQL.Tela editor = new TN_TECNOLOGIA.EditorSQL.Tela(); * editor.ShowDialog(); * return true; * } * return base.ProcessDialogKey(keyData); * }*/ //Controle do datagridview private void GerenciarMenuDataGridView(String tela) { telaSelecionada = tela; String query = ""; menuDataGridView.DataSource = null; BindingSource Binding = new BindingSource(); ControleTelaMenu controleTelaMenu = new ControleTelaMenu(); //Pessoa if (tela == "Pessoa") { query = " SELECT B.IMAGEM SIT, A.HANDLE NÚMERO, A.RAZAOSOCIAL AS 'RAZÃO SOCIAL', A.APELIDO APELIDO, A.CPFCNPJ AS 'CPF/CNPJ', A.TELEFONE, C.CIDADE, D.SIGLA ESTADO, C.LOGRADOURO" + " FROM PS_PESSOA A" + " INNER JOIN MD_STATUS B ON B.HANDLE = A.STATUS " + " LEFT JOIN PS_PESSOAENDERECO C ON C.HANDLE = (SELECT MAX(HANDLE) FROM PS_PESSOAENDERECO WHERE PESSOA = A.HANDLE)" + " LEFT JOIN MD_ESTADO D ON D.HANDLE = C.ESTADO" + " WHERE 1=1" + " " + FiltroStatus() + "";; Binding.DataSource = connection.DataTable(query); menuDataGridView.DataSource = Binding; menuDataGridView.Columns[0].Width = SITUACAOWIDTH; menuDataGridView.Columns[1].Width = HANDLEWIDTH; menuDataGridView.Columns[2].Width = 300; menuDataGridView.Columns[3].Width = 300; menuDataGridView.Columns[4].Width = 150; menuDataGridView.Columns[5].Width = 130; menuDataGridView.Columns[8].Width = 230; } //Tarefa if (tela == "Tarefa") { query = " SELECT B.IMAGEM SIT, A.HANDLE NÚMERO, F.NOME SITUAÇÃO, E.NOME SEVERIDADE, G.NOME TIPO, A.PRAZO, A.ASSUNTO, C.LOGIN SOLICITANTE, D.LOGIN RESPONSAVEL, A.DATA " + " FROM TR_TAREFA A" + " INNER JOIN MD_STATUS B ON B.HANDLE = A.STATUS" + " INNER JOIN PS_USUARIO C ON C.HANDLE = A.SOLICITANTE" + " INNER JOIN PS_USUARIO D ON D.HANDLE = A.RESPONSAVEL" + " INNER JOIN TR_TAREFASEVERIDADE E ON E.HANDLE = A.SEVERIDADE" + " INNER JOIN TR_TAREFASITUACAO F ON F.HANDLE = A.SITUACAO" + " INNER JOIN TR_TAREFATIPO G ON G.HANDLE = A.TIPO" + " WHERE 1=1" + " " + FiltroStatus() + ""; Binding.DataSource = connection.DataTable(query); menuDataGridView.DataSource = Binding; menuDataGridView.Columns[0].Width = SITUACAOWIDTH; menuDataGridView.Columns[1].Width = HANDLEWIDTH; menuDataGridView.Columns[2].Width = 120; menuDataGridView.Columns[3].Width = 120; menuDataGridView.Columns[4].Width = 150; menuDataGridView.Columns[5].Width = 150; menuDataGridView.Columns[6].Width = 650; menuDataGridView.Columns[7].Width = 120; menuDataGridView.Columns[8].Width = 130; menuDataGridView.Columns[9].Width = 150; } if (tela == "Servidor de Email") { // VIEW.TN_EMAIL.IServidorEmail servidor = new VIEW.TN_EMAIL.IServidorEmail(1); // servidor.ShowDialog(); } //Cep if (tela == "Cep") { query = " SELECT B.IMAGEM SIT, A.HANDLE AS NÚMERO, A.CEP, A.PAIS, A.ESTADO, A.CIDADE, A.BAIRRO, A.LOGRADOURO" + " FROM MD_CEP A" + " INNER JOIN MD_STATUS B ON B.HANDLE = A.STATUS" + " WHERE 1=1" + " " + FiltroStatus(); Binding.DataSource = connection.DataTable(query); menuDataGridView.DataSource = Binding; menuDataGridView.Columns[0].Width = SITUACAOWIDTH; menuDataGridView.Columns[1].Width = HANDLEWIDTH; menuDataGridView.Columns[2].Width = 150; menuDataGridView.Columns[3].Width = 150; menuDataGridView.Columns[4].Width = 150; menuDataGridView.Columns[5].Width = 200; menuDataGridView.Columns[7].Width = 300; } }