private void btnBuscarConductor_Click(object sender, EventArgs e)
 {
     try
     {
         LimpiarConductor();
         DataSet oInformacion = new DataSet();
         oInformacion.Load(OHelper.RecuperarConductoresPorCliente(txtIdentificacionCliente.Text), LoadOption.Upsert, "Cliente");
         Controles.frmAyuda oAyuda = new frmAyuda();
         oAyuda.TituloVentana       = "Conductores";
         oAyuda.UbicacionFormulario = FormStartPosition.CenterParent;
         oAyuda.Informacion         = oInformacion.Tables[0];
         oAyuda.ColumnReturn        = 0;
         oAyuda.ShowDialog();
         if (string.IsNullOrEmpty(oAyuda.ValorRegistroSeleccionado))
         {
             txtDocumento.Text = "";
             // throw new Exception("No hay Conductores registrados para este cliente.");
         }
         else
         {
             txtDocumento.Text = oAyuda.ValorRegistroSeleccionado.ToString();
             //txtNombre.Text = oAyuda.RowSelect.Cells[1].ToString();
         }
         oAyuda.Dispose();
     }
     catch (Exception ex)
     {
         Popup.ContentText = ex.Message;
         Popup.Popup();
     }
 }
 private void buscarDescuentos()
 {
     try
     {
         Controles.frmAyuda oAyuda = new frmAyuda();
         oAyuda.TituloVentana       = "Precios Clientes";
         oAyuda.UbicacionFormulario = FormStartPosition.CenterParent;
         oAyuda.Informacion         = OHelper.RecuperarPrecioClienteCredito(this.txtCliente.Text).Tables[0];
         oAyuda.ColumnReturn        = 0;
         oAyuda.ShowDialog();
         if ((string.IsNullOrEmpty(oAyuda.ValorRegistroSeleccionado)) == false)
         {
             this.RecuperaInformacion(oAyuda.ValorRegistroSeleccionado);
             oPrecioCliente = Convert.ToInt32(oAyuda.ValorRegistroSeleccionado.ToString());
         }
         oAyuda.Dispose();
         pnlDescuento.Enabled        = true;
         pnlDetalle.Enabled          = true;
         txtCliente.Enabled          = true;
         pnlDescuento.Enabled        = true;
         gbDescuento.Enabled         = true;
         gbPorcentaje.Enabled        = true;
         chkEstado.Enabled           = true;
         chkAplicaEnSurtidor.Enabled = true;
         txtValor.Enabled            = true;
         mnuGuardar.Enabled          = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Precio Cliente", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#3
0
        private void mnuCredito__Click(object sender, EventArgs e)
        {
            Controles.frmAyuda oAyuda = new frmAyuda();
            try
            {
                oAyuda.TituloVentana       = "Creditos Asociados";
                oAyuda.UbicacionFormulario = FormStartPosition.CenterParent;
                oAyuda.Informacion         = OHelper.RecuperarIdCreditoLocal(oPlaca).Tables[0];
                oAyuda.ColumnReturn        = 0;
                oAyuda.ShowDialog();

                if (string.IsNullOrEmpty(oAyuda.ValorRegistroSeleccionado) == false)
                {
                    if (!string.IsNullOrEmpty(txtNuip.Text.Trim()))
                    {
                        FrmCreditoPorVehiculo frm = new FrmCreditoPorVehiculo();
                        frm.Dni       = txtNuip.Text;
                        frm.IdCredito = oAyuda.ValorRegistroSeleccionado.ToString();
                        frm.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Vehiculo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                oAyuda.Dispose();
            }
        }
示例#4
0
 private void txtNuipPropietario_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         DataSet oInformacion = new DataSet();
         oInformacion.Load(OHelper.RecuperarClienteLocal("*"), LoadOption.Upsert, "Cliente");
         Controles.frmAyuda oAyuda = new frmAyuda();
         oAyuda.TituloVentana       = "Propietario";
         oAyuda.UbicacionFormulario = FormStartPosition.CenterParent;
         oAyuda.Informacion         = oInformacion.Tables[0];
         oAyuda.ColumnReturn        = 0;
         oAyuda.ShowDialog();
         if (string.IsNullOrEmpty(oAyuda.ValorRegistroSeleccionado))
         {
             txtPropietario.Text = "";
         }
         else
         {
             txtPropietario.Text = oAyuda.ValorRegistroSeleccionado.ToString();
         }
         oAyuda.Dispose();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Vehiculo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#5
0
 private void indexToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (ayuda == null)
     {
         ayuda           = new frmAyuda();
         ayuda.MdiParent = this;
         ayuda.Show();
     }
     else
     {
         ayuda.Activate();
     }
 }
        private void mnuBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable oRestriccion = new DataTable();
                Int16     oIndice;
                frmAyuda  oAyuda = new frmAyuda();
                string    oNuip  = Inputbox.Show("Buqueda Placa", "Digite la placa que desea consultar.", FormStartPosition.CenterScreen);
                oAyuda.Informacion  = oHelper.RecuperarDatosVehiculoRestriccion(oNuip);
                oAyuda.ColumnReturn = 0;
                oAyuda.ShowDialog();
                if (string.IsNullOrEmpty(oAyuda.ValorRegistroSeleccionado) == false)
                {
                    Vehiculo        = Int64.Parse(oAyuda.RowSelect.Cells[0].Value.ToString());
                    lblPlaca.Text   = oAyuda.RowSelect.Cells[1].Value.ToString();
                    lblCliente.Text = oAyuda.RowSelect.Cells[2].Value.ToString();
                    TabBasica(false);
                    TabProducto(false);
                    TabDia(false);
                    oRestriccion = oHelper.RecuperarRestriccionesTipo(lblPlaca.Text);
                    if (oRestriccion.Rows.Count > 0)
                    {
                        oIndice = Int16.Parse(oRestriccion.Rows[0][0].ToString());
                        switch (oIndice)
                        {
                        case 0:
                            dtgHoraDia.DataSource         = oRestriccion;
                            dtgHoraDia.Columns[0].Visible = false;
                            break;

                        case 2:
                            dtgDia.DataSource = oRestriccion;
                            break;

                        case 1:
                            dtgHoras.DataSource = oRestriccion;
                            break;
                        }
                    }
                }
                oAyuda.Close();
                oAyuda.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Restricciones - Buscar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            //Inputbox.Show(
        }
示例#7
0
        //void CerrarAyuda() {
        //    try
        //    {

        //        this.Visible = true;
        //    }
        //    catch (Exception ex)
        //    {

        //        MessageBox.Show(ex.Message);
        //    }
        //}

        public void IniciarForma()
        {
            try
            {
                txtDocumento.Clear();
                txtMonto.Clear();
                txtComentario.Clear();
                txtNuevoCupoVehiculo.Clear();
                txtPlaca.Clear();
                cmbAfectacion.SelectedItem = 0;
                dtpFecha.Value             = DateTime.Now;
                lblCredito.Text            = "";
                lblEmpresa.Text            = "";
                lblCupo.Text        = "";
                lblSaldo.Text       = "";
                lblEstado.Text      = "";
                lblTipoCredito.Text = "";
                lblFechaCreado.Text = "";


                Controles.frmAyuda oAyuda = new frmAyuda();
                // oAyuda.Cerrar += CerrarAyuda;
                oAyuda.Informacion         = oHelper.RecuperarPrepago(Nuip);
                oAyuda.UbicacionFormulario = FormStartPosition.CenterParent;
                oAyuda.ColumnReturn        = 1;
                oAyuda.ShowDialog();
                if (string.IsNullOrEmpty(oAyuda.ValorRegistroSeleccionado) == false)
                {
                    lblCredito.Text     = oAyuda.RowSelect.Cells[0].Value.ToString();
                    lblEmpresa.Text     = oAyuda.RowSelect.Cells[2].Value.ToString();
                    lblCupo.Text        = oAyuda.RowSelect.Cells[3].Value.ToString();
                    lblSaldo.Text       = oAyuda.RowSelect.Cells[4].Value.ToString();
                    lblEstado.Text      = oAyuda.RowSelect.Cells[8].Value.ToString();
                    lblTipoCredito.Text = oAyuda.RowSelect.Cells[6].Value.ToString();
                    lblFechaCreado.Text = oAyuda.RowSelect.Cells[7].Value.ToString();
                }
                oAyuda.Close();
                oAyuda.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Prepagos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
示例#8
0
        private void btnAdicionar_Click(object sender, EventArgs e)
        {
            try
            {
                DataGridViewRow oRow;
                DataRow         oFila;

                Controles.frmAyuda oAyuda = new frmAyuda();
                oAyuda.Informacion         = oHelper.RecuperarEncabezadoCredito("*", Helper.oAccion.EsComodin).Tables[0];
                oAyuda.UbicacionFormulario = FormStartPosition.CenterScreen;
                oAyuda.ShowDialog();
                if (string.IsNullOrEmpty(oAyuda.ValorRegistroSeleccionado) == false)
                {
                    oRow = oAyuda.RowSelect;
                    foreach (DataGridViewRow oGRow in dtgCreditos.Rows)
                    {
                        if (oGRow.Cells[1].Value.ToString().Trim() == oRow.Cells[0].Value.ToString().Trim())
                        {
                            Popup.ContentText = "El Cliente que intenta ingresar ya existe";
                            Popup.Popup();
                            return;
                        }
                    }


                    oFila = oFacturar.NewRow();
                    for (int i = 0; i <= oRow.Cells.Count - 1; i++)
                    {
                        oFila[i] = oRow.Cells[i].Value;
                    }
                    oFacturar.Rows.Add(oFila);
                    dtgCreditos.DataSource = oFacturar;
                }
                oAyuda.Dispose();
            }
            catch (Exception ex)
            {
                Popup.ContentText = ex.Message;
                Popup.Popup();
            }
        }
示例#9
0
 private void mnuVehiculos_Click(object sender, EventArgs e)
 {
     try
     {
         Controles.frmAyuda oAyuda = new frmAyuda();
         oAyuda.TituloVentana       = "Vehiculos Asociados";
         oAyuda.UbicacionFormulario = FormStartPosition.CenterParent;
         oAyuda.Informacion         = OHelper.RecuperarVehiculosporClienteLocal(txtDocumento.Text.Trim()).Tables[0];
         oAyuda.ColumnReturn        = 0;
         oAyuda.ShowDialog();
         if ((string.IsNullOrEmpty(oAyuda.ValorRegistroSeleccionado)) == false)
         {
             //oVehiculo.Placa = oAyuda.ValorRegistroSeleccionado;
             EventCliente Arg = new EventCliente(oAyuda.ValorRegistroSeleccionado.ToString(), true);
             MostrarVehiculo(this, Arg);
         }
         oAyuda.Dispose();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Vehiculo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }