示例#1
0
        public void CargarGrillaPais()
        {
            try
            {
                AgenciaServiceReference.SvcPaisClient client = new AgenciaServiceReference.SvcPaisClient();

                var data = client.Consultar();
                GrdPais.DataSource = data;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
        //public void CargarCiudadOrigen(int PaisID)
        //{
        //    try
        //    {
        //        CiudadServiceReference.SvcCiudadClient clientCiudad = new CiudadServiceReference.SvcCiudadClient();
        //        var data = clientCiudad.Consultar();
        //        data = data.Where(s=> s.PaisID==PaisID).ToList();
        //        cbCiudadOrigen.DataSource = data;
        //        cbCiudadOrigen.ValueMember = "CiudadID";
        //        cbCiudadOrigen.DisplayMember = "CiudadNombre";
        //    }
        //    catch (Exception)
        //    {

        //        throw;
        //    }
        //}

        public void CargarPaisDestino()
        {
            try
            {
                AgenciaServiceReference.SvcPaisClient ClientPais = new AgenciaServiceReference.SvcPaisClient();
                cbPaisDestino.SelectedIndex = -1;
                var data = ClientPais.Consultar();
                cbPaisDestino.DataSource    = data;
                cbPaisDestino.ValueMember   = "PaisID";
                cbPaisDestino.DisplayMember = "PaisNombre";
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#3
0
        public bool CargarObjetoPais()
        {
            try
            {
                AgenciaServiceReference.SvcPaisClient ClientPais = new AgenciaServiceReference.SvcPaisClient();
                AgenciaServiceReference.Pais          objPais    = new AgenciaServiceReference.Pais();

                objPais.PaisNombre = txtPais.Text;

                objPais.PaisFecha = DateTime.Now;
                var data = ClientPais.Insertar(objPais);

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }