private void cargarResumen() { try { this.lblPlaca.Text = this.txtPlaca.Text; this.lblTipo.Text = this.cmbTipoVehiculo.Text.ToString(); this.lblMarca.Text = this.cmbMarca.Text.ToString(); this.lblLinea.Text = this.cmbLinea.Text.ToString(); this.lblModelo.Text = this.cmbModelo.Text.ToString(); this.lblTransmision.Text = this.cmbTransmision.Text.ToString(); this.lblTon.Text = this.txtTon.Text; this.lblCC.Text = this.txtCc.Text; this.lblCilindros.Text = this.cmbCilindros.Text.ToString(); this.lblAsientos.Text = this.cmbAsientos.Text.ToString(); this.lblPuertas.Text = this.cmbPuertas.Text.ToString(); this.lblColor.Text = this.txtColores.Text; this.lblChasis.Text = this.txtNoChasis.Text; this.lblMotor.Text = this.txtNoMotor.Text; this.lblVin.Text = this.txtVin.Text; this.lblObservaciones.Text = this.txtObservaciones.Text; this.lblAC.Text = this.cmbAC.Text; this.lblNombrePropietario.Text = this.txtNombrePropietario.Text; this.lblNitPropietario.Text = this.txtNit.Text; this.lblPoliza.Text = this.txtPoliza.Text; this.lblInversion.Text = this.lblTotal.Text; this.txtPrecioComercial.Focus(); this.lblCombustible.Text = this.cmbGasolina.Text.ToString(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void btnNuevaVenta_Click(object sender, EventArgs e) { try { idVenta = "0"; iniciarValores(); limpiarControlesDetalleVenta(); limpiarGridDetalle(); limpiarControlesReferencias(); limpiarGridReferencia(); limpiarControlesCliente(); limpiarControlesFinanciamiento(); groupBox1.Enabled = true; groupBox2.Enabled = true; tabControl1.SelectedIndex = 0; tabControl1.Enabled = true; btngrabar.Enabled = true; btnImprimir.Enabled = false; txtNit.Focus(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
//metodos paraControles --------------------------------------------------------------------------------- //Metodo para consultar que tab esta seleccionada y bloquear public void frmChange_Index(object sender, EventArgs e) { try { switch (this.tabIngresoVehiculo.SelectedIndex) { case 0: this.txtPlaca.Focus(); break; case 1: this.txtNombrePropietario.Focus(); break; case 2: this.carcarComboTipoCosto(); this.cmbTipoCosto.Focus(); break; case 3: this.cargarResumen(); break; default: break; } } catch (Exception ex) { ClsHelper.erroLog(ex); } }
public FrmNuevaVenta(string idVenta = "0") { InitializeComponent(); try { dtDetalle = new DataTable(); //Fuente de datos para grid detalle venta dtDetalle.TableName = "Detalle"; dtDetalle.Columns.Add("placa", typeof(string)); dtDetalle.Columns.Add("descripcion", typeof(string)); dtDetalle.Columns.Add("precioVenta", typeof(double)); dtDetalle.Columns.Add("precioOtorgado", typeof(double)); dtDetalle.Columns.Add("idVehiculo", typeof(string)); grdDetalle.DataSource = dtDetalle; //Estructura de la fuente de datos para el grid referencias dtReferencias = new DataTable(); dtReferencias.Columns.Add("id"); dtReferencias.Columns.Add("nombreRef"); dtReferencias.Columns.Add("telefonosRef"); dtReferencias.Columns.Add("direccionRef"); grdReferencias.DataSource = dtReferencias; this.idVenta = idVenta; //_p.liberarFormLista(); iniciarValores(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void grdExistentes_CellClick(object sender, DataGridViewCellEventArgs e) { try { switch (e.ColumnIndex) { case 0: this.idVehiculo = grdExistentes.SelectedRows[0].Cells["idVehiculoCol"].Value.ToString(); FrmNuevoVehiculo frmNuevoVehiculo = new FrmNuevoVehiculo(this.idVehiculo); frmNuevoVehiculo.ShowDialog(this); buscar(); //this.padre.cargarFormIngreso(this.idVehiculo); //txtNombre.Text = grdExistentes.SelectedRows[0].Cells["lineaCol"].Value.ToString(); //cmbMarca.SelectedValue = grdExistentes.SelectedRows[0].Cells["idMarcaCol"].Value; //txtNombre.Enabled = true; //txtNombre.Focus(); break; case 1: DialogResult r = MessageBox.Show("¿Confirma que desea eliminar este registro?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (r == DialogResult.Yes) { this.clsVehiculo.eliminar(grdExistentes.SelectedRows[0].Cells["idVehiculoCol"].Value.ToString()); ClsHelper.MensajeSistema("Proceso ejecutado exitosamente"); limpiarControles(); } break; } } catch (Exception ex) { this.idVehiculo = "0"; ClsHelper.erroLog(ex); } }
private void btnImprimir_Click(object sender, EventArgs e) { try { if (comprobarControlesFinanciamiento()) { if (verificarFinanciamiento()) { FrmClienteCotizacion frmCliente = new FrmClienteCotizacion( txtTotal.Text.ToString(), idVehiculo, txtCuotas.Text.Trim(), txtEnganche.Text.Trim(), txtCuotaMensual.Text.Trim(), txtPrecioNegociado.Text.Trim(), cmbForma.SelectedIndex.ToString()); frmCliente.ShowDialog(this); } else { ClsHelper.MensajeSistema("Valores inconcistentes, recalcular..."); } } } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void grdExistentes_CellClick(object sender, DataGridViewCellEventArgs e) { try { //0 Editar, 1 Rol switch (e.ColumnIndex) { case 0: idUsuario = grdExistentes.SelectedRows[0].Cells["idUsuarioCol"].Value.ToString(); txtNombre.Text = grdExistentes.SelectedRows[0].Cells["nombreCol"].Value.ToString(); txtUsuario.Text = grdExistentes.SelectedRows[0].Cells["UsuarioCol"].Value.ToString(); txtDescripcion.Text = grdExistentes.SelectedRows[0].Cells["observacionesCol"].Value.ToString(); txtFechaNacimiento.Text = grdExistentes.SelectedRows[0].Cells["fechaNacimientoCol"].Value.ToString(); chkActivo.Checked = grdExistentes.SelectedRows[0].Cells["activoCol"].Value.ToString() == "1" ? true : false; chkReiniciarContrasena.Checked = grdExistentes.SelectedRows[0].Cells["cambiarContrasenaCol"].Value.ToString() == "1" ? true : false; break; case 1: PV.Vistas.FrmRolUsuario frm = new PV.Vistas.FrmRolUsuario(); frm.idUsuario = grdExistentes.SelectedRows[0].Cells["idUsuarioCol"].Value.ToString(); frm.usuario = grdExistentes.SelectedRows[0].Cells["nombreCol"].Value.ToString(); frm.ShowDialog(); break; } } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void btnVenta_Click(object sender, EventArgs e) { try { if (comprobarControlesFinanciamiento()) { if (verificarFinanciamiento()) { FrmNuevaVenta frmVenta = new FrmNuevaVenta(); frmVenta.setVehiculo(this.idVehiculo, lblTipoAuto.Text + "," + lblMarca.Text + ", " + lblLinea.Text + lblModelo.Text + ", cc: " + lblCilindros.Text + ", cc:" + lblCc.Text, lblPlaca.Text, lblPrecio.Text); frmVenta.agregarFinanciamiento(cmbForma.SelectedIndex.ToString(), txtEnganche.Text.Trim(), txtCuotas.Text.Trim()); frmVenta.ventaDesdeCotizacion(); frmVenta.ShowDialog(); // FrmVenta frmVenta = new FrmVenta(); // frmVenta.Show(); // frmVenta.//cargarFormNuevaVenta(); // frmVenta.frmNuevaVenta.setVehiculo(idVehiculo, lblTipoAuto.Text + "," + lblMarca.Text + ", " + lblLinea.Text + // lblModelo.Text + ", cc: " + lblCilindros.Text + ", cc:" + lblCc.Text, lblPlaca.Text, lblPrecio.Text); /// frmVenta.frmNuevaVenta.agregarFinanciamiento(cmbForma.SelectedIndex.ToString(), txtEnganche.Text.Trim(), txtCuotas.Text.Trim()); // frmVenta.frmNuevaVenta.ventaDesdeCotizacion(); // } else { ClsHelper.MensajeSistema("Valores inconcistentes, recalcular..."); } } } catch (Exception ex) { ClsHelper.erroLog(ex); } }
//Manejo controles financiamiento public void limpiarControlesFinanciamiento() { try { //cmbFormapago.SelectedIndex = 0; //cmbDiaPago.SelectedIndex = 15; int dia = DateTime.Now.Day; if (dia > 30) { dia = 30; } cmbDiaPago.SelectedIndex = dia - 1; txtEnganche.Text = "0.00"; txtCuotaMensual.Text = "0.00"; txtPlazo.Text = "1"; txtSaldo.Text = "0.00"; if (dtDetalle.Rows.Count > 0) { txtTotalVenta.Text = ((double)dtDetalle.Compute("sum(precioOtorgado)", "")).ToString(); } else { txtTotalVenta.Text = "0.00"; } } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void txtPlaca_Leave(object sender, EventArgs e) { try { BL.ClsVehiculo clsVehiculo = new BL.ClsVehiculo(); DataTable dtVehiculo = clsVehiculo.seleccionarVehiculoInfo(txtPlaca.Text.Trim()); if (dtVehiculo.Rows.Count == 1) { DataRow dr = dtVehiculo.Rows[0]; setVehiculo( dr["idVehiculo"].ToString(), dr["descripcion"].ToString(), dr["placa"].ToString(), dr["monto"].ToString()); } else { //ClsHelper.MensajeSistema("Se encontro mas de un vehiculo"); } } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void cmbTipoVenta_SelectedIndexChanged(object sender, EventArgs e) { try { buscar(); }catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void PfrmNuevaVenta_Load(object sender, EventArgs e) { try { } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void FrmCotizacion_Load(object sender, EventArgs e) { try { this.buscar(); }catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void btnAgregarAuto_Click_1(object sender, EventArgs e) { try { agregarVehiculo(); }catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void btnBuscar_Click(object sender, EventArgs e) { try { this.buscar(); }catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void btnCancelar_Click(object sender, EventArgs e) { try { this.limpiarControles(); }catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void frmTipoCosto_Load(object sender, EventArgs e) { try { this.buscar(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void FrmCliente_Load(object obj, EventArgs e) { try { this.buscar(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
public void _FrmSeleccionAuto_Load(object sender, EventArgs e) { try { this.buscar(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void btnNuevaVenta_Click(object sender, EventArgs e) { try { // this._p.cargarFormNuevaVenta(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void button5_Click(object sender, EventArgs e) { try { this.tabIngresoVehiculo.SelectedIndex = 2; } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void grdExistentes_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { switch (e.ColumnIndex) { case 0: string idVenta = grdExistentes.SelectedRows[0].Cells["idVentaCol"].Value.ToString(); PV.FrmNuevaVenta frmNuevaVenta = new FrmNuevaVenta(idVenta); frmNuevaVenta.ShowDialog(this); //this._p.cargarFormNuevaVenta(idVenta); //this.idVehiculo = grdExistentes.SelectedRows[0].Cells["idVehiculoCol"].Value.ToString(); //this.padre.cargarFormIngreso(this.idVehiculo); //txtNombre.Text = grdExistentes.SelectedRows[0].Cells["lineaCol"].Value.ToString(); //cmbMarca.SelectedValue = grdExistentes.SelectedRows[0].Cells["idMarcaCol"].Value; //txtNombre.Enabled = true; //txtNombre.Focus(); break; case 1: DialogResult r = MessageBox.Show("¿Confirma que desea eliminar este registro?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (r == DialogResult.Yes) { //this.clsVehiculo.eliminar(grdExistentes.SelectedRows[0].Cells["idVehiculoCol"].Value.ToString()); ClsHelper.MensajeSistema("Proceso ejecutado exitosamente"); //limpiarControles(); } break; case 2: string r1 = grdExistentes.SelectedRows[0].Cells["adjunto1Col"].Value.ToString(); string r2 = grdExistentes.SelectedRows[0].Cells["adjunto2Col"].Value.ToString(); List <String> adjuntos = new List <string>(); if (r1 != "") { adjuntos.Add(r1); } if (r2 != "") { adjuntos.Add(r2); } FrmAdjuntos frmAdjuntos = new FrmAdjuntos(adjuntos); frmAdjuntos.ShowDialog(this); //MessageBox.Show("adjunto"); break; } } catch (Exception ex) { //this.idVehiculo = "0"; ClsHelper.erroLog(ex); } }
private void btnSiguienteCostos_Click(object sender, EventArgs e) { try { this.tabIngresoVehiculo.SelectedIndex = 3; } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void FrmCambiarContrasena_Load(object sender, EventArgs e) { try { txtUsuario.Text = this.usuario; } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void frmMarca_Load(object sender, EventArgs e) { try { buscar(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void FrmLogin_Load(object sender, EventArgs e) { try { this.CenterToScreen(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void btnGrabarFrmCosto_Click(object sender, EventArgs e) { try { this.agregarGridCosto(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void mnuRestaurar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { System.Diagnostics.Process.Start(Directory.GetCurrentDirectory() + "\\restaurarDB.exe"); } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void btnCancelarRegresar_Click(object sender, EventArgs e) { try { this.tabIngresoVehiculo.SelectedIndex = 1; } catch (Exception ex) { ClsHelper.erroLog(ex); } }
private void btnBuscar_Click(object sender, EventArgs e) { try { grdVenta.DataSource = ClsPago.buscarVentaEncabezado(txtBusqueda.Text.Trim()); cargarListaPagos(); } catch (Exception ex) { ClsHelper.erroLog(ex); } }