protected void btnCadastroOng_Click(object sender, EventArgs e) { try { string nome = txtNomeOng.Text, email = txtEmailOng.Text, senha = txtSenhaOng.Text, razaoSocial = txtRazaoSocial.Text, cnpj = txtCNPJ.Text, telefone = txtTelefone.Text, representante = txtRepresentante.Text, cargo = txtCargo.Text, cep = txtCEPOng.Text, numero = txtNumeroOng.Text, bairro = txtBairroOng.Text, endereco = txtEnderecoOng.Text, cidade = txtCidadeOng.Text, estado = ddlEstadoOng.SelectedValue; Verificadores.VerificaParametrosOngs(ref nome, ref email, ref senha, ref razaoSocial, ref cnpj, ref telefone, ref representante, ref cargo, ref cep, ref numero, ref bairro, ref endereco, ref cidade, ref estado, false); EntidadesProjetoPI bd = new EntidadesProjetoPI(); bd.setOngs(nome, email, senha, razaoSocial, cnpj, telefone, representante, cargo, cep, numero, bairro, endereco, cidade, estado); } catch (Exception ex) { lblErros.Text = ex.Message; lblErros.Visible = true; } }
public Configuracoes() { InitializeComponent(); CarregarConfiguracoes(); gpbBancoDados.Enabled = UserInfo.UserNowInstance.tipoUsuario == TipoUsuario.ADM; rabOneDrive.Visible = Verificadores.IsWin10(); }
public ListaPesquisa(DataTable data) { InitializeComponent(); dgvLista.DataSource = data; try { PrivateFontCollection privateFont = new(); privateFont.AddFontFile(Application.StartupPath + @"font\Lato-Bold.ttf"); Font lato = new(privateFont.Families[0], 8, FontStyle.Bold); int columnQuantidade = dgvLista.ColumnCount; for (int i = 0; i < columnQuantidade; i++) { dgvLista.Columns[i].DefaultCellStyle.Font = lato; } } catch { MessageBox.Show(Resources.FaltaArquivoEscenciaisParaContinuar, Resources.MessageBoxError, MessageBoxButtons.OK, MessageBoxIcon.Error); Process.GetCurrentProcess().Kill(); } #region MenuClick mnuImprimirLista.Click += async(sender, e) => { pgbAsyncTask.Visible = true; if (!Verificadores.VerificarDataGrid(dgvLista)) { Imprimir imprimir = new(); await imprimir.ImprimirModelo(dgvLista); } pgbAsyncTask.Visible = false; }; mnuExportarExcel.Click += async(sender, e) => { pgbAsyncTask.Visible = true; if (!Verificadores.VerificarDataGrid(dgvLista)) { await ExportToSheets(); } pgbAsyncTask.Visible = false; }; #endregion Load += (_, _) => AppInsightMetrics.TrackForm("Lista"); }
private void btnEntrarLogin_Click(object sender, EventArgs e) { string usuario = txtLoginUsuario.Text.Trim(); string senha = txtLoginSenha.Text.Trim(); //THE PASSWORD IS NOT VERIFIED if (Verificadores.VerificarStrings(usuario, senha)) { MessageBox.Show("Preencha os campos para continuar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } AppConfigurationManger.configManager.userSection = AppConfigurationManger.configManager.userSection with { userName = usuario, userType = UserType.USU }; AppConfigurationManger.SaveConfig(); AppManager.RestartProgram(); }
private void rabOneDrive_CheckedChanged(object sender, EventArgs e) { lblInfoTxt.Visible = false; btnSelecionarArquivoDb.Visible = false; txtStringConexaoCaminhoDb.Visible = false; DirectoryInfo directoryInfo = string.IsNullOrEmpty(AppConfigurationManager.pastaDb) ? null : Directory.GetParent(AppConfigurationManager.pastaDb); if (directoryInfo == null && directoryInfo.Parent == null) { MessageBox.Show(Resources.ConexaoLocalMigrarOneDrive, Resources.MessageBoxError, MessageBoxButtons.OK, MessageBoxIcon.Error); rabSqlServerLocalDb.Checked = true; return; } if (Verificadores.HasSyncOneDrive(directoryInfo)) { lblInfoTxt.Visible = true; lblInfoTxt.Text = Resources.BancoSincronizadoOneDrive; lblInfoTxt.ForeColor = Color.Green; } }
private void btnPesquisarExcluirUsuario_Click(object sender, EventArgs e) { UsuarioDb usuarioDb = new(); DataTable infoUsuario = usuarioDb.BuscarUsuarioId(txtCodigoDeletarUsuario.Text); if (Verificadores.VerificarDataTable(infoUsuario)) { MessageBox.Show(Resources.PreecherCampoBusca, Resources.MessageBoxError, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } DialogResult dialogResult = MessageBox.Show(string.Format(Resources.ConfirmarExclusao1, infoUsuario.Rows[0][1]), Resources.MessageBoxError, MessageBoxButtons.YesNo, MessageBoxIcon.Stop); if (dialogResult == DialogResult.No) { return; } usuarioDb.DeletarUsuarioId(txtCodigoDeletarUsuario.Text); LimparCampos(); }
protected void btnCadastraDoador_Click(object sender, EventArgs e) { try { string nome = txtNomeDoador.Text, email = txtEmailDoador.Text, senha = txtSenhaDoador.Text, cpf = txtCPF.Text, cep = txtCEPDoador.Text, numero = txtNumeroDoador.Text, bairro = txtBairroDoador.Text, endereco = txtEnderecoDoador.Text, cidade = txtCidadeDoador.Text, estado = ddlEstadoDoador.SelectedValue; Verificadores.ValidaParametrosDoadores(ref nome, ref email, ref senha, ref cpf, ref cep, ref numero, ref bairro, ref endereco, ref cidade, ref estado, false); EntidadesProjetoPI bd = new EntidadesProjetoPI(); bd.setDoadores(nome, email, senha, cpf, cep, numero, bairro, endereco, cidade, estado); } catch (Exception ex) { lblErros.Text = ex.Message; lblErros.Visible = true; } }
protected void btnEditaCadastro_Click(object sender, EventArgs e) { try { if (ong != null)//se for ong { string nome = txtNome.Text, email = txtEmail.Text, senha = txtSenha.Text, razaoSocial = txtRazaoSocial.Text, cnpj = txtCNPJ.Text, telefone = txtTelefone.Text, representante = txtRepresentante.Text, cargo = txtCargo.Text, cep = txtCEP.Text, numero = txtNumero.Text, bairro = txtBairro.Text, rua = txtEndereco.Text, cidade = txtCidade.Text, estado = ddlEstado.SelectedValue; Verificadores.VerificaParametrosOngs(ref nome, ref email, ref senha, ref razaoSocial, ref cnpj, ref telefone, ref representante, ref cargo, ref cep, ref numero, ref bairro, ref rua, ref cidade, ref estado, true); EnderecoOngValido(cep, numero, rua, bairro, cidade, estado); ong.nome = nome; ong.email = email; ong.senha = senha; ong.razaoSocial = razaoSocial; ong.cnpj = cnpj; ong.telefone = telefone; ong.representante = representante; ong.cargo = cargo; SalvaModificacoes(ong); } else { string nome = txtNome.Text, email = txtEmail.Text, senha = txtSenha.Text, cpf = txtCPF.Text, cep = txtCEP.Text, numero = txtNumero.Text, bairro = txtBairro.Text, rua = txtEndereco.Text, cidade = txtCidade.Text, estado = ddlEstado.SelectedValue; Verificadores.ValidaParametrosDoadores(ref nome, ref email, ref senha, ref cpf, ref cep, ref numero, ref bairro, ref rua, ref cidade, ref estado, true); doador.nome = nome; doador.email = email; doador.senha = senha; doador.cpf = cpf; doador.Enderecos.cep = cep; doador.Enderecos.numero = numero; doador.Enderecos.bairro = bairro; doador.Enderecos.rua = rua; doador.Enderecos.cidade = cidade; doador.Enderecos.estado = estado; SalvaModificacoes(doador); } } catch (Exception ex) { lblErro.Text = ex.Message; } }