//--------------------------------------------------------------------------- public string ConsultaCampoDesc(ArrayList Campos, string sTextoSql, string sMensagemErro) { OleDbCommand Consulta = gConexao.CreateCommand(); Consulta.CommandText = sTextoSql; Campos.Clear(); OleDbDataReader Leitor = Consulta.ExecuteReader(); if (Leitor.Read()) { for (int cont = 0; cont < Leitor.FieldCount; cont++) { Campos.Add(Leitor.GetValue(cont).ToString()); } } bool nTemLinhas = Leitor.HasRows; Leitor.Close(); if (nTemLinhas) { return(Campos[1].ToString()); } else { MessageDialog.MessageBox(sMensagemErro, "Erro", Dialog.wxOK | Dialog.wxICON_ERROR); return(""); } }
public void OnBtnLoginClick(object sender, Event e) { OleDbCommand Consulta = new OleDbCommand(); RotinasGlobais.Rotinas.sUsuarioLogin = edtLogin.Value; RotinasGlobais.Rotinas.sUsuarioSenha = edtSenha.Value; if (RotinasGlobais.Rotinas.ConsultaDados(Consulta, ConsultasSQL.ConsSQL.Usuario('S', RotinasGlobais.Rotinas.sUsuarioLogin, RotinasGlobais.Rotinas.sUsuarioSenha))) { RotinasGlobais.Rotinas.sBarraLogin = Resource.STR_USUARIO + RotinasGlobais.Rotinas.sUsuarioLogin; frmPrincipal.fPrincipal.SetStatusText(RotinasGlobais.Rotinas.sBarraLogin, 0); bFechar = true; this.Close(true); frmPrincipal.fPrincipal.Show(true); } else { MessageDialog.MessageBox(Resource.STR_LOGSENINC, "Erro", Dialog.wxOK | Dialog.wxICON_ERROR); } e.Skip(); }
//--------------------------------------------------------------------------- public Boolean ValidaCampo(string sCampo, string sMensagemErro) { if (sCampo == "") { MessageDialog.MessageBox(sMensagemErro, "Erro", Dialog.wxOK | Dialog.wxICON_ERROR); return(true); } else { return(false); } }
protected void PesquisarDados(string sTextoSql, string sMensagemErro, int nQtdCol) { if (RotinasGlobais.Rotinas.ConsultaDadosLista(Registros, sTextoSql)) { RotinasGlobais.Rotinas.AdicionaLinhasGrid(gridConsulta, Registros, nQtdCol); } else { MessageDialog.MessageBox(sMensagemErro, "Erro", wx.Dialog.wxOK | wx.Dialog.wxICON_ERROR); } }
//--------------------------------------------------------------------------- public bool ConectaBanco(string sFonteDeDados) { gConexao.ConnectionString = sFonteDeDados; gConexao.Open(); if (gConexao.State.ToString().Equals("Open")) { return(true); } else { MessageDialog.MessageBox(Resource.STR_NCONBANCO, "Erro", Dialog.wxOK | Dialog.wxICON_ERROR); return(false); } }
public void OnBtnSalvarClick(object sender, Event e) { OleDbCommand Arquiva = new OleDbCommand(); if (ValidaDados()) { if (RotinasGlobais.Rotinas.AtualizaDados(Arquiva, ConsultasSQL.ConsSQL.Usuario('U', edtLogin.Value, edtConfirmarSenha.Value))) { MessageDialog.MessageBox(Resource.STR_SENALTSUC, "Erro", Dialog.wxOK | Dialog.wxICON_ERROR); } } e.Skip(); }
//--------------------------------------------------------------------------- public Boolean ValidaFloat(string sNum) { if (sNum != "") { try { float.Parse(sNum); return(true); } catch { MessageDialog.MessageBox(Resource.STR_NUMINV, "Erro", Dialog.wxOK | Dialog.wxICON_ERROR); return(false); } } else { return(false); } }
public bool ValidaDados() { if (edtSenhaAtual.Value != RotinasGlobais.Rotinas.sUsuarioSenha) { MessageDialog.MessageBox(Resource.STR_SENNCSU, "Erro", Dialog.wxOK | Dialog.wxICON_ERROR); return(false); } if (RotinasGlobais.Rotinas.ValidaCampo(edtNovaSenha.Value, Resource.STR_NSENNINF)) { return(false); } if (edtNovaSenha.Value != edtConfirmarSenha.Value) { MessageDialog.MessageBox(Resource.STR_NSENNCCON, "Erro", Dialog.wxOK | Dialog.wxICON_ERROR); return(false); } return(true); }
//--------------------------------------------------------------------- public void OnAbout(object sender, Event e) { MessageDialog.MessageBox("List test sample\nJulian Smart (c) 1997\nPorted to wx.NET by Alexander Olk\nVirtual lists by Harald Meyer auf'm Hofe", "About", wx.WindowStyles.DIALOG_OK | wx.WindowStyles.ICON_INFORMATION); }