private void BtnEliminar_Click(object sender, EventArgs e) { ErrProvider.Clear(); if (TxtSerieE.Text == "" | TxtSerieE.TextLength != 3) { ErrProvider.SetError(TxtSerieE, "Ingrese una serie válida"); return; } if (CboComprobante.SelectedIndex == -1) { ErrProvider.SetError(CboComprobante, "Seleccione un tipo de comprobante"); return; } if (CboEmpresaE.SelectedIndex == -1) { ErrProvider.SetError(CboEmpresaE, "Seleccione una empresa"); return; } if (TxtNumIni.Text == "" | TxtNumFin.Text == "") { ErrProvider.SetError(TxtNumIni, "El número inicial y el final deben ser válidos."); return; } if (Convert.ToInt32(TxtNumIni.Text) > Convert.ToInt32(TxtNumFin.Text)) { ErrProvider.SetError(TxtNumIni, "El número inicial no puede ser mayor al número final."); return; } if (MessageBox.Show("¿Seguro que desea eliminar estos comprobantes?", "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { new CL_Comprobante().ELIMINAR_COMPROBANTES(CboEmpresaE.SelectedValue.ToString(), TxtSerieE.Text, Convert.ToInt32(TxtNumIni.Text), Convert.ToInt32(TxtNumFin.Text), AppSettings.UserID, Convert.ToInt16(CboComprobante.SelectedValue)); MessageBox.Show("Se elimino los comprobantes", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void BtnMultiplesPagos_Click(object sender, EventArgs e) { ErrProvider.Clear(); if (DtComprobanteCredito.Rows.Count > 0 && NumCaja == 0) { FrmPagosMultiples ObjFrmPagosMultiples = new FrmPagosMultiples(); ObjFrmPagosMultiples.DtComprobantes = DtComprobanteCredito; ObjFrmPagosMultiples.DtFormasPago = DtFormasPago; ObjFrmPagosMultiples.Numcaja = NumCaja; ObjFrmPagosMultiples.CreditoID = Convert.ToInt32(LstCreditos.Columns["CreditoID"].Value); ObjFrmPagosMultiples.NomCampanha = LstCreditos.Columns["NomCampanha"].Value.ToString(); ObjFrmPagosMultiples.DtEmpresas = DtEmpresas; ObjFrmPagosMultiples.NomCaja = NomCaja; ObjFrmPagosMultiples.ShowDialog(); ObjFrmPagosMultiples.Dispose(); LimpiarTodo(); } else { if (NumCaja == 0) { ErrProvider.SetError(LblCaja, "Esta caja no existe."); } } }
private void TxtProducto_KeyPress(object sender, KeyPressEventArgs e) { ErrProvider.Clear(); if (e.KeyChar == (char)(Keys.Enter) & TxtProducto.Text != "" & Cboempresa1.SelectedIndex != -1) { DataTable DtProductos = new DataTable(); DtProductos = ObjCL_Producto.GetProductosPrecio(Cboempresa1.SelectedValue.ToString() + AppSettings.SedeID, TxtProducto.Text, "A"); if (DtProductos.Rows.Count == 1) { TxtCodigoVenta.Text = DtProductos.Rows[0]["ProductoIDVentas"].ToString(); ProductoID = DtProductos.Rows[0]["ProductoID"].ToString(); TxtCodigo.Text = DtProductos.Rows[0]["ProductoID"].ToString(); TxtProducto.Text = DtProductos.Rows[0]["Alias"].ToString(); LblUM.Text = DtProductos.Rows[0]["UnidadMedidaID"].ToString(); LblPrecioAnterior.Text = DtProductos.Rows[0]["PrecioUnitario"].ToString(); } else if (DtProductos.Rows.Count > 1)//mostrarlo en una nueva ventana { FrmPreciosBuscados ObjFrmPreciosBuscados = new FrmPreciosBuscados(); ObjFrmPreciosBuscados.DtProductos = DtProductos; ObjFrmPreciosBuscados.ShowDialog(); TxtCodigoVenta.Text = ObjFrmPreciosBuscados.ProductoIDVentas; ProductoID = ObjFrmPreciosBuscados.ProductoID; TxtCodigo.Text = ObjFrmPreciosBuscados.ProductoID; TxtProducto.Text = ObjFrmPreciosBuscados.Alias; LblUM.Text = ObjFrmPreciosBuscados.UnidadMedidaID; LblPrecioAnterior.Text = ObjFrmPreciosBuscados.PrecioUnitario; } else { LimpiarPrecio(); } } }
}//End ButItNow() /// <summary> /// Purpose: have the textboxes intereact with the Class. /// </summary> private bool UpdateObject() { ///<summary> /// A region for local variables /// </summary> #region Local Var int _intTestValue = 0; double _doubleTestValue = 0.0; #endregion Local Var ErrProvider.Clear(); si.Description = TxtBx_ItemDescription.Text; si.SQuantity = TxtBx_Quantity.Text; //Condition will test bool if it can prase or not, as well as, if the value is too low if (!(int.TryParse(si.SQuantity, out _intTestValue)) || _intTestValue <= 0) { ErrProvider.SetError(TxtBx_Quantity, INV_QNTY); TxtBx_Quantity.Focus(); TxtBx_Quantity.SelectAll(); return(false); } //Condition will test bool if it can prase or not, as well as, if the value is too low si.SPrice = TxtBx_UnitPrice.Text; if (!(double.TryParse(si.SPrice, out _doubleTestValue)) || _doubleTestValue <= 0) { ErrProvider.SetError(TxtBx_UnitPrice, INV_PRC); TxtBx_UnitPrice.Focus(); TxtBx_UnitPrice.SelectAll(); return(false); } //If everything checks out, it will return true and allow the code to show the message box salesInvoice else { return(true); } }//End UpdateObject()
private void BtnGuardar_Click(object sender, EventArgs e) { try { OcultarBotones(true, true, false, false, false, false); validarControles(); if (validarControles() == false) { OcultarBotones(false, false, true, false, true, false); return; } ObtenerDatosControles(); ErrProvider.Clear(); ObtenerDatosControles(); if (TipoGuardar == "Nuevo") { ObjCL_Empresas.InsertSede(ObjSede); lblEstado.Text = "Se guardo correctamente el registro"; lblEstado.ForeColor = Color.Black; ReadOnly(true); //agregar DataRow Dr = DtSede.NewRow(); Dr["SedeID"] = ObjSede.SedeID; Dr["NomSede"] = ObjSede.NomSede; Dr["Numero"] = ObjSede.Numero; Dr["Interior"] = ObjSede.Interior; Dr["Zona"] = ObjSede.Zona; Dr["Distrito"] = ObjSede.Distrito; Dr["Provincia"] = ObjSede.Provincia; Dr["Departamento"] = ObjSede.Departamento; DtSede.Rows.Add(Dr); } else if (TipoGuardar == "Actualizar") { ObjCL_Empresas.UpdateSede(ObjSede, "A"); lblEstado.Text = "Se actualizó correctamente el registro"; lblEstado.ForeColor = Color.Black; ReadOnly(true); //actualizar DataRow[] customerRow = DtSede.Select("SedeID = '" + ObjSede.SedeID + "'"); customerRow[0]["NomSede"] = ObjSede.NomSede; customerRow[0]["Numero"] = ObjSede.Numero; customerRow[0]["Interior"] = ObjSede.Interior; customerRow[0]["Zona"] = ObjSede.Zona; customerRow[0]["Distrito"] = ObjSede.Distrito; customerRow[0]["Provincia"] = ObjSede.Provincia; customerRow[0]["Departamento"] = ObjSede.Departamento; } TipoGuardar = ""; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ReadOnly(false); } }
private void Btnagregar_Click(object sender, EventArgs e) { ErrProvider.Clear(); if (TxtBanco.Text != "" & TxtMonto.Text != "" & TxtMonto.Text != "." & TxtNumBoucher.Text != "") { string NroBoucher; string Banco; decimal Monto; NroBoucher = TxtNumBoucher.Text; Banco = TxtBanco.Text; Monto = Convert.ToDecimal(TxtMonto.Text); AgregarDetalle(NroBoucher, Banco, Monto); this.Close(); } else { if (TxtBanco.Text == "") { ErrProvider.SetError(TxtBanco, "Ingrese el banco"); } if (TxtMonto.Text == "" | TxtMonto.Text == ".") { ErrProvider.SetError(TxtMonto, "Ingrese monto valido"); } if (TxtNumBoucher.Text == "") { ErrProvider.SetError(TxtNumBoucher, "Ingrese Nro de Boucher"); } } }
private void TdgRequerimientos_DoubleClick(object sender, EventArgs e) { if (TdgRequerimientos.Row > -1) { ErrProvider.Clear(); TbDespachoPollo.SelectedIndex = 0; ReadOnlyTxt(false); TxtAlmacenID.Value = TdgRequerimientos.Columns["RAlmacenID"].Value.ToString(); TxtRequerimiento.Value = TdgRequerimientos.Columns["NumRequerimiento"].Value.ToString(); TxtCodigo.Value = TdgRequerimientos.Columns["ProductoID"].Value.ToString(); TxtProducto.Value = TdgRequerimientos.Columns["NomProducto"].Value.ToString(); TxtUM.Value = TdgRequerimientos.Columns["UnidadMedidaID"].Value.ToString(); TxtPrioridad.Value = TdgRequerimientos.Columns["PrioridadID"].Value.ToString(); TxtObservacion.Value = TdgRequerimientos.Columns["ObservacionD"].Value.ToString(); TxtIDEstado.Value = TdgRequerimientos.Columns["EstadoIDD"].Value.ToString(); TxtEstado.Value = TdgRequerimientos.Columns["NomEstado"].Value.ToString(); TxtStock.Value = TdgRequerimientos.Columns["StockActual"].Value.ToString(); TxtSolicitado.Value = TdgRequerimientos.Columns["CantidadSolicitada"].Value.ToString(); TxtRecibido.Value = TdgRequerimientos.Columns["CantidadRecibida"].Value.ToString(); TxtTransito.Value = TdgRequerimientos.Columns["CantidadTransito"].Value.ToString(); ReadOnlyTxt(true); } //obtener almacen local AlmacenIDLocal = TdgRequerimientos.Columns["AlmacenID"].Value.ToString(); }
private void Buscar() { ReadOnly(false); lblEstado.Text = ""; ErrProvider.Clear(); DtChofer = new DataTable(); ObtenerDatosControles(); DtChofer = ObjCL_Choferes.GetChoferesID(TxtDNI2.Text); if (DtChofer.Rows.Count > 0) { CboEmpresa.SelectedValue = DtChofer.Rows[0]["EmpresaID"]; TxtChoferID.Value = DtChofer.Rows[0]["ChoferID"]; TxtNomChofer.Value = DtChofer.Rows[0]["NomChofer"]; TxtApeChofer.Value = DtChofer.Rows[0]["ApeChofer"]; TxtDNI.Value = DtChofer.Rows[0]["DNI"]; TxtLicencia.Value = DtChofer.Rows[0]["Licencia"]; OcultarBotones(true, true, false, true, false, true); } else { LimpiarTextos(); ReadOnly(true); lblEstado.Text = "No existe Chofer con el DNI: " + TxtChoferID.Text; lblEstado.ForeColor = Color.Red; OcultarBotones(true, true, false, false, false, false); } ReadOnly(true); }
private void Buscar() { ReadOnly(false); lblEstado.Text = ""; ErrProvider.Clear(); Dtvehiculo = new DataTable(); ObtenerDatosControles(); Dtvehiculo = ObjCL_Vehiculo.GetVehiculosPlaca(TxtPlaca2.Text); if (Dtvehiculo.Rows.Count > 0) { CboEmpresa.SelectedValue = Dtvehiculo.Rows[0]["EmpresaID"]; TxtPlaca.Value = Dtvehiculo.Rows[0]["Placa"]; TxtMarca.Value = Dtvehiculo.Rows[0]["Marca"]; TxtCertificadoInscripcion.Value = Dtvehiculo.Rows[0]["CertificadoInscripcion"]; TxtConfiguracionVehicular.Value = Dtvehiculo.Rows[0]["ConfiguracionVehicular"]; TxtTara.Value = Dtvehiculo.Rows[0]["Tara"]; TxtPesoBruto.Value = Dtvehiculo.Rows[0]["PesoBruto"]; OcultarBotones(true, true, false, true, false, true); } else { LimpiarTextos(); ReadOnly(true); lblEstado.Text = "No existe vehículo con la placa: " + TxtPlaca2.Text; lblEstado.ForeColor = Color.Red; OcultarBotones(true, true, false, false, false, false); } ReadOnly(true); }
private void BtnMostrar_Click(object sender, EventArgs e) { try { ErrProvider.Clear(); if (DtpFechaIni.Value != null & DtpFechaFin.Value != null & useCliente1.cbCliente.SelectedValue != null & CboTipoVenta.SelectedIndex != -1) { DataTable DTComprobantes = new DataTable(); DTComprobantes = ObjCL_Cliente.GetComprobantesCliente(Convert.ToInt32(useCliente1.cbCliente.Columns["ClienteID"].Value), DtpFechaIni.Value, DtpFechaFin.Value.AddDays(1), Convert.ToInt32(CboTipoVenta.SelectedValue)); TdgComprobantes.SetDataBinding(DTComprobantes, "", true); } else { if (useCliente1.cbCliente.SelectedIndex == -1) { MessageBox.Show("No se ha seleccionado el cliente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Stop); } if (CboTipoVenta.SelectedIndex == -1) { ErrProvider.SetError(CboTipoVenta, "Debe seleccionar el tipo de venta"); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void BtnGuardar_Click(object sender, EventArgs e) { try { OcultarBotones(true, true, false, false, false, false); validarControles(); if (validarControles() == false) { OcultarBotones(false, false, true, false, true, false); return; } ErrProvider.Clear(); ObtenerDatosControles(); if (TipoGuardar == "Nuevo") { //agregar EmpresaID = ObjCL_Empresas.InsertEmpresa(ObjEmpresa); DataRow Dr = DTEmpresas.NewRow(); Dr["EmpresaID"] = EmpresaID; Dr["NomEmpresa"] = ObjEmpresa.NomEmpresa; Dr["RUC"] = ObjEmpresa.RUC; Dr["DomicilioFiscal"] = ObjEmpresa.DomicilioFiscal; Dr["Telefono"] = ObjEmpresa.Telefono; Dr["Logo"] = ObjEmpresa.Logo; DTEmpresas.Rows.Add(Dr); lblEstado.Text = "Se guardo correctamente el registro"; lblEstado.ForeColor = Color.Black; ReadOnly(true); } else if (TipoGuardar == "Actualizar") { ObjCL_Empresas.UpdateEmpresa(ObjEmpresa, "A"); //actualizar DataRow[] customerRow = DTEmpresas.Select("EmpresaID = '" + ObjEmpresa.EmpresaID + "'"); customerRow[0]["NomEmpresa"] = ObjEmpresa.NomEmpresa; customerRow[0]["RUC"] = ObjEmpresa.RUC; customerRow[0]["DomicilioFiscal"] = ObjEmpresa.DomicilioFiscal; customerRow[0]["Telefono"] = ObjEmpresa.Telefono; customerRow[0]["Logo"] = ObjEmpresa.Logo; lblEstado.Text = "Se actualizó correctamente el registro"; lblEstado.ForeColor = Color.Black; ReadOnly(true); } TipoGuardar = ""; BtnCargar.Enabled = false; //actualizar tambien la tabal estatica de empresas UTI_Datatables.DtEmpresas = DTEmpresas.Copy(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ReadOnly(false); } }
private void BtnIngresar_Click(object sender, EventArgs e) { ErrProvider.Clear(); try { if (TxtCantidad.Text != "" & TxtConcepto.Text != "") { //inserta un ingreso a la caja //llenar el objPago E_Pago ObjE_Pago = new E_Pago(); ObjE_Pago.PagoID = 0; ObjE_Pago.NumComprobante = ""; ObjE_Pago.TipoComprobanteID = 0; ObjE_Pago.Importe = Convert.ToDecimal(TxtCantidad.Text); ObjE_Pago.FormaPagoID = 2;//contado ObjE_Pago.UsuarioID = AppSettings.UserID; //llenar la nota de ingreso E_NotaIngreso ObjE_NotaIngreso = new E_NotaIngreso(); ObjE_NotaIngreso.Tipo = "E";//es salida ObjE_NotaIngreso.Numcaja = NumCaja; ObjE_NotaIngreso.EmpresaID = EmpresaID; ObjE_NotaIngreso.Observacion = "Inicio dia"; ObjE_NotaIngreso.LugarPago = AppSettings.SedeID; if (AppSettings.ImpresoraPago != "") { Int32 NotaIngresoID = 0; NotaIngresoID = ObjCL_Pago.InsertPago(ObjE_Pago, ObjE_NotaIngreso, 12); printDocument1.PrinterSettings.PrinterName = AppSettings.ImpresoraPago; printDocument1.Print(); MessageBox.Show("Se registro correctamente la salida de caja", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("no se ha seleccionado la impresora de pago, no se imprimira el Egreso", "", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } else { if (TxtCantidad.Text == "") { ErrProvider.SetError(TxtCantidad, "Debe ingresar una cantidad valida."); } if (TxtConcepto.Text == "") { ErrProvider.SetError(TxtConcepto, "Debe ingresar el concepto del egreso."); } } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\rMetodo Ingresar inicio caja", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void BtnCancelar_Click(object sender, EventArgs e) { //desahcer ErrProvider.Clear(); OcultarBotones(true, true, false, false, false, false); ReadOnly(false); LimpiarTextos(); ReadOnly(true); }
private void BtnModificarIGV_Click(object sender, EventArgs e) { ErrProvider.Clear(); if (TxtIGV.Text != "") { new CL_Comprobante().InsertarIGV(Convert.ToInt16(TxtIGV.Text), AppSettings.UserID); MessageBox.Show("Se modificó correctamente el GV", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { ErrProvider.SetError(TxtIGV, "Ingrese un Monto válido"); } }
private void BtnGuardar_Click(object sender, EventArgs e) { try { OcultarBotones(true, true, false, false, false, false); validarControles(); if (validarControles() == false) { OcultarBotones(false, false, true, false, true, false); return; } ErrProvider.Clear(); ObtenerDatosControles(); if (TipoGuardar == "Nuevo") { //agregar PresentacionID = ObjCL_Producto.InsertPresentacion(ObjPresentacion); DataRow Dr = MantenimientoProductos.Ds.Tables["Presentacion"].NewRow(); Dr["PresentacionID"] = PresentacionID; Dr["NomPresentacion"] = ObjPresentacion.NomPresentacion; Dr["Unidades"] = ObjPresentacion.Unidades; Dr["UnidadMedidaID"] = ObjPresentacion.UnidadMedidaID; MantenimientoProductos.Ds.Tables["Presentacion"].Rows.Add(Dr); lblEstado.Text = "Se guardo correctamente el registro"; lblEstado.ForeColor = Color.Black; ReadOnly(true); } else if (TipoGuardar == "Actualizar") { ObjCL_Producto.UpdatePresentacion(ObjPresentacion, "A"); //actualizar DataRow[] customerRow = MantenimientoProductos.Ds.Tables["Presentacion"].Select("PresentacionID = '" + ObjPresentacion.PresentacionID + "'"); customerRow[0]["NomPresentacion"] = ObjPresentacion.NomPresentacion; customerRow[0]["Unidades"] = ObjPresentacion.Unidades; customerRow[0]["UnidadMedidaID"] = ObjPresentacion.UnidadMedidaID; lblEstado.Text = "Se actualizó correctamente el registro"; lblEstado.ForeColor = Color.Black; ReadOnly(true); } TipoGuardar = ""; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ReadOnly(false); } }
private void BtnGuardar_Click(object sender, EventArgs e) { try { OcultarBotones(true, true, false, false, false, false); validarControles(); if (validarControles() == false) { OcultarBotones(false, false, true, false, true, false); return; } ErrProvider.Clear(); ObtenerDatosControles(); if (TipoGuardar == "Nuevo") { //agregar ObjCL_Kardex.InsertTipoDocumento(ObjTipoDocumento); DataRow Dr = Halley.Presentacion.Almacen.Reportes.Rep_Kardex.DtTipoDocumento.NewRow(); Dr["DocumentoID"] = ObjTipoDocumento.DocumentoID; Dr["TipoContabilidad"] = ObjTipoDocumento.TipoContabilidad; Dr["Descripcion"] = ObjTipoDocumento.Descripcion; Halley.Presentacion.Almacen.Reportes.Rep_Kardex.DtTipoDocumento.Rows.Add(Dr); lblEstado.Text = "Se guardo correctamente el registro"; lblEstado.ForeColor = Color.Black; ReadOnly(true); } else if (TipoGuardar == "Actualizar") { ObjCL_Kardex.UpdateTipoDocumento(ObjTipoDocumento, "A"); //actualizar DataRow[] customerRow = Halley.Presentacion.Almacen.Reportes.Rep_Kardex.DtTipoDocumento.Select("DocumentoID = '" + ObjTipoDocumento.DocumentoID + "'"); customerRow[0]["TipoContabilidad"] = ObjTipoDocumento.TipoContabilidad; customerRow[0]["Descripcion"] = ObjTipoDocumento.Descripcion; lblEstado.Text = "Se actualizó correctamente el registro"; lblEstado.ForeColor = Color.Black; ReadOnly(true); } TipoGuardar = ""; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ReadOnly(false); } }
private void Buscar() { ReadOnly(false); lblEstado.Text = ""; ErrProvider.Clear(); // ObtenerDatosControles(); DtCliente = ObjCL_Cliente.GetClienteDocumento(TxtDocumento2.Text); if (DtCliente.Rows.Count > 0) { CboVia.SelectedValue = DtCliente.Rows[0]["DireccionViaId"]; CboTipoCliente.SelectedValue = DtCliente.Rows[0]["TipoClienteID"]; CboTipoDocumento.SelectedValue = DtCliente.Rows[0]["IDTipoDocumento"]; CboDistrito.SelectedValue = DtCliente.Rows[0]["DistritoId"]; CboProvincia.SelectedValue = DtCliente.Rows[0]["ProvinciaId"]; CboDepartamento.SelectedValue = DtCliente.Rows[0]["DepartamentoId"]; CboPais.SelectedValue = DtCliente.Rows[0]["PaisId"]; TxtClienteID.Value = DtCliente.Rows[0]["ClienteID"]; TxtNroDocumento.Value = DtCliente.Rows[0]["NroDocumento"]; TxtRazonSocial.Value = DtCliente.Rows[0]["RazonSocial"]; TxtAlias.Value = DtCliente.Rows[0]["Alias"]; TxtContacto.Value = DtCliente.Rows[0]["Contacto"]; TxtTelefonoFijo.Value = DtCliente.Rows[0]["TelefonoFijo"]; TxtTelefonoMovil.Value = DtCliente.Rows[0]["TelefonoMovil"]; TxtFax.Value = DtCliente.Rows[0]["Fax"]; TxtEmail.Value = DtCliente.Rows[0]["Email"]; TxtDireccion.Value = DtCliente.Rows[0]["Direccion"]; TxtNombreVia.Value = DtCliente.Rows[0]["NombreVia"]; TxtNombre1.Value = DtCliente.Rows[0]["Nombre1"]; TxtNombre2.Value = DtCliente.Rows[0]["Nombre2"]; TxtApellido1.Value = DtCliente.Rows[0]["Apellido1"]; TxtApellido2.Value = DtCliente.Rows[0]["Apellido2"]; TxtDireccionNumero.Value = DtCliente.Rows[0]["DireccionNumero"]; TxtDireccionInterior.Value = DtCliente.Rows[0]["DireccionInterior"]; TxtObservacion.Value = DtCliente.Rows[0]["Observaciones"]; OcultarBotones(true, true, false, true, false, true); } else { LimpiarTextos(); ReadOnly(true); lblEstado.Text = "No existe Cliente con el Nro Ducumento: " + TxtDocumento2.Text; lblEstado.ForeColor = Color.Red; OcultarBotones(true, true, false, false, false, false); } ReadOnly(true); }
private void BtnActualizar_Click(object sender, EventArgs e) { try { ErrProvider.Clear(); Cursor = Cursors.WaitCursor; if (Cboempresa1.SelectedIndex != -1 & ProductoID != "" & TxtNuevoPrecio.Text != "." & TxtNuevoPrecio.Text != "." & TxtNuevoPrecio.Text != "") { if (Convert.ToDecimal(TxtNuevoPrecio.Text) > 0) { //obtener nuevo precio E_ListaPrecio ObjE_ListaPrecio = new E_ListaPrecio(); ObjE_ListaPrecio.EmpresaID = Cboempresa1.SelectedValue.ToString(); ObjE_ListaPrecio.SedeID = AppSettings.SedeID; ObjE_ListaPrecio.ProductoID = ProductoID; ObjE_ListaPrecio.PrecioUnitario = Convert.ToDecimal(TxtNuevoPrecio.Text); ObjE_ListaPrecio.UsuarioID = AppSettings.UserID; ObjCL_Producto.UpdatePrecio(ObjE_ListaPrecio, AppSettings.SedeID); MessageBox.Show("Se actualizo correctamente el precio", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); LimpiarPrecio(); } else { ErrProvider.SetError(TxtNuevoPrecio, "precio debe ser diferente de cero."); } } else { if (Cboempresa1.SelectedIndex == -1) { ErrProvider.SetError(Cboempresa1, "Seleccione una empresa."); } if (TxtNuevoPrecio.Text == "." | TxtNuevoPrecio.Text == "") { ErrProvider.SetError(TxtNuevoPrecio, "Ingrese un precio valido"); } else if (TxtNuevoPrecio.Text.Length > 0 && Convert.ToDecimal(TxtNuevoPrecio.Text) == 0) { ErrProvider.SetError(TxtNuevoPrecio, "precio debe ser diferente de cero."); } } Cursor = Cursors.Default; } catch (Exception ex) { MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); Cursor = Cursors.Default; } }
private void BtnNuevo_Click(object sender, EventArgs e) { //limpiar todo ErrProvider.Clear(); DtRequerimientos = new DataTable(); TdgRequerimientos.SetDataBinding(DtRequerimientos, "", true); ReadOnlyTxt(false); TxtAlmacenID.Value = ""; TxtRequerimiento.Value = ""; TxtCodigo.Value = ""; TxtProducto.Value = ""; TxtUM.Value = ""; TxtPrioridad.Value = ""; TxtObservacion.Value = ""; TxtIDEstado.Value = ""; TxtEstado.Value = ""; TxtStock.Value = ""; TxtSolicitado.Value = ""; TxtRecibido.Value = ""; TxtTransito.Value = ""; TxtCantidad.Value = ""; TxtNroJabas.Value = ""; TxtTara.Value = ""; TxtNeto.Value = ""; TxtBruto.Value = ""; ReadOnlyTxt(true); //limpiar tabla y cargarla en la grilla DetallesRequerimientos.Clear(); //habilitra control de guardar BtnGrabar.Visible = true; BtnBalanza.Visible = true; DtTara.Clear(); DtPesoBruto.Clear(); Neto = 0; Tara = 0; Bruto = 0; NroJabas = 0; TdgTara.SetDataBinding(DtTara, "", true); TdgPesoBruto.SetDataBinding(DtPesoBruto, "", true); //deshabilitar paraa que no pueda ser modificado GbFecha.Enabled = false; GbVehiculo.Enabled = false; ChkExterno.Enabled = false; }
private void BtnTransformar_Click(object sender, EventArgs e) { try { ErrProvider.Clear(); bool Valor = true; Valor = HayCero(); decimal Cantidad = 0; if (TxtCantidad.Text != "") { Cantidad = Convert.ToDecimal(TxtCantidad.Text); } if (LstProductosPrincipales.SelectedIndex != -1 & TdgProductosAgregar.RowCount > 0 & Valor == false & Cantidad > 0) { ObjCL_Almacen.Transformar(DtProductosAgregar, AppSettings.EmpresaID + AppSettings.SedeID + LstProductosPrincipales.Columns["Almacen"].Value.ToString(), LstProductosPrincipales.SelectedValue.ToString(), Cantidad, AppSettings.UserID); MessageBox.Show("Se transformo el producto", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); DtProductosAgregar.Clear(); LstProductosPrincipales.SelectedIndex = -1; LstDerivados.SelectedIndex = -1; } else { if (LstProductosPrincipales.SelectedIndex == -1) { ErrProvider.SetError(LstProductosPrincipales, "Debe seleccionar el producto principal a transformar."); } if (TdgProductosAgregar.RowCount < 1) { ErrProvider.SetError(TdgProductosAgregar, "Debe haber agregado productos derivados."); } if (TxtCantidad.Text == "") { ErrProvider.SetError(TxtCantidad, "Debe Ingresar la cantidad que vaa ser transformada."); } if (Valor == true) { MessageBox.Show("Hay cantidad '0' en el producto: " + Producto + ".", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } catch (Exception ex) { MessageBox.Show(ex.Message + ". \r\n\r\nTransformar", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void BtnGuardar_Click(object sender, EventArgs e) { try { OcultarBotones(true, true, false, false, false, false); validarControles(); TxtDireccion.Visible = true; LblDireccion.Visible = true; if (validarControles() == false) { OcultarBotones(false, false, true, false, true, false); return; } ErrProvider.Clear(); ObtenerDatosControles(); if (TipoGuardar == "Nuevo") { Int32 ClienteID; ClienteID = ObjCL_Cliente.InsertCliente(ObjCliente); IDCliente = ClienteID; NroDocumento = ObjCliente.NroDocumento; RazonSocial = ObjCliente.RazonSocial; Direccion = ObjCliente.Direccion; TipoCliente = ObjCliente.TipoClienteID; TipoDocumento = ObjCliente.IDTipoDocumento; LimpiarTextos(); //MessageBox.Show("Se agrego Correctamente al cliente.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult = DialogResult.OK; } else if (TipoGuardar == "Actualizar") { ObjCL_Cliente.UpdateCliente(ObjCliente, "A"); lblEstado.Text = "Se actualizó correctamente el registro"; lblEstado.ForeColor = Color.Black; ReadOnly(true); } TipoGuardar = ""; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ReadOnly(false); } }
private void TdgCreditos_RowColChange(object sender, C1.Win.C1TrueDBGrid.RowColChangeEventArgs e) { habilitar(true); ErrProvider.Clear(); LblCreditoID.Text = TdgCreditos.Columns["CreditoID"].Value.ToString(); TxtLineaCredito.Text = TdgCreditos.Columns["LineaCredito"].Value.ToString(); TxtDiasFinanciar.Text = TdgCreditos.Columns["DiasFinanciar"].Value.ToString(); DeFechaInicio.Value = TdgCreditos.Columns["FechaInicio"].Value.ToString(); TxtNomCampanha.Text = TdgCreditos.Columns["NomCampanha"].Value.ToString(); TxtNumDeclaracionJurada.Text = TdgCreditos.Columns["NumDeclaracionJurada"].Value.ToString(); TxtCreditoDisponible.Text = TdgCreditos.Columns["CreditoDisponible"].Value.ToString(); DeFechaVencimiento.Value = TdgCreditos.Columns["FechaVencimiento"].Value.ToString(); habilitar(false); BtnAprobar.Visible = false; BtnModificar.Visible = true; BtnAnular.Visible = true; }
private bool InformarErro() { bool erro = false; ErrProvider.Clear(); if (TxtNomeProjeto.Text.Trim() == "") { ErrProvider.SetError(TxtNomeProjeto, "Informe o nome do projeto"); erro = true; } if (TxtPastaProjeto.Text.Trim() == "") { ErrProvider.SetError(BtnProcurarPasta, "Informe uma pasta no disco"); erro = true; } return(erro); }
private void BtnNuevo_Click(object sender, EventArgs e) { //limpiar todo ErrProvider.Clear(); CboProveedor.SelectedIndex = -1; //CboAlmacen.SelectedIndex = -1; //CboProductoPeso.SelectedIndex = -1; CboTipoDocumento.SelectedIndex = -1; NroPesadas = 0; ReadOnlyTxt(false); TxtDireccion.Value = ""; TxtDocumento.ReadOnly = false; TxtDocumento.Value = ""; TxtDocumento.ReadOnly = true; TxtTelefono.ReadOnly = false; TxtTelefono.Value = ""; TxtTelefono.ReadOnly = true; CboSacos.SelectedIndex = -1; TxtPrecioUnitario.Value = ""; TxtTotalKilos.Value = ""; TxtTotalSacos.Value = ""; Neto = 0; Cantidad = 0; BtnGrabar.Visible = true; BtnBalanza.Visible = true; TxtProcedencia.Text = ""; TxtComentario.Text = ""; TxtPorcDesc.Text = ""; #region borrar los list foreach (Control ctrl in this.Controls) { if (ctrl is GroupBox) { foreach (Control c in ctrl.Controls) { if (c is ListBox) { ListBox d = c as ListBox; d.Items.Clear(); } } } } #endregion }
private void CboEntidadBancaria_SelectedValueChanged(object sender, EventArgs e) { ErrProvider.Clear(); if (CboEntidadBancaria.SelectedIndex != -1 && CboMoneda.SelectedIndex != -1) { DataView DV = new DataView(DsDatosCuenta.Tables["CuentaCorriente"], "Moneda = '" + CboMoneda.Columns["Codigo"].Value.ToString() + "' and EntidadBancariaID = " + CboEntidadBancaria.SelectedValue.ToString() + " and EmpresaID = '" + NumHojaLiquidacion.Substring(0, 2) + "'", "", DataViewRowState.CurrentRows); CboCuentaCorriente.HoldFields(); CboCuentaCorriente.DataSource = DV.ToTable(); CboCuentaCorriente.DisplayMember = "NrocuentaCorriente"; CboCuentaCorriente.ValueMember = "CuentaCorrienteID"; } else { if (CboMoneda.SelectedIndex == -1) { ErrProvider.SetError(CboMoneda, "Debe seleccionar una moneda válida."); } } }
private void BtnGuardarCierre_Click(object sender, EventArgs e) { //almacena el cierre del dia try { ErrProvider.Clear(); if (TxtDineroEntregado.Text != "" && Convert.ToDecimal(TxtDineroEntregado.Text) != 0 & FechaIni != null) { DineroEntregado = Convert.ToDecimal(TxtDineroEntregado.Text); if (TotalEntregar != 0 & DineroEntregado != 0) { Sede = CboSede.Columns["NomSede"].Value.ToString(); EmpresaID = c1cboCia.SelectedValue.ToString(); SedeID = CboSede.SelectedValue.ToString(); CajeroID = Convert.ToInt32(CboCajero.SelectedValue); FechaIni = DtpFechaIni.Value; ObjCL_Venta.InsertCierre(CajeroID, EmpresaID + SedeID, FechaIni, DineroEntregado, Ingreso, Egreso, TotalVenta, TotalEntregar, AppSettings.UserID); MessageBox.Show("Se agrego el cierre correctamente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("El dinero entregado y/o total a entregar debe ser diferente de 0.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } else { if (TxtDineroEntregado.Text == "" || Convert.ToDecimal(TxtDineroEntregado.Text) == 0) { ErrProvider.SetError(TxtDineroEntregado, "Ingrese una cantidad valida"); } if (FechaIni == null) { ErrProvider.SetError(DtpFechaIni, "tal vez no ha consultado ningún cierre."); } } } catch (Exception ex) { MessageBox.Show("Ingresar Cierre().\n\n" + ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ChkExterno_CheckedChanged(object sender, EventArgs e) { ErrProvider.Clear(); if (ChkExterno.Checked == true) { PnlExterno.Visible = true; TxtMarca.Value = ""; TxtPlaca.Value = ""; TxtConfVehicular.Value = ""; TxtNroConstInscripcion.Value = ""; TxtNroLicTransaportista.Value = ""; TxtDNITransportista.Value = ""; CboVehiculo.SelectedIndex = -1; CboChofer.SelectedIndex = -1; } else { PnlExterno.Visible = false; } }
private void BtnBuscar_Click(object sender, EventArgs e) { TxtReadOnly(false); Limpiar(); TxtReadOnly(true); ErrProvider.Clear(); if (TxtBuscar.Text != "") { //obtener las guias de liquidacion if (RbCodigo.Checked == true) { NumHojaLiquidacion = TxtBuscar.Text; TraerGuia(NumHojaLiquidacion); } else if (RbDNI.Checked == true) { //devuelve una lista de codigos amarrados a un DNI DataTable Dt = new DataTable(); Dt = new CL_GuiaCompraMaiz().GetGuiaCompraMaizDNI(TxtBuscar.Text); LstCodigos.DataSource = Dt; LstCodigos.DisplayMember = "AudCrea"; LstCodigos.ValueMember = "NumHojaLiquidacion"; if (Dt.Rows.Count == 1) { NumHojaLiquidacion = Dt.Rows[0]["NumHojaLiquidacion"].ToString(); TraerGuia(NumHojaLiquidacion); } } } else { if (RbCodigo.Checked == true) { ErrProvider.SetError(TxtBuscar, "Debe ingresar un código de liquidación a buscar."); } else if (RbDNI.Checked == true) { ErrProvider.SetError(TxtBuscar, "Debe ingresar un DNI a Buscar"); } } }
private void BtnIngresar_Click(object sender, EventArgs e) { try { ErrProvider.Clear(); if (TxtCantidad.Text != "") { //inserta un ingreso a la caja //llenar el objPago E_Pago ObjE_Pago = new E_Pago(); ObjE_Pago.PagoID = 0; ObjE_Pago.NumComprobante = ""; ObjE_Pago.TipoComprobanteID = 0; ObjE_Pago.Importe = Convert.ToDecimal(TxtCantidad.Text); ObjE_Pago.FormaPagoID = 2;//contado ObjE_Pago.UsuarioID = AppSettings.UserID; //llenar la nota de ingreso E_NotaIngreso ObjE_NotaIngreso = new E_NotaIngreso(); ObjE_NotaIngreso.Tipo = "C"; ObjE_NotaIngreso.Numcaja = NumCaja; ObjE_NotaIngreso.EmpresaID = EmpresaID; ObjE_NotaIngreso.Observacion = "Inicio dia"; ObjE_NotaIngreso.LugarPago = AppSettings.SedeID; NotaIngresoID = ObjCL_Pago.InsertPago(ObjE_Pago, ObjE_NotaIngreso, 12); MessageBox.Show("Se registro correctamente El ingreso de caja", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { ErrProvider.SetError(TxtCantidad, "Ingrese una cantidad valida."); } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\rMetodo Ingresar inicio caja", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void BtnRequerimientos_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; ErrProvider.Clear(); if (CboProductoPeso.SelectedValue != null & CboSede.SelectedValue != null) { EmpresaSede = EmpresaIDUser + CboSede.SelectedValue.ToString(); DtRequerimientosAnt = new DataTable(); DtRequerimientosAnt = ObjRequerimientos.GetTransferenciaPeso(CboProductoPeso.SelectedValue.ToString(), EmpresaSede, AppSettings.EmpresaID + AppSettings.SedeID, "0,6,4"); DtRequerimientos = DtRequerimientosAnt.Clone(); //bucle para filtrar solo los que faltan productos por enviar foreach (DataRow Dr in DtRequerimientosAnt.Rows) { if (Convert.ToDecimal(Dr["CantidadRecibida"]) + Convert.ToDecimal(Dr["CantidadTransito"]) < Convert.ToDecimal(Dr["CantidadSolicitada"])) { DtRequerimientos.ImportRow(Dr); } } TdgRequerimientos.SetDataBinding(DtRequerimientos, "", true); TbDespachoPollo.SelectedIndex = 1; } else { if (CboSede.SelectedIndex == -1) { ErrProvider.SetError(CboSede, "Debe seleccionar una sede de destino."); } if (CboProductoPeso.SelectedIndex == -1) { ErrProvider.SetError(CboProductoPeso, "Debe seleccionar un producto.."); } //if (CboAlmacen.SelectedIndex == -1) { ErrProvider.SetError(CboAlmacen, "Debe seleccionar un almacen de donde sacar el producto."); } } Cursor = Cursors.Default; }