Example #1
0
        public void ActualizarServicio(Servicio model)
        {
            try
            {
                ServicioAlojamiento servicio = _context.ServicioAlojamiento.Where(i => i.IdServicio == model.IdServicio).FirstOrDefault();
                servicio.IdServicio     = model.IdServicio;
                servicio.NombreServicio = model.NombreServicio;
                servicio.IdCliente      = model.IdCliente;
                servicio.IdBodega       = model.IdBodega;

                _context.SaveChanges();
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Example #2
0
        public void GuardarServicio(Servicio model)
        {
            try
            {
                ServicioAlojamiento servicio = new ServicioAlojamiento();
                servicio.NombreServicio = model.NombreServicio;
                servicio.IdCliente      = model.IdCliente;
                servicio.IdBodega       = model.IdBodega;
                servicio.Estado         = 1;

                _context.ServicioAlojamiento.Add(servicio);
                _context.SaveChanges();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }