private void BtnAgregar_Click(object sender, EventArgs e) { try { if (TxtCc.Text != "" && TxtNombre.Text != "" && TxtDescripcion.Text != "" && TxtCantidad.Text != "" && TxtValor.Text != "" && PbArma.ImageLocation != null) { Cliente cliente = new Cliente(); cliente.Guardar(TxtCc.Text, TxtNombre.Text, TxtDescripcion.Text, TxtCantidad.Text, TxtValor.Text, PbArma.ImageLocation); MessageBox.Show("Producto Agregado Correctamente"); TxtCc.Clear(); TxtNombre.Clear(); TxtDescripcion.Clear(); TxtCantidad.Clear(); TxtValor.Clear(); PbArma.ImageLocation = null; } else { if (PbArma.ImageLocation != null) { MessageBox.Show("Todos los Campos deben ser llenados para poder agregar un producto"); } else { MessageBox.Show("Todos los Campos deben ser llenados para poder agregar un producto y La imagen debe ser cargada"); } } } catch (Exception ex) { MessageBox.Show("Error: " + ex); } }
private void BtnQuitar_Click(object sender, EventArgs e) { String Cla = TxtCc.Text; Cliente cliente = new Armeria.Cliente(); if (cliente.bajaCliente(Cla, 2)) { MessageBox.Show("Producto Eliminado Correctamente"); } else { MessageBox.Show("Producto Eliminado Correctamente"); } TxtCc.Clear(); TxtNombre.Clear(); TxtDescripcion.Clear(); TxtCantidad.Clear(); TxtValor.Clear(); PbArma.ImageLocation = null; //ArchivoTexto archivotexto = new ArchivoTexto(); //archivotexto.Leer(2); //ArchivoBinario archivobinario = new ArchivoBinario(); //archivobinario.Leer(2); }
private void BtnLimpiar_Click(object sender, EventArgs e) { TxtDias.Clear(); TxtSal.Clear(); TxtValor.Clear(); TxtDias.Focus(); }
private void Reset() { TxtValor.Clear(); BtnAlterar.Enabled = false; BtnExcluir.Enabled = false; BtnGravar.Enabled = true; }
private void TxtDescripcion_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { TxtValor.Focus(); } }
private void BtnEditar_Click(object sender, EventArgs e) { if (TxtNome.Text.ToString().Trim() == "") { TxtNome.Text = ""; MessageBox.Show("Preencha o Nome!", "Campo Vazio", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtNome.Focus(); return; } if (TxtValor.Text == "") { MessageBox.Show("Preencha o Valor!", "Campo Vazio", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtValor.Focus(); return; } //CÓDIGO DO BOTÃO EDITAR MessageBox.Show("Registro Editado com Sucesso!", "Dados Salvos", MessageBoxButtons.OK, MessageBoxIcon.Information); BtnNovo.Enabled = true; BtnEditar.Enabled = false; BtnExcluir.Enabled = false; LimparCampos(); DesabilitarCampos(); }
private void BtnCalcular_Click(object sender, EventArgs e) { if (TxtHrxt.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtHrxt.Focus(); return; } if (TxtValor.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtValor.Focus(); return; } double hrxt, valor, sal; hrxt = Convert.ToDouble(TxtHrxt.Text); valor = Convert.ToDouble(TxtValor.Text); sal = hrxt * valor; TxtSal.Text = sal.ToString(); }
private void CmbTipoDePagameto_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (TxtValor != null) { TxtValor.Text = (_mvvm.ValorTotalDaVenda - _mvvm.ValorTotalDePagamento).ToString("0.00"); TxtValor?.Focus(); } }
private void Pagamentos_OnLoaded(object sender, RoutedEventArgs e) { if (TxtValor != null) { TxtValor.Text = _mvvm.ValorTotalDaVenda.ToString("#.00"); TxtValor.Focus(); } }
protected void Func_CancelarOperacion() { TxtPropietario.Clear(); TxtCuenta.Clear(); Func_ConsultarTipoTransaccion(); TxtValor.Clear(); TxtCuenta.Focus(); }
private void FrmSangriaSuprimento_Load(object sender, EventArgs e) { LblNomeMov.Text = this.Text; Controle.Conexao = FrmFrenteLoja.FrmPrincipal.Conexao; MvCaixa.Controle = Controle; TxtDtCaixa.Value = DateTime.Now; TxtUsuario.Text = FrmFrenteLoja.FrmPrincipal.Perfil_Usuario.Usuario; LstTipoDoc = FrmFrenteLoja.FrmPrincipal.PopularCombo("SELECT ID_Documento,Documento FROM TipoDocumento ORDER BY Documento", LstTipoDoc, ""); TxtValor.Focus(); }
private void TxtValor_TextChanged(object sender, EventArgs e) { validador = new Validador(); try { TxtValor.Text = validador.Valor(TxtValor.Text); TxtValor.Select(TxtValor.Text.Length, 0); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void BtnActualizar_Click(object sender, EventArgs e) { try { Cliente cliente = new Cliente(); if (TxtCc.Text != "" && TxtNombre.Text != "" && TxtDescripcion.Text != "" && TxtCantidad.Text != "" && TxtValor.Text != "" && PbArma.ImageLocation != null) { String Cla = TxtCc.Text; String datos = cliente.consultaCliente(Cla, 2); if (datos != null) { string[] campos = datos.Split('|'); campos[0] = TxtCc.Text; campos[1] = TxtNombre.Text; campos[2] = TxtDescripcion.Text; campos[3] = TxtCantidad.Text; campos[4] = TxtValor.Text; campos[5] = PbArma.ImageLocation; cliente.bajaCliente(Cla, 2); cliente.Guardar(campos[0], campos[1], campos[2], campos[3], campos[4], campos[5]); MessageBox.Show("Datos Modificados Correctamente"); TxtCc.Clear(); TxtNombre.Clear(); TxtDescripcion.Clear(); TxtCantidad.Clear(); TxtValor.Clear(); PbArma.ImageLocation = null; } else { MessageBox.Show("Dato no encontrado"); } } else { if (PbArma.ImageLocation != null) { MessageBox.Show("Todos los Campos deben ser llenados para poder Modificar un cliente"); } else { MessageBox.Show("Todos los Campos deben ser llenados para poder Modificar un cliente y La imagen debe ser cargada"); } } } catch (Exception ex) { MessageBox.Show("Error: " + ex); } }
protected void Func_BuscarPropietario() { ClsTransacciones ObjBuscar = new ClsTransacciones(); ObjBuscar.cuenta = TxtCuenta.Text; ObjBuscar.Func_BuscarCuenta(); if (ObjBuscar.sw == 1) { TxtPropietario.Text = ObjBuscar.propietario; TxtCuenta.Enabled = false; TxtValor.Focus(); } else { MessageBox.Show("No se encontro registro de la cuenta " + TxtCuenta.Text + "\nPosiblemente su cuenta no existe o se encuentra Inactiva\nConsulte con su Asesor", "Validación de información", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtCuenta.Focus(); } }
private void BtnConfirmar_Click(object sender, EventArgs e) { if (TxtValor.Value <= 0) { MessageBox.Show("Favor verifique o valor do movimento", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtValor.Focus(); return; } if (int.Parse(LstTipoDoc.SelectedValue.ToString()) == 0) { MessageBox.Show("Favor informar o Documento", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Error); LstTipoDoc.Focus(); return; } if (MessageBox.Show("Confirma o Movimento ?", "Confirmação", MessageBoxButtons.YesNo) == DialogResult.Yes) { MvCaixa.LerDados(0); if (TpMovim == FrmFrenteLoja.SanGriaSuprimento.Sangria) { MvCaixa.Tipo = 0; MvCaixa.Descricao = "Sangria: " + TxtDescricao.Text.Trim(); } else { MvCaixa.Descricao = "Suprimento: " + TxtDescricao.Text.Trim(); MvCaixa.Tipo = 1; } MvCaixa.Valor = TxtValor.Value; MvCaixa.IdDocumento = int.Parse(LstTipoDoc.SelectedValue.ToString()); MvCaixa.Status = 1; MvCaixa.IdCaixa = FrmFrenteLoja.IdCaixa; MvCaixa.GravarDados(); MessageBox.Show("Operação concluida"); Close(); } }
private void AdicionarPagamento_OnClick(object sender, RoutedEventArgs e) { try { var tipoDePagamento = (TipoPagamento)CmbTipoDePagameto.SelectedItem; if (tipoDePagamento.CodigoTipoPagamento == "0") { MessageBox.Show("Selecione um tipo de pagamento.", InstanceManager.Parametros.TituloDasMensagens, MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } if (!TxtValor.Text.IsNumeric()) { MessageBox.Show("Valor inválido.", InstanceManager.Parametros.TituloDasMensagens, MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } var valor = TxtValor.Text.ToDecimal(); _mvvm.AdicionarVendaPagamento(tipoDePagamento, valor); if (_mvvm.ValorTotalDaVenda <= _mvvm.ValorTotalDePagamento) { BtnOk.Focus(); } else { TxtValor.Text = (_mvvm.ValorTotalDaVenda - _mvvm.ValorTotalDePagamento).ToString("#.00"); TxtValor.Focus(); } }catch (Exception ex) { MessageBox.Show(string.Concat("Falha ao Adicionar Pagamento. Entre em contato com o Administrador.\nErro: ", ex.Message), InstanceManager.Parametros.TituloDasMensagens, MessageBoxButton.OK, MessageBoxImage.Error); } }
private void BtnDebito_Click(object sender, EventArgs e) { decimal decValor = 0; bool blnSucesso = true; if (!string.IsNullOrEmpty(TxtValor.Text)) { blnSucesso = decimal.TryParse(TxtValor.Text, out decValor); if (blnSucesso) { TxtSaldo.Text = CreditoDebito(decValor, 'D'); } else { OnLogStatus("Valor INCORRETO: " + TxtValor.Text); } } else { MessageBox.Show("Por favor, digite um Valor.", this.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtValor.Focus(); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { TxtValor.Focus(); }
public LancamentoInicialView() { InitializeComponent(); TxtValor.Focus(); RestCommands.DataContext = DataContext; }
private void BtnFinalizar_Click(object sender, EventArgs e) { try { ProdutoNegocio produtoNegocio = new ProdutoNegocio(); if (TxtCodigo.Text != "") { if (TxtNome.Text != "") { if (TxtValor.Text != "") { if (CbxTipo.Text != "") { Produto produto = new Produto(Convert.ToInt32(TxtCodigo.Text), TxtNome.Text, Convert.ToDouble(TxtValor.Text), Convert.ToInt32(CbxTipo.SelectedValue)); string mensagem, escolha; if (novo) { mensagem = produtoNegocio.Inserir(produto); escolha = "INSERIR"; } else { mensagem = produtoNegocio.Alterar(produto, Convert.ToInt32(DgvProduto.Rows[DgvProduto.CurrentRow.Index].Cells[0].Value)); escolha = "ALTERAR"; } if (mensagem != "0") { MessageBox.Show("Não foi possível " + escolha + " o Produto.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { CarregaTodosProdutos(); FinalizarCadastro(); LimpaCampos(); CarregaQtdeProduto(); } } else { MessageBox.Show("Cadastre um Tipo de Produto clicando no botão de '+'", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Digite o valor do produto no campo 'Valor'", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtValor.Focus(); } } else { MessageBox.Show("Digite o nome do produto no campo 'Nome'", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtNome.Focus(); } } else { MessageBox.Show("Digite o código do produto no campo 'Código'", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtCodigo.Focus(); } } catch (Exception ex) { MessageBox.Show("Houve um erro para finalizar o cadastro.\nAviso: " + ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void TxtValor_TextChanged(object sender, EventArgs e) { validarNumero = new ValidarNumero(); TxtValor.Text = validarNumero.Validar(TxtValor.Text); TxtValor.Select(TxtValor.Text.Length, 0); }