Exemple #1
0
        public static void CargarDatosComboPaises(ref ComboBox combo)
        {
            ServicioPais servicio    = new ServicioPais();
            var          lista       = servicio.GetLista();
            Pais         defaultPais = new Pais {
                PaisId = 0, Nombre = "<Seleccione País>"
            };

            lista.Insert(0, defaultPais);
            combo.DataSource    = lista;
            combo.DisplayMember = "Nombre";
            combo.ValueMember   = "PaisId";
            combo.SelectedIndex = 0;
        }
Exemple #2
0
        public static void CargarDatosComboPais(ref ComboBox comboPais)
        {
            ServicioPais servicio    = new ServicioPais();
            var          lista       = servicio.GetLista();
            Pais         paisDefault = new Pais();

            paisDefault.PaisId = 0;
            paisDefault.Nombre = "<Seleccionar Pais>";
            lista.Insert(0, paisDefault);
            comboPais.DataSource    = lista;
            comboPais.DisplayMember = "Nombre";
            comboPais.ValueMember   = "PaisId";
            comboPais.SelectedIndex = 0;
        }
Exemple #3
0
 private void PaisesForm_Load(object sender, EventArgs e)
 {
     this.Dock = DockStyle.Fill;
     try
     {
         servicio = new ServicioPais();
         lista    = servicio.GetLista();
         MostrarDatosEnGrilla();
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, "Error",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #4
0
        private void ImprimirToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                lista = servicio.GetLista();
                var manejadorReportes = new ManejadorDeReportes();

                PaisesReporte rpt = manejadorReportes.GetPaisesReporte(lista);
                ReportesForm  frm = new ReportesForm();
                frm.SetReporte(rpt);
                frm.ShowDialog(this);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
                throw;
            }
        }
Exemple #5
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            ServicioPais servicioPais = new ServicioPais();

            ComboBoxPais.DataSource = null;
            List <Pais> lista         = servicioPais.GetLista();
            var         defaultMedida = new Pais {
                PaisID = 0, pais = "[Seleccione]"
            };

            lista.Insert(0, defaultMedida);
            ComboBoxPais.DataSource    = lista;
            ComboBoxPais.DisplayMember = "pais";
            ComboBoxPais.ValueMember   = "PaisID";
            ComboBoxPais.SelectedIndex = 0;
            if (provincia != null)
            {
                ComboBoxPais.SelectedValue = provincia.Pais.PaisID;
                textBoxProvincia.Text      = provincia.provincia;
                _esEdicion = true;
            }
        }
Exemple #6
0
 private void Iniciar()
 {
     _servicio = new ServicioPais();
     _lista    = _servicio.GetLista();
     MostrarEnGrilla();
 }