public List <Centro> obtenerCentros() { try { DACentros daCentros = new DACentros(); List <Centro> list = daCentros.traerCentros(); if (list.Count > 0) { return(list); } else { return(null); } } catch (Exception ex) { throw ex; } }
public int RegistrarProfesional(Profesional profesional, List <string> p_especialidades) { try { DAProfesional DaProfesional = new DAProfesional(); profesional.IdProfesional = DaProfesional.DaRegistrarProfesional(profesional); //tomar centros if (profesional.IdProfesional > 0) { DACentros centros = new DACentros(); List <Centro> listaCentros = centros.traerCentros(); foreach (Centro centro in listaCentros) { foreach (string id_especialidad in p_especialidades) { ProfesionalDetalle profDetalle = new ProfesionalDetalle(); profDetalle.Profesional = profesional; profDetalle.Centro = centro; Especialidad especialidad = new Especialidad(); especialidad.IdEspecialidad = Convert.ToInt32(id_especialidad); profDetalle.Especialidad = especialidad; profDetalle.UsuarioAlta = profesional.UsuarioAlta; profDetalle.FechaAlta = DateTime.Now; DAProfesionalDetalle DaProfDetalle = new DAProfesionalDetalle(); int IdProfDetalle = DaProfDetalle.DaRegistrarProfesionalDetalle(profDetalle); } } } return(profesional.IdProfesional); } catch (Exception e) { throw e; } }