protected async void btnModificar_Click(object sender, EventArgs e) { if (ValidarModificar()) { Models.Gerente gerenteModificado = new Models.Gerente(); Models.Gerente gerente = new Models.Gerente() { GER_CODIGO = Int32.Parse(TextBox_codigo.Text), GER_NOMBRE = TextBox_nombre.Text, GER_APELLIDO1 = TextBox_primerApellido.Text, GER_APELLIDO2 = TextBox_segundoApellido.Text, GER_DIRECCION = TextBox_direccion.Text, GER_TELEFONO = TextBox_telefono.Text }; gerenteModificado = await gerentesManager.Actualizar(gerente, VG.usuarioActual.CadenaToken); if (gerenteModificado != null) { MensajeEstado("Registro modificado con exito", false, true); InicializarControles(); } else { MensajeEstado("Hubo un error al intentar modificar el registro", true, true); } } }
protected async void btnAgregar_Click(object sender, EventArgs e) { if (ValidarInsertar()) { Models.Gerente gerenteAgregado = new Models.Gerente(); Models.Gerente gerente = new Models.Gerente() { GER_NOMBRE = TextBox_nombre.Text, GER_APELLIDO1 = TextBox_primerApellido.Text, GER_APELLIDO2 = TextBox_segundoApellido.Text, GER_DIRECCION = TextBox_direccion.Text, GER_TELEFONO = TextBox_telefono.Text }; gerenteAgregado = await gerentesManager.Ingresar(gerente, VG.usuarioActual.CadenaToken); if (gerenteAgregado != null) { MensajeEstado("Registro guardado con exito", false, true); InicializarControles(); } else { MensajeEstado("Ha habido un error al guardar el registro", true, true); } } }
private void getValues() { Models.Gerente gerente = new Models.Gerente(); gerente.CPF1 = Convert.ToInt64(lblCPF.Text); gerente.getAllData(); lblTaxaJuros.Text = Convert.ToString(gerente.TaxaJuros1) + "%"; }
private void btnAplicarJuros_Click(object sender, EventArgs e) { long CPF = Convert.ToInt64(lblCPF.Text); Models.Gerente gerente = new Models.Gerente(); gerente.CPF1 = CPF; gerente.aplicaJuros(); }
private void btnAlterarTaxa_Click(object sender, EventArgs e) { Models.Gerente gerente = new Models.Gerente(); gerente.CPF1 = Convert.ToInt64(lblCPF.Text); gerente.TaxaJuros1 = Convert.ToDouble(txbNovoJuros.Text); gerente.alteraRendimento(); getValues(); }
private void btnLogin_Click(object sender, EventArgs e) { Models.Gerente gerente = new Models.Gerente(); gerente.CPF1 = Convert.ToInt64(txbCPF.Text); gerente.Senha1 = txbSenha.Text; if (gerente.loginGerente() != false) { this.Hide(); gerente.getAllData(); Forms.GerenteForm gerenteForm = new Forms.GerenteForm(gerente.Nome1, gerente.TaxaJuros1, gerente.CPF1); gerenteForm.ShowDialog(); } else { MessageBox.Show("Email ou senha incorreto", "Erro ao autenticar", MessageBoxButtons.OK, MessageBoxIcon.Warning); clearFields(); } }