예제 #1
0
        private void ListadoHotel_Load(object sender, EventArgs e)
        {
            PaisService paisService = new PaisService();
            List <Pais> paises      = paisService.GetAll().ToList();

            cmbPaises.DataSource    = paises;
            cmbPaises.DisplayMember = "Nombre";
            cmbPaises.ValueMember   = "Id";

            CiudadService ciudadService = new CiudadService();
            List <Ciudad> ciudades      = ciudadService.GetAll().ToList();

            cmbCiudades.DataSource    = ciudades;
            cmbCiudades.DisplayMember = "Nombre";
            cmbCiudades.ValueMember   = "Id";

            List <object> estrellas = new List <object>();

            estrellas.Add(new { text = "-No especificado-", value = 0 });
            estrellas.Add(new { text = "1", value = 1 });
            estrellas.Add(new { text = "2", value = 2 });
            estrellas.Add(new { text = "3", value = 3 });
            estrellas.Add(new { text = "4", value = 4 });
            estrellas.Add(new { text = "5", value = 5 });
            cmbEstrellas.DataSource    = estrellas;
            cmbEstrellas.DisplayMember = "text";
            cmbEstrellas.ValueMember   = "value";
        }
예제 #2
0
 public ReporteProveedoresParametrizado()
 {
     InitializeComponent();
     oSoporteForm   = new SoporteForm();
     oBarrioService = new BarrioService();
     oCiudadService = new CiudadService();
 }
예제 #3
0
 public ReporteSociosParametrizados()
 {
     InitializeComponent();
     oSoporteForm          = new SoporteForm();
     oBarrioService        = new BarrioService();
     oCiudadService        = new CiudadService();
     oTipoDocumentoService = new TipoDocumentoService();
 }
예제 #4
0
 public EditMuestra2(string id)
 {
     idMuestra        = id;
     context          = new CataneiContext();
     serviceProductor = new PersonService(new UnitOfWork(context), new PersonRepository(context));
     serviceCiudad    = new CiudadService(new UnitOfWork(context), new CiudadRepository(context));
     serviceMuestra   = new MuestraService(new UnitOfWork(context), new MuestraRepository(context));
     InitializeComponent();
 }
 public AltaProovedorForm(Proovedor proveedor, CiudadService ciudadService, RubroService rubroService, DireccionService direccionService, ProveedorService proveedorService)
 {
     this.proveedor        = proveedor;
     this.rubroService     = rubroService;
     this.ciudadService    = ciudadService;
     this.direccionService = direccionService;
     this.proveedorService = proveedorService;
     InitializeComponent();
     cargarComboRubro();
     llenarComboCiudad();
     cargarPantalla();
 }
        // POST api/<controller>
        public HttpResponseMessage Post([FromBody] Ciudad c)
        {
            HttpResponseMessage response;

            try
            {
                CiudadService service = (CiudadService) new CiudadService().setDatabase(db);
                c.FechaAlta   = DateTime.Today;
                c.UsuarioAlta = 1;
                c             = service.saveOrUpdate(c);

                response = this.getSuccessResponse(c);
            }
            catch (Exception e)
            {
                response = this.getErrorResponse(e);
            }
            return(response);
        }
        // GET api/Ciudad/5
        public HttpResponseMessage GetCiudad(long id)
        {
            HttpResponseMessage response;

            try
            {
                CiudadService service = (CiudadService) new CiudadService().setDatabase(db);
                Ciudad        c       = service.find(id);

                service.delete(id);

                response = this.getSuccessResponse(c);
            }
            catch (Exception e)
            {
                response = this.getErrorResponse(e);
            }
            return(response);
        }
        // GET api/Ciudad/Get
        public HttpResponseMessage Get()
        {
            HttpResponseMessage response;

            try
            {
                CiudadService service  = (CiudadService) new CiudadService().setDatabase(db);
                List <Ciudad> ciudades = service.getAll();



                response = this.getSuccessResponse(ciudades);
            }
            catch (Exception e)
            {
                response = this.getErrorResponse(e);
            }
            return(response);
        }
예제 #9
0
        static void Main(string[] args)
        {
            SampleArchContext context = new SampleArchContext();

            CiudadService service = new CiudadService(new UnitOfWork(context), new CiudadRepository(context));

            Ciudad country = new Ciudad()
            {
                Nombre = "Colombia"
            };

            service.Create(country);

            List <Ciudad> countries = service.GetAll().ToList();

            foreach (var item in countries)
            {
                System.Console.WriteLine(item.Name);
            }

            System.Console.ReadKey();
        }
예제 #10
0
 public CiudadController(CiudadService ciudadService)
 {
     _ciudadService = ciudadService;
 }
예제 #11
0
 public CiudadController()
 {
     context       = new SlsContext();
     CiudadService = new CiudadService(context);
     Mapper        = ConfigureAutoMapper.MapperConfiguration.CreateMapper();
 }
예제 #12
0
 public NewSesion()
 {
     context = new CataneiContext();
     service = new CiudadService(new UnitOfWork(context), new CiudadRepository(context));
     InitializeComponent();
 }
예제 #13
0
 public CiudadController(ApiContext context)
 {
     _ciudadService = new CiudadService(context);
 }