private void BtnEliminar_Click(object sender, EventArgs e) { Producto oProducto = oProductosDAO.Buscar(TxtCodigo.Text.Trim()); try { if (TxtCodigo.Text == "" || TxtDescripcion.Text == "" || TxtPrecioCompra.Text == "" || TxtPrecioVenta.Text == "" || TxtStock.Text == "") { MessageBox.Show("Los campos estan vacios", "llene los campos", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (oProductosDAO.Eliminar(oProducto) == false) { MessageBox.Show("El registro no puede ser eliminado", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { MessageBox.Show("El registro eliminado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); LimpiarControles(); //DesactivaControles(true); TxtCodigo.Text = ""; TxtCodigo.Focus(); return; } } } catch (Exception ex) { MessageBox.Show("Hola exepcion", ex.Message); throw; } }
protected override void Modificar() { base.Modificar(); btnBuscar.Visible = true; TxtCodigo.Enabled = true; TxtCodigo.Focus(); }
private void HabilitaCampos() { BtnAdicionar.Visible = false; TxtCodigo.Enabled = true; TxtNome.Enabled = true; TxtDono.Enabled = true; MtbCep.Enabled = true; TxtRua.Enabled = true; TxtNumero.Enabled = true; TxtBairro.Enabled = true; TxtCidade.Enabled = true; CbxUf.Enabled = true; TxtTelu.Enabled = true; TxtTeld.Enabled = true; BtnCancelar.Visible = true; BtnConfirmar.Visible = true; BtnEditar.Visible = false; BtnExcluir.Visible = false; DgvEmpresa.Enabled = false; TxtCodigo.Focus(); }
private void TxtCodigo_KeyUp(object sender, KeyEventArgs e) { string CodigoDeBarra = TxtCodigo.Text; if (CodigoDeBarra.Length > 2) { if (CodigoDeBarra.Length == 26 & CodigoDeBarra.Substring(0, 2) == "73")//es vale de consumo { //descomponer el codigo string Numvale; DateTime FechaEmision; decimal Monto; Numvale = CodigoDeBarra.Substring(3, 10); FechaEmision = Convert.ToDateTime(CodigoDeBarra.Substring(13, 2) + "/" + CodigoDeBarra.Substring(15, 2) + "/" + CodigoDeBarra.Substring(17, 2)); Monto = Convert.ToDecimal(CodigoDeBarra.Substring(19)) / 100; //mostrar en las cajitas TxtNumValeConsumo.Text = Numvale; DtpFechaEmision.Value = FechaEmision; TxtMonto.Text = Monto.ToString(); AgregarDetalle(Numvale, FechaEmision, Monto); TxtCodigo.Text = ""; TxtCodigo.Focus(); } } }
private void LimpaCampos() { TxtCodigo.Text = ""; TxtNome.Text = ""; TxtValor.Text = ""; TxtCodigo.Focus(); }
private void BtnAdicionar_Click(object sender, EventArgs e) { TxtPesquisa.Text = ""; IniciarCadastro(); TxtCodigo.Focus(); novo = true; }
protected override void AbrirDesactivar() { base.AbrirDesactivar(); btnBuscar.Visible = true; TxtCodigo.Enabled = true; TxtCodigo.Focus(); }
protected void BtnSalvar_Click(object sender, EventArgs e) { try { if (TxtCodigo.Text.Trim().Equals(String.Empty)) { TxtCodigo.Text = ""; TxtCodigo.Focus(); throw new CampoNaoInformadoException("Índice Financeiro", "Código", true); } if (TxtPeriodicidade.Text.Trim().Equals(String.Empty)) { TxtPeriodicidade.Text = ""; TxtPeriodicidade.Focus(); throw new CampoNaoInformadoException("Índice Financeiro", "Periodicidade", true); } if (TxtValor.Text.Trim().Equals(String.Empty)) { TxtPeriodicidade.Text = ""; TxtPeriodicidade.Focus(); throw new CampoNaoInformadoException("Índice Financeiro", "Valor", true); } if (TxtDataReferencia.Text.Trim().Equals(String.Empty)) { TxtPeriodicidade.Text = ""; TxtPeriodicidade.Focus(); throw new CampoNaoInformadoException("Índice Financeiro", "Data de Referência", true); } IndiceFinanceiro lIndiceFinanceiro = null; IndiceFinanceiroValor lIndiceFinanceiroValor = new IndiceFinanceiroValor(); string mensagem = ""; if (Request.QueryString["id"] != null) { lIndiceFinanceiro = IndiceFinanceiroBLL.Instance.BuscarPorId(Convert.ToInt32(Request.QueryString["id"])); mensagem = "Índice financeiro alterado com sucesso."; } else { lIndiceFinanceiro = new IndiceFinanceiro(); mensagem = "Índice financeiro cadastrado com sucesso."; } lIndiceFinanceiro.Codigo = TxtCodigo.Text.Trim(); lIndiceFinanceiro.Periodicidade = TxtPeriodicidade.Text.ToCharArray()[0]; lIndiceFinanceiroValor.DataReferencia = DateTime.Parse(TxtDataReferencia.Text); lIndiceFinanceiroValor.Valor = float.Parse(TxtValor.Text); if (lIndiceFinanceiro.Valores == null) { lIndiceFinanceiro.Valores = new List <IndiceFinanceiroValor>(); } lIndiceFinanceiro.Valores.Add(lIndiceFinanceiroValor); IndiceFinanceiroBLL.Instance.Persistir(lIndiceFinanceiro); Web.ExibeAlerta(Page, mensagem, "Listar.aspx"); } catch (BusinessException ex) { Web.ExibeAlerta(Page, ex.Message); } }
private void LimparComponentes() { TxtCodigo.Text = String.Empty; TxtEndereco.Text = String.Empty; TxtNome.Text = String.Empty; TxtTelefone.Text = String.Empty; TxtCodigo.Focus(); }
protected override void AbrirActivar() { base.AbrirActivar(); btnBuscar.Visible = true; TxtCodigo.Enabled = true; TxtCodigo.Focus(); TxtCodigo._MostrarRegDesactivo = TxtCodigo._MostrarRegActivo = true; }
protected override void Consultar() { base.Consultar(); btnBuscar.Visible = true; btnBuscar.Enabled = TxtCodigo.Enabled = true; TxtCodigo.Focus(); TxtCodigo._IgnorarNulo = true; }
private void Limpiar() { TxtCodigo.Text = ""; TxtClave.Text = ""; CmbNivel.SelectedValue = 1; RdbActivo.Checked = true; RdbInactivo.Checked = false; TxtCodigo.Focus(); }
private void TxtCodigo_TextChanged(object sender, EventArgs e) { if (TxtCodigo.Text.Trim().Length > 0) { POO.AlertNotNumber(TxtCodigo.Text.Trim()); TxtCodigo.Focus(); return; } }
private void BtnNovo_Click(object sender, EventArgs e) { StaFormEdicao = true; Paginas.SelectTab(1); LimpaDados(); FrmPrincipal.ControleBotoes(true); TxtCodigo.Text = "0"; Genero.IncReg = true; TxtCodigo.Focus(); }
void Modificar() { _OpcionSQL = "Modificar"; _ActivateParameter = "="; EnableButtons(false); LblFunctionName.Text = "Modificando..."; Funciones_Duke4.Funciones.Fun_Habilitar_Control_Objetos(array, true); CodigoySearch(true); TxtCodigo.Focus(); }
private void BtnDesactivar_Click(object sender, EventArgs e) { EnableButtons(false); _OpcionSQL = "Desactivar"; LblFunctionName.Text = "Desactivando..."; _ActivateParameter = "="; Funciones_Duke4.Funciones.Fun_Habilitar_Control_Objetos(array, false); CodigoySearch(true); TxtCodigo.Focus(); }
private void BtnNuevo_Click(object sender, EventArgs e) { TxtCodigo.Text = ""; TxtCodigo.Text = ""; TxtDescripcion.Text = ""; TxtPrecio.Text = ""; LbTotal.Text = "RD$ 0"; dataGridView1.Rows.Clear(); Cont_fila = 0; Total = 0; TxtCodigo.Focus(); }
private void BtnConfirmar_Click(object sender, EventArgs e) { try { if (TxtCodigo.Text != "" && TxtDono.Text != "") { string mensagem; EmpresaNegocio enderecoNegocio = new EmpresaNegocio(); Empresa empresa = new Empresa(Convert.ToInt32(TxtCodigo.Text), TxtNome.Text.Trim().ToUpper(), TxtDono.Text.Trim().ToUpper(), TxtRua.Text, TxtNumero.Text, TxtBairro.Text, TxtCidade.Text, CbxUf.Text, MtbCep.Text.Replace("-", ""), TxtTelu.Text.Replace(" ", ""), TxtTeld.Text.Replace(" ", "")); if (novo) { //Novo Cadastro mensagem = enderecoNegocio.Inserir(empresa).ToString(); } else { //Edita Cadastro mensagem = enderecoNegocio.Alterar(empresa, Convert.ToInt32(DgvEmpresa.Rows[DgvEmpresa.CurrentRow.Index].Cells[0].Value)); } if (mensagem == "0") { DesabilitarCampos(); LimpaCampos(); CarregaGridEmpresa(); novo = false; } else { MessageBox.Show("Não foi possível excluir a Empresa do Sistema", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { if (TxtCodigo.Text == "") { MessageBox.Show("Digite um Código para a Empresa!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtCodigo.Focus(); } else { MessageBox.Show("Digite o Nome da Dono da Empresa", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtDono.Focus(); } } } catch (Exception ex) { MessageBox.Show("Mensagem de erro.\n" + ex.Message, "Não Salvou", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void IniciarCadastro() { GbxCUD.Visible = false; GbxDados.Visible = true; BtnCancelarRetornar.Visible = true; TxtPesquisa.Visible = false; DgvProduto.Enabled = false; TxtCodigo.Focus(); }
private void btnBuscar_Click_1(object sender, EventArgs e) { MainFormConsultaGeneral consulta = new MainFormConsultaGeneral("select idsector as codigo, descripcion from cxcdbfsector where nulo " + _ActivateParameter.ToString() + " 0", "descripcion", "Sector"); if (consulta.ShowDialog(this) == DialogResult.OK) { TxtCodigo.Text = consulta.MainGrid.SelectedRows[0].Cells[0].Value.ToString(); Completar_sector(); if (TxtCodigo.Text != string.Empty) { TxtCodigo.Focus(); } } }
private void BtnAgregar_Click(object sender, EventArgs e) { if (TxtCodigo.Text.Trim().Length == 0) { POO.MsgWarning("El Campo Codigo Es Requerido."); TxtCodigo.Focus(); return; } if (TxtProducto.Text.Trim().Length == 0) { POO.MsgWarning("El Campo Decripción Es Requerido."); TxtProducto.Focus(); return; } if (TxtCantidad.Text.Trim().Length == 0) { POO.MsgWarning("El Campo Cantidad Es Requerido."); TxtCantidad.Focus(); return; } if (TxtPrecioU.Text.Trim().Length == 0) { POO.MsgWarning("El Campo Precio Unitario Es Requerido."); TxtPrecioU.Focus(); return; } DataGridViewRow fila = new DataGridViewRow(); fila.CreateCells(DgvFactura); fila.Cells[0].Value = TxtCodigo.Text.Trim(); fila.Cells[1].Value = TxtProducto.Text.Trim(); fila.Cells[2].Value = TxtCantidad.Text.Trim(); fila.Cells[3].Value = TxtPrecioU.Text.Trim(); double prec, cant; prec = Convert.ToDouble(TxtPrecioU.Text.Trim()); cant = Convert.ToDouble(TxtCantidad.Text.Trim()); fila.Cells[4].Value = POO.precU(prec, cant).ToString(); DgvFactura.Rows.Add(fila); TxtCodigo.Clear(); TxtProducto.Clear(); TxtCantidad.Clear(); TxtPrecioU.Clear(); TxtCodigo.Focus(); }
private void btnBuscar1_Click(object sender, EventArgs e) { MainFormConsultaGeneral consulta = new MainFormConsultaGeneral("select idcondicion as codigo, descripcion,cantidad_dia from gendbfcondicion where nulo " + _ActivateParameter.ToString() + " 0", "descripcion", "Condiciones"); if (consulta.ShowDialog(this) == DialogResult.OK) { TxtCodigo.Text = consulta.MainGrid.SelectedRows[0].Cells[0].Value.ToString(); Completar_condiciones(); if (TxtCodigo.Text != string.Empty) { TxtCodigo.Focus(); } } }
private void BtnExcluir_Click(object sender, EventArgs e) { var oEPI = _Control.Selecionar(int.Parse(TxtCodigo.Text)); _Control.Excluir(oEPI); HabilitaControles(true); LimpaControles(); BtnAlterar.Enabled = false; BtnExcluir.Enabled = false; BtnIncluir.Enabled = true; CarregaGrid(); MessageBox.Show("Registro excluído com sucesso.", ProductName, MessageBoxButtons.OK); TxtCodigo.Focus(); }
void Nuevo() { booAgregando = true; n_QueHace = 1; Tab1.TabPages[0].Enabled = false; Blanquea(); Bloquea(); ActivarTool(); LblTitulo2.Text = "Agregando Nuevo Registro"; Tab1.SelectedIndex = 1; FgUniMed.Rows.Count = 2; booAgregando = false; TxtCodigo.Focus(); }
private void BtnGuardar_Click(object sender, EventArgs e) { if (TxtCodigo.Text == null || TxtCodigo.Text == "") { Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar código."); TxtCodigo.Focus(); return; } if (TxtCodigoReferencia.Text == null || TxtCodigoReferencia.Text == "") { Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar código referencia."); TxtCodigoReferencia.Focus(); return; } if (TxtPorcentaje.Text == null || TxtPorcentaje.Text == "") { Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar el procentaje."); TxtPorcentaje.Focus(); return; } if (Convert.ToDecimal(TxtPorcentaje.Text) <= 0) { Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar el procentaje mayor a cero."); TxtPorcentaje.Focus(); return; } FrmPregunta FrmGuardar = new FrmPregunta(); FrmGuardar.ShowDialog(); if (FrmGuardar.Estado == true) { CADRetencion Guardar = new CADRetencion(); Guardar.InsertRetencion(Convert.ToInt32(CbTipoRetencion.SelectedValue), CJ3, CJ4, CJ5, TxtCodigo.Text.ToUpper(), TxtCodigoReferencia.Text.ToUpper(), TxtDescripcion.Text.ToUpper(), Convert.ToDecimal(TxtPorcentaje.Text)); Alerta = new ClassToast(ClassColorAlerta.Alerta.Guardado.ToString(), "GUARDADO", "Registro guardado perfectamente."); TxtCodCuenta.Text = null; TxtCodigo.Text = null; TxtCodigoReferencia.Text = null; TxtCuenta.Text = null; TxtDescripcion.Text = null; TxtPorcentaje.Text = "0"; DgvLLenar = new ClassDgvRetencion(); DgvLLenar.GetRetencion(DgvDato, Convert.ToInt32(CbTipoRetencion.SelectedValue)); } }
void Modificar() { booAgregando = true; n_QueHace = 2; Tab1.TabPages[0].Enabled = false; Blanquea(); Bloquea(); ActivarTool(); int intIdRegistro = Convert.ToInt16(DgLista.Columns["n_id"].CellValue(DgLista.Row).ToString()); VerRegistro(intIdRegistro); LblTitulo2.Text = "Modificando Registro"; Tab1.SelectedIndex = 1; TxtCodigo.Focus(); booAgregando = false; }
private void LipiarControlesArticulo() { TxtCodigo.Clear(); TxtDescripcion.Clear(); TxtPrecioCompra.Text = "0.00"; TxtPrecioVenta.Text = "0.00"; TxtGananciaObtener.Text = "0.00"; TxtTotalInventario.Text = "0"; TxtIvaUnitario.Text = "0.00"; TxtCantidadVendido.Text = "0"; TxtCantidadMinimo.Text = "0"; TxtCantidadMaximo.Text = "0"; TxtUnidadVenta.Clear(); TxtCantidad.Text = "0"; DtpFecheVencimiento.MinDate = DateTime.Now.AddDays(5); TxtCodigo.Focus(); }
private void BtnGuardar_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(TxtCodigo.Text)) { MessageBox.Show("Ingrese Código del producto", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtCodigo.Focus(); } else if (string.IsNullOrEmpty(TxtNombre.Text)) { MessageBox.Show("Ingrese Nombre del Producto", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtNombre.Focus(); } else { Guardar(); } }
private bool ValidarDatos() { if (TxtCodigo.Text.Trim().Length == 0) { MessageBox.Show("Código no puede ser vacío", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtCodigo.Focus(); return(false); } var q = opeLib.BuscarAqlquiler(TxtCodigo.Text.Trim()); if (q != null && this.Ope == OperacionesABC.Agregar) { MessageBox.Show("Código ya existe", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtCodigo.Focus(); return(false); } return(true); }//fin de validar datos
protected void BtnConsulta_Click(object sender, EventArgs e) { if (TxtCodigo.Text.Trim() == "") { LblMensaje.Text = "El codigo es requerido"; TxtCodigo.Focus(); } else { LblMensaje.Text = ""; DataSet ds = new DataSet(); ds = objreserva.consultar_reserva(TxtCodigo.Text); if (ds.Tables[0].Rows.Count == 0) { LblMensaje.Text = "Reserva no encontrada"; Lblfecha.Text = System.DateTime.Now.ToShortDateString(); LblHora.Text = System.DateTime.Now.ToShortTimeString(); TxtCodigo.Focus(); lblnompersonareserva.Text = ""; lblvalor.Text = ""; lbltelpersoreserva.Text = ""; LblLugar.Text = ""; Lblnombre.Text = ""; } else { if (Convert.ToBoolean(ds.Tables[0].Rows[0]["activo"].ToString()) == false) { LblMensaje.Text = "Reserva existe pero ha sido anulada"; } else { LblMensaje.Text = "Reserva encontrada con exito"; Lblfecha.Text = ds.Tables[0].Rows[0]["fecha_reserva"].ToString(); LblHora.Text = ds.Tables[0].Rows[0]["hora_reserva"].ToString(); lblvalor.Text = ds.Tables[0].Rows[0]["valor_reserva"].ToString(); Lblnombre.Text = ds.Tables[0].Rows[0]["nom_cancha"].ToString(); lblnompersonareserva.Text = ds.Tables[0].Rows[0]["nom_user"].ToString(); lbltelpersoreserva.Text = ds.Tables[0].Rows[0]["telefono"].ToString(); LblLugar.Text = ds.Tables[0].Rows[0]["lugar"].ToString(); } } } }