Esempio n. 1
0
        public async Task <IActionResult> PutServicioPaciente(Guid id, ServicioPaciente servicioPaciente)
        {
            if (id != servicioPaciente.Id)
            {
                return(BadRequest());
            }

            _context.Entry(servicioPaciente).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ServicioPacienteExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <ActionResult <ServicioPaciente> > PostServicioPaciente(ServicioPaciente servicioPaciente)
        {
            _context.ServicioPaciente.Add(servicioPaciente);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetServicioPaciente", new { id = servicioPaciente.Id }, servicioPaciente));
        }
Esempio n. 3
0
        //public static void GetCantidaddonante()
        //{
        //    return frm.cantidad;
        //}
        public static void CargarDatosComboPaciente(ref ComboBox combo)
        {
            IServicioPaciente servicioPaciente = new ServicioPaciente();
            var lista    = servicioPaciente.GetLista();
            var defaultt = new Paciente {
                PacienteID = 0, NombrePaciente = "Seleccione Paciente"
            };

            lista.Insert(0, defaultt);
            combo.DataSource    = lista;
            combo.ValueMember   = "PacienteID";
            combo.DisplayMember = "NombreCompleto";
            combo.SelectedIndex = 0;
        }
        public bool Delete(int Id)
        {
            ServicioPaciente servicioPaciente;

            try
            {
                servicioPaciente = new ServicioPaciente();
                return(servicioPaciente.EliminarFisico(Id));
            }
            catch (Exception excepcion)
            {
                throw excepcion;
            }
        }
        public bool Crear([FromBody] Paciente paciente)
        {
            ServicioPaciente servicioPaciente;

            try
            {
                servicioPaciente = new ServicioPaciente();
                return(servicioPaciente.AgregarNuevo(paciente));
            }
            catch (Exception excepcion)
            {
                throw excepcion;
            }
        }
        public List <Paciente> Listar()
        {
            ServicioPaciente servicioPaciente;

            try
            {
                servicioPaciente = new ServicioPaciente();
                return(servicioPaciente.Listar());
            }
            catch (Exception excepcion)
            {
                throw excepcion;
            }
        }
        public bool Put(int Id, [FromBody] Paciente paciente)
        {
            ServicioPaciente servicioPaciente;

            try
            {
                paciente.Id      = Id;
                servicioPaciente = new ServicioPaciente();
                return(servicioPaciente.GuardarModificado(paciente));
            }
            catch (Exception excepcion)
            {
                throw excepcion;
            }
        }