예제 #1
0
파일: InstructorBl.cs 프로젝트: 1000VIA/SRA
        public List <Ficha_AmbienteDTO> ReporteDeProgramacionInstructores(int IdInstructor, DateTime FechaInicio, DateTime FechaFin)
        {
            Model1 entity = new Model1();

            DateTime FechaTemporal = DateTime.Today;


            var Programacion = (from i in entity.Ficha_Ambiente
                                where i.IdInstructor == IdInstructor &&
                                ((i.FechaInicio >= FechaInicio && i.FechaInicio <= FechaFin) ||
                                 (i.FechaFin <= FechaFin && i.FechaFin >= FechaInicio) ||
                                 (i.FechaInicio <= FechaInicio && i.FechaFin >= FechaFin))
                                orderby i.Jornada ascending
                                select i).ToList();

            var instructor = (from i in entity.Instructor
                              where i.IdInstructor == IdInstructor
                              select i).FirstOrDefault();



            List <Ficha_AmbienteDTO> Datos = new List <Ficha_AmbienteDTO>();

            foreach (var item in Programacion)
            {
                var DatosFicha = (from i in entity.Ficha
                                  where i.IdFicha == item.IdFicha
                                  select i).FirstOrDefault();
                var DatosResultado = (from i in entity.Resultado_Aprendizaje
                                      where i.IdResultado == item.IdResultado
                                      select i).FirstOrDefault();
                var DatosAmbiente = (from i in entity.Ambiente
                                     where i.IdAmbiente == item.IdAmbiente
                                     select i).FirstOrDefault();


                Ficha_AmbienteDTO Ficha = new Ficha_AmbienteDTO();
                Ficha.Id               = item.Id;
                Ficha.Ambiente         = DatosAmbiente.Numero;
                Ficha.Ficha            = DatosFicha.Ficha1;
                Ficha.Resultado        = DatosResultado.Resultado;
                Ficha.NombreInstructor = instructor.Nombre + instructor.Apellido;
                Ficha.FechaInicio      = item.FechaInicio;
                Ficha.FechaFin         = item.FechaFin;
                Ficha.HoraInicio       = item.HoraInicio;
                Ficha.HoraFin          = item.HoraFin;
                Ficha.Lunes            = item.Lunes;
                Ficha.Martes           = item.Martes;
                Ficha.Miercoles        = item.Miercoles;
                Ficha.Jueves           = item.Jueves;
                Ficha.Viernes          = item.Viernes;
                Ficha.NumeroJornada    = item.Jornada;

                Datos.Add(Ficha);
            }

            return(Datos);
        }
예제 #2
0
 public IHttpActionResult EliminarReciboLlaves(Ficha_AmbienteDTO oProgramacion)
 {
     try
     {
         ProgramacionBl oProgramacionBl = new ProgramacionBl();
         var            datos           = oProgramacionBl.EliminarReciboLlaves(oProgramacion);
         return(Ok(new { success = true, datos }));
     }
     catch (Exception exc)
     {
         return(Ok(new { success = false, exc.Message }));
     }
 }
예제 #3
0
 public IHttpActionResult ConsultaEliminarProgramacionTransversales(Ficha_AmbienteDTO oFicha_Ambiente)
 {
     try
     {
         ProgramacionBl oProgramacionBl = new ProgramacionBl();
         var            programaciones  = oProgramacionBl.ConsultaEliminarProgramacionTransversales(oFicha_Ambiente);
         return(Ok(new { success = true, programaciones }));
     }
     catch (Exception exc)
     {
         return(Ok(new { success = false, exc.Message }));
     }
 }
예제 #4
0
파일: InstructorBl.cs 프로젝트: 1000VIA/SRA
        public List <Ficha_AmbienteDTO> EnviarProgramacionInstructor(DateTime FechaInicio, DateTime FechaFin, int IdInstructor)
        {
            Model1 entity = new Model1();
            var    Datos  = (from i in entity.Ficha_Ambiente
                             where i.IdInstructor == IdInstructor && (i.FechaInicio >= FechaInicio &&
                                                                      i.FechaInicio <= FechaFin &&
                                                                      i.FechaFin >= FechaInicio &&
                                                                      i.FechaFin <= FechaFin)
                             select i).ToList();

            List <Ficha_AmbienteDTO> Programacion = new List <Ficha_AmbienteDTO>();

            foreach (var item in Datos)
            {
                Ficha_AmbienteDTO Ficha = new Ficha_AmbienteDTO();
                var DatosFicha          = (from i in entity.Ficha
                                           where i.IdFicha == item.IdFicha
                                           select i).FirstOrDefault();
                var DatosResultado = (from i in entity.Resultado_Aprendizaje
                                      where i.IdResultado == item.IdResultado
                                      select i).FirstOrDefault();
                var DatosAmbiente = (from i in entity.Ambiente
                                     where i.IdAmbiente == item.IdAmbiente
                                     select i).FirstOrDefault();

                Ficha.Id           = item.Id;
                Ficha.Ambiente     = DatosAmbiente.Numero;
                Ficha.Ficha        = DatosFicha.Ficha1;
                Ficha.Resultado    = DatosResultado.Resultado;
                Ficha.IdInstructor = item.IdInstructor;
                Ficha.FechaInicio  = item.FechaInicio;
                Ficha.FechaFin     = item.FechaFin;
                Ficha.HoraInicio   = item.HoraInicio;
                Ficha.HoraFin      = item.HoraFin;
                Ficha.Color        = item.Color;
                Programacion.Add(Ficha);
            }
            return(Programacion);
        }