Exemplo n.º 1
0
        private void LlenarInformacionDelMunicipio()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                CiudadEN oRegistroEN = new CiudadEN();
                CiudadLN oRegistroLN = new CiudadLN();
                oRegistroEN.Where   = "";
                oRegistroEN.OrderBy = "";

                if (oRegistroLN.Listado(oRegistroEN, Program.oDatosDeConexioEN))
                {
                    cmbMunicipio.DataSource    = oRegistroLN.TraerDatos();
                    cmbMunicipio.DisplayMember = "Ciudad";
                    cmbMunicipio.ValueMember   = "IdCiudad";
                    cmbMunicipio.SelectedIndex = -1;
                }
                else
                {
                    throw new ArgumentException(oRegistroLN.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Información de los tipos de cuentas", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Exemplo n.º 2
0
        private void LlenarListado()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                CiudadEN oRegistroEN = new CiudadEN();
                CiudadLN oRegistroLN = new CiudadLN();

                oRegistroEN.Where = WhereDinamico();

                if (oRegistroLN.Listado(oRegistroEN, Program.oDatosDeConexioEN))
                {
                    dgvLista.Columns.Clear();
                    System.Diagnostics.Debug.Print(oRegistroLN.TraerDatos().Rows.Count.ToString());

                    if (ActivarFiltros == true)
                    {
                        dgvLista.DataSource = AgregarColumnaSeleccionar(oRegistroLN.TraerDatos());
                    }
                    else
                    {
                        dgvLista.DataSource = oRegistroLN.TraerDatos();
                    }

                    FormatearDGV();
                    this.dgvLista.ClearSelection();

                    tsbNoRegistros.Text = "No. Registros: " + oRegistroLN.TotalRegistros().ToString();
                }
                else
                {
                    throw new ArgumentException(oRegistroLN.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Llenar listado de registro en la lista", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }