Ejemplo n.º 1
0
        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(
        }
Ejemplo n.º 2
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);
            }
        }