Esempio n. 1
0
 public void GuardarCheckList(CheckListRoladoraInfo checkListRoladora
                              , CheckListRoladoraGeneralInfo checkListRoladoraGeneral
                              , List <CheckListRoladoraDetalleInfo> checkListRoladoraDetalle
                              , int organizacionID)
 {
     try
     {
         Logger.Info();
         using (var scope = new TransactionScope())
         {
             GuardarCheckListRolado(checkListRoladora, checkListRoladoraGeneral, checkListRoladoraDetalle,
                                    organizacionID);
             scope.Complete();
         }
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Esempio n. 2
0
        private void GuardarCheckListRolado(CheckListRoladoraInfo checkListRoladora
                                            , CheckListRoladoraGeneralInfo checkListRoladoraGeneral
                                            , List <CheckListRoladoraDetalleInfo> checkListRoladoraDetalle
                                            , int organizacionID)
        {
            CheckListRoladoraInfo ultimoCheckListRoladora = ValidarCheckList(organizacionID);

            if (ultimoCheckListRoladora == null)
            {
                ultimoCheckListRoladora = new CheckListRoladoraInfo
                {
                    CheckListRoladoraGeneral = new CheckListRoladoraGeneralInfo()
                };
            }
            if (ultimoCheckListRoladora.CheckListRoladoraGeneral.Turno == checkListRoladoraGeneral.Turno)
            {
                checkListRoladora.CheckListRoladoraID               = ultimoCheckListRoladora.CheckListRoladoraID;
                checkListRoladora.CheckListRoladoraGeneral          = ultimoCheckListRoladora.CheckListRoladoraGeneral;
                checkListRoladoraGeneral.CheckListRoladoraGeneralID =
                    ultimoCheckListRoladora.CheckListRoladoraGeneral.CheckListRoladoraGeneralID;

                GuardarCheckListTurnoExistente(checkListRoladora, checkListRoladoraGeneral, checkListRoladoraDetalle, new List <CheckListRoladoraHorometroInfo>());
            }
            else
            {
                GuardarCheckListTurnoNuevo(checkListRoladora, checkListRoladoraGeneral, checkListRoladoraDetalle, new List <CheckListRoladoraHorometroInfo>());
            }
        }
 /// <summary>
 ///  Método que obtiene un registro
 /// </summary>
 /// <param name="ds"></param>
 /// <returns></returns>
 public static CheckListRoladoraGeneralInfo ObtenerPorDescripcion(DataSet ds)
 {
     try
     {
         Logger.Info();
         DataTable dt = ds.Tables[ConstantesDAL.DtDatos];
         CheckListRoladoraGeneralInfo entidad =
             (from info in dt.AsEnumerable()
              select
              new CheckListRoladoraGeneralInfo
         {
             CheckListRoladoraGeneralID = info.Field <int>("CheckListRoladoraGeneralID"),
             Turno = info.Field <int>("Turno"),
             FechaInicio = info.Field <DateTime>("FechaInicio"),
             Observaciones = info.Field <string>("Observaciones"),
             SurfactanteInicio = info.Field <decimal>("SurfactanteInicio"),
             SurfactanteFin = info.Field <decimal>("SurfactanteFin"),
             ContadorAguaInicio = info.Field <decimal>("ContadorAguaInicio"),
             ContadorAguaFin = info.Field <decimal>("ContadorAguaFin"),
             GranoEnteroFinal = info.Field <decimal>("GranoEnteroFinal"),
             Activo = info.Field <bool>("Activo").BoolAEnum(),
         }).First();
         return(entidad);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
 /// <summary>
 /// Metodo para Crear un registro de CheckListRoladoraGeneral
 /// </summary>
 /// <param name="info">Valores de la entidad que será creada</param>
 public int Crear(CheckListRoladoraGeneralInfo info)
 {
     try
     {
         Logger.Info();
         Dictionary <string, object> parameters = AuxCheckListRoladoraGeneralDAL.ObtenerParametrosCrear(info);
         int result = Create("CheckListRoladoraGeneral_Crear", parameters);
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
 /// <summary>
 /// Obtiene un registro de CheckListRoladoraGeneral
 /// </summary>
 /// <param name="descripcion">Descripción de la CheckListRoladoraGeneral</param>
 /// <returns></returns>
 public CheckListRoladoraGeneralInfo ObtenerPorDescripcion(string descripcion)
 {
     try
     {
         Logger.Info();
         Dictionary <string, object> parameters = AuxCheckListRoladoraGeneralDAL.ObtenerParametrosPorDescripcion(descripcion);
         DataSet ds = Retrieve("CheckListRoladoraGeneral_ObtenerPorDescripcion", parameters);
         CheckListRoladoraGeneralInfo result = null;
         if (ValidateDataSet(ds))
         {
             result = MapCheckListRoladoraGeneralDAL.ObtenerPorDescripcion(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
 /// <summary>
 ///  Obtiene parametros para actualizar
 /// </summary>
 /// <param name="info">Valores de la entidad</param>
 /// <returns></returns>
 public static Dictionary <string, object> ObtenerParametrosActualizar(CheckListRoladoraGeneralInfo info)
 {
     try
     {
         Logger.Info();
         var parametros =
             new Dictionary <string, object>
         {
             { "@CheckListRoladoraGeneralID", info.CheckListRoladoraGeneralID },
             { "@Turno", info.Turno },
             { "@Observaciones", info.Observaciones },
             { "@SurfactanteInicio", info.SurfactanteInicio },
             { "@SurfactanteFin", info.SurfactanteFin },
             { "@ContadorAguaInicio", info.ContadorAguaInicio },
             { "@ContadorAguaFin", info.ContadorAguaFin },
             { "@GranoEnteroFinal", info.GranoEnteroFinal },
             { "@Activo", info.Activo },
             { "@UsuarioModificacionID", info.UsuarioModificacionID },
             { "@UsuarioIDSupervisor", info.UsuarioIDSupervisor.HasValue ? info.UsuarioIDSupervisor : null },
         };
         return(parametros);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Esempio n. 7
0
        ///// <summary>
        ///// Obtiene una entidad de CheckListRoladoraGeneral por su descripcion
        ///// </summary>
        ///// <param name="descripción">Obtiene una entidad CheckListRoladoraGeneral por su descripcion</param>
        ///// <returns></returns>
        //public CheckListRoladoraGeneralInfo ObtenerPorDescripcion(string descripcion)
        //{
        //    try
        //    {
        //        Logger.Info();
        //        return this.ObtenerTodos().Where(e=> e.CheckListRoladoraGeneralID.ToLower() == descripcion.ToLower()).FirstOrDefault();
        //    }
        //    catch(ExcepcionGenerica)
        //    {
        //        throw;
        //    }
        //    catch(Exception ex)
        //    {
        //        Logger.Error(ex);
        //        throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
        //    }
        //}

        /// <summary>
        /// Metodo para Guardar/Modificar una entidad CheckListRoladoraGeneral
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int Guardar(CheckListRoladoraGeneralInfo info)
        {
            try
            {
                Logger.Info();
                var id = 0;
                if (info.CheckListRoladoraGeneralID > 0)
                {
                    id = da.Actualizar <CheckListRoladoraGeneralInfo>(info);
                    checkListRoladoraGeneralAccessor.ActualizarFechaModificacion(info.CheckListRoladoraGeneralID);
                }
                else
                {
                    id = da.Insertar <CheckListRoladoraGeneralInfo>(info);
                }
                return(id);
            }
            catch (ExcepcionGenerica)
            {
                throw;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
            }
        }
Esempio n. 8
0
 public void GuardarParametrosCheckList(List <CheckListRoladoraInfo> listaCheckListRoladora
                                        , CheckListRoladoraGeneralInfo checkListRoladoraGeneral
                                        , List <CheckListRoladoraHorometroInfo> listaCheckListRoladoraHorometro
                                        , int organizacionID)
 {
     GuardarCheckListRoladoParametro(listaCheckListRoladora, checkListRoladoraGeneral, new List <CheckListRoladoraDetalleInfo>(),
                                     listaCheckListRoladoraHorometro, organizacionID);
 }
Esempio n. 9
0
        public static string GuardarParametrosCheckList(List <CheckListRoladoraInfo> listaCheckListRoladora
                                                        , CheckListRoladoraGeneralInfo checkListRoladoraGeneral
                                                        , List <CheckListRoladoraHorometroInfo> listaCheckListRoladoraHorometro)
        {
            using (var checkListRoladoBL = new CheckListRoladoraBL())
            {
                int organizacionID = ObtenerOrganizacionID();
                checkListRoladoBL.GuardarParametrosCheckList(listaCheckListRoladora, checkListRoladoraGeneral, listaCheckListRoladoraHorometro, organizacionID);
            }
            string resultado = NotificacionesActuales();

            return(resultado);
        }
Esempio n. 10
0
        public static string GuardarCheckList(CheckListRoladoraInfo checkListRoladora
                                              , CheckListRoladoraGeneralInfo checkListRoladoraGeneral
                                              , List <CheckListRoladoraDetalleInfo> checkListRoladoraDetalle)
        {
            using (var checkListRoladoBL = new CheckListRoladoraBL())
            {
                int organizacionID = ObtenerOrganizacionID();
                checkListRoladoBL.GuardarCheckList(checkListRoladora, checkListRoladoraGeneral,
                                                   checkListRoladoraDetalle, organizacionID);
            }
            string resultado = NotificacionesActuales();

            return(resultado);
        }
        ///// <summary>
        ///// Obtiene una entidad de CheckListRoladoraGeneral por su descripcion
        ///// </summary>
        ///// <param name="checkListRoladoraGeneralId">Obtiene una entidad CheckListRoladoraGeneral por su descripcion</param>
        ///// <returns></returns>
        //public CheckListRoladoraGeneralInfo ObtenerPorDescripcion(string descripcion)
        //{
        //    try
        //    {
        //        Logger.Info();
        //        return checkListRoladoraGeneralDAL.ObtenerTodos().Where(e=> e.CheckListRoladoraGeneralID.ToLower() == descripcion.ToLower()).FirstOrDefault();
        //    }
        //    catch(ExcepcionGenerica)
        //    {
        //        throw;
        //    }
        //    catch(Exception ex)
        //    {
        //        Logger.Error(ex);
        //        throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
        //    }
        //}

        /// <summary>
        /// Metodo para Guardar/Modificar una entidad CheckListRoladoraGeneral
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int Guardar(CheckListRoladoraGeneralInfo info)
        {
            try
            {
                Logger.Info();
                return(checkListRoladoraGeneralDAL.Guardar(info));
            }
            catch (ExcepcionGenerica)
            {
                throw;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
            }
        }
Esempio n. 12
0
        private void GuardarCheckListTurnoExistente(CheckListRoladoraInfo checkListRoladora
                                                    , CheckListRoladoraGeneralInfo checkListRoladoraGeneral
                                                    , List <CheckListRoladoraDetalleInfo> checkListRoladoraDetalle
                                                    , List <CheckListRoladoraHorometroInfo> listaCheckListRoladoraHorometro)
        {
            using (var transaction = new TransactionScope())
            {
                var checkListRoladoraGeneralDAL = new Integracion.DAL.Implementacion.CheckListRoladoraGeneralDAL();
                checkListRoladoraGeneralDAL.Actualizar(checkListRoladoraGeneral);

                var checkListRoladoraDALAnterior = new Integracion.DAL.Implementacion.CheckListRoladoraDAL();
                int checkListoRoladoraID         = checkListRoladoraDALAnterior.Crear(checkListRoladora);

                if (checkListRoladoraDetalle != null && checkListRoladoraDetalle.Any())
                {
                    checkListRoladoraDetalle.ForEach(ids => ids.CheckListRoladoraID = checkListoRoladoraID);
                    var checkListoRoladoraDetalleDAL = new Integracion.DAL.Implementacion.CheckListRoladoraDetalleDAL();
                    checkListoRoladoraDetalleDAL.Crear(checkListRoladoraDetalle);
                }
                transaction.Complete();
            }
        }
 /// <summary>
 /// Metodo para actualizar un registro de CheckListRoladoraGeneral
 /// </summary>
 /// <param name="info">Valores de la entidad que se actualizarán</param>
 public void Actualizar(CheckListRoladoraGeneralInfo info)
 {
     try
     {
         Logger.Info();
         Dictionary <string, object> parameters = AuxCheckListRoladoraGeneralDAL.ObtenerParametrosActualizar(info);
         Update("CheckListRoladoraGeneral_Actualizar", parameters);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Esempio n. 14
0
        private void GuardarCheckListRoladoParametro(List <CheckListRoladoraInfo> listaCheckListRoladora
                                                     , CheckListRoladoraGeneralInfo checkListRoladoraGeneral
                                                     , List <CheckListRoladoraDetalleInfo> checkListRoladoraDetalle
                                                     , List <CheckListRoladoraHorometroInfo> listaCheckListRoladoraHorometro
                                                     , int organizacionID)
        {
            using (var transaction = new TransactionScope())
            {
                CheckListRoladoraInfo checkList = listaCheckListRoladora.FirstOrDefault();
                if (checkList == null)
                {
                    return;
                }
                CheckListRoladoraInfo ultimoCheckListRoladora = ValidarCheckList(organizacionID);
                if (ultimoCheckListRoladora == null)
                {
                    ultimoCheckListRoladora = new CheckListRoladoraInfo
                    {
                        CheckListRoladoraGeneral = new CheckListRoladoraGeneralInfo()
                    };
                }
                var checkListRoladoraGeneralDAL = new Integracion.DAL.Implementacion.CheckListRoladoraGeneralDAL();
                int checkListRoladoraGeneralID;
                if (ultimoCheckListRoladora.CheckListRoladoraGeneral.Turno == checkListRoladoraGeneral.Turno)
                {
                    checkList.CheckListRoladoraID      = ultimoCheckListRoladora.CheckListRoladoraID;
                    checkList.CheckListRoladoraGeneral = ultimoCheckListRoladora.CheckListRoladoraGeneral;
                    checkListRoladoraGeneral.CheckListRoladoraGeneralID =
                        ultimoCheckListRoladora.CheckListRoladoraGeneral.CheckListRoladoraGeneralID;
                    checkListRoladoraGeneral.UsuarioIDSupervisor =
                        ultimoCheckListRoladora.CheckListRoladoraGeneral.UsuarioIDSupervisor;
                    checkListRoladoraGeneral.Observaciones = ultimoCheckListRoladora.CheckListRoladoraGeneral.Observaciones;

                    checkListRoladoraGeneralDAL.Actualizar(checkListRoladoraGeneral);
                    checkListRoladoraGeneralID = checkListRoladoraGeneral.CheckListRoladoraGeneralID;
                }
                else
                {
                    checkListRoladoraGeneralID = checkListRoladoraGeneralDAL.Crear(checkListRoladoraGeneral);
                }

                listaCheckListRoladora.ForEach(roladora => roladora.CheckListRoladoraGeneralID = checkListRoladoraGeneralID);

                var checkListRoladoraHorometroDAL = new Integracion.DAL.Implementacion.CheckListRoladoraHorometroDAL();

                List <CheckListRoladoraHorometroInfo> listaHorometros =
                    checkListRoladoraHorometroDAL.ObtenerPorCheckListRoladoraGeneralID(checkListRoladoraGeneralID);

                if (listaCheckListRoladoraHorometro.Any())
                {
                    foreach (var horometro in listaCheckListRoladoraHorometro)
                    {
                        horometro.CheckListRoladoraGeneralID = checkListRoladoraGeneralID;
                        if (listaHorometros == null || !listaHorometros.Any())
                        {
                            continue;
                        }
                        CheckListRoladoraHorometroInfo horometroExiste =
                            listaHorometros.FirstOrDefault(
                                hor => hor.Roladora.RoladoraID == horometro.Roladora.RoladoraID && hor.CheckListRoladoraGeneral.CheckListRoladoraGeneralID == horometro.CheckListRoladoraGeneralID);
                        if (horometroExiste != null)
                        {
                            horometro.CheckListRoladoraHorometroID = horometroExiste.CheckListRoladoraHorometroID;
                        }
                    }

                    checkListRoladoraHorometroDAL.Crear(listaCheckListRoladoraHorometro);
                }
                if (checkListRoladoraDetalle != null && checkListRoladoraDetalle.Any())
                {
                    var checkListRoladoraDALAnterior = new Integracion.DAL.Implementacion.CheckListRoladoraDAL();
                    foreach (var checkListRoladora in listaCheckListRoladora)
                    {
                        ultimoCheckListRoladora = ValidarCheckList(organizacionID);
                        if (ultimoCheckListRoladora == null)
                        {
                            ultimoCheckListRoladora = new CheckListRoladoraInfo
                            {
                                CheckListRoladoraGeneral = new CheckListRoladoraGeneralInfo()
                            };
                        }
                        if (ultimoCheckListRoladora.CheckListRoladoraGeneral.Turno == checkListRoladoraGeneral.Turno)
                        {
                            checkListRoladora.CheckListRoladoraID               = ultimoCheckListRoladora.CheckListRoladoraID;
                            checkListRoladora.CheckListRoladoraGeneral          = ultimoCheckListRoladora.CheckListRoladoraGeneral;
                            checkListRoladoraGeneral.CheckListRoladoraGeneralID =
                                ultimoCheckListRoladora.CheckListRoladoraGeneral.CheckListRoladoraGeneralID;

                            checkListRoladoraDALAnterior.Actualizar(checkListRoladora);
                        }
                        else
                        {
                            checkListRoladora.CheckListRoladoraGeneralID = checkListRoladoraGeneralID;
                            checkListRoladora.CheckListRoladoraGeneral.CheckListRoladoraGeneralID = checkListRoladoraGeneralID;
                            checkListRoladoraDALAnterior.Crear(checkListRoladora);
                        }
                    }
                }
                transaction.Complete();
            }
        }
 /// <summary>
 /// Obtiene un lista paginada
 /// </summary>
 /// <param name="pagina"></param>
 /// <param name="filtro"></param>
 /// <returns></returns>
 public ResultadoInfo <CheckListRoladoraGeneralInfo> ObtenerPorPagina(PaginacionInfo pagina, CheckListRoladoraGeneralInfo filtro)
 {
     try
     {
         Dictionary <string, object> parameters = AuxCheckListRoladoraGeneralDAL.ObtenerParametrosPorPagina(pagina, filtro);
         DataSet ds = Retrieve("CheckListRoladoraGeneral_ObtenerPorPagina", parameters);
         ResultadoInfo <CheckListRoladoraGeneralInfo> result = null;
         if (ValidateDataSet(ds))
         {
             result = MapCheckListRoladoraGeneralDAL.ObtenerPorPagina(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
 /// <summary>
 /// Obtiene parametros para obtener lista paginada
 /// </summary>
 /// <param name="pagina"></param>
 /// <param name="filtro"></param>
 /// <returns></returns>
 public static Dictionary <string, object> ObtenerParametrosPorPagina(PaginacionInfo pagina, CheckListRoladoraGeneralInfo filtro)
 {
     try
     {
         Logger.Info();
         var parametros =
             new Dictionary <string, object>
         {
             { "@CheckListRoladoraGeneralID", filtro.CheckListRoladoraGeneralID },
             { "@Activo", filtro.Activo },
             { "@Inicio", pagina.Inicio },
             { "@Limite", pagina.Limite }
         };
         return(parametros);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Esempio n. 17
0
        /// <summary>
        /// Obtiene una lista paginada de CheckListRoladoraGeneral
        /// </summary>
        /// <param name="pagina"></param>
        /// <param name="filtro"></param>
        /// <returns></returns>
        public ResultadoInfo <CheckListRoladoraGeneralInfo> ObtenerPorPagina(PaginacionInfo pagina, CheckListRoladoraGeneralInfo filtro)
        {
            try
            {
                Logger.Info();
                ResultadoInfo <CheckListRoladoraGeneralInfo> result = new ResultadoInfo <CheckListRoladoraGeneralInfo>();
                var condicion = da.Tabla <CheckListRoladoraGeneralInfo>().Where(e => e.Activo == filtro.Activo);
                if (filtro.CheckListRoladoraGeneralID > 0)
                {
                    condicion = condicion.Where(e => e.CheckListRoladoraGeneralID == filtro.CheckListRoladoraGeneralID);
                }
                if (filtro.CheckListRoladoraGeneralID > 0)
                {
                    condicion = condicion.Where(e => e.CheckListRoladoraGeneralID == filtro.CheckListRoladoraGeneralID);
                }
                result.TotalRegistros = condicion.Count();

                int inicio = pagina.Inicio;
                int limite = pagina.Limite;
                if (inicio > 1)
                {
                    int limiteReal = (limite - inicio) + 1;
                    inicio = (limite / limiteReal);
                    limite = limiteReal;
                }
                var paginado = condicion
                               .OrderBy(e => e.CheckListRoladoraGeneralID)
                               .Skip((inicio - 1) * limite)
                               .Take(limite);

                result.Lista = paginado.ToList();

                return(result);
            }
            catch (ExcepcionGenerica)
            {
                throw;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
            }
        }
 /// <summary>
 /// Obtiene una lista paginada de CheckListRoladoraGeneral
 /// </summary>
 /// <param name="pagina"></param>
 /// <param name="filtro"></param>
 /// <returns></returns>
 public ResultadoInfo <CheckListRoladoraGeneralInfo> ObtenerPorPagina(PaginacionInfo pagina, CheckListRoladoraGeneralInfo filtro)
 {
     try
     {
         Logger.Info();
         return(checkListRoladoraGeneralDAL.ObtenerPorPagina(pagina, filtro));
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
        private dynamic ValidarCheckListCompletado(List <CheckListRoladoraDetalleInfo> checkListRoladoraDetalle)
        {
            dynamic checkListCompleto;

            if (checkListRoladoraDetalle != null && checkListRoladoraDetalle.Any())
            {
                CheckListRoladoraInfo checkListRoladora =
                    checkListRoladoraDetalle.Select(roladora => new CheckListRoladoraInfo
                {
                    CheckListRoladoraHorometro = new CheckListRoladoraHorometroInfo
                    {
                        HorometroInicial = roladora.CheckListRoladora.CheckListRoladoraHorometro.HorometroInicial,
                        HorometroFinal   = roladora.CheckListRoladora.CheckListRoladoraHorometro.HorometroFinal
                    }
                    //HorometroInicial = roladora.CheckListRoladora.HorometroInicial,
                    //HorometroFinal = roladora.CheckListRoladora.HorometroFinal
                }).FirstOrDefault();
                CheckListRoladoraGeneralInfo checkListRoladoraGeneral =
                    checkListRoladoraDetalle.Select(general => new CheckListRoladoraGeneralInfo
                {
                    UsuarioIDSupervisor =
                        general.CheckListRoladora.
                        CheckListRoladoraGeneral.UsuarioIDSupervisor,
                    Observaciones =
                        general.CheckListRoladora.
                        CheckListRoladoraGeneral.Observaciones,
                    SurfactanteInicio =
                        general.CheckListRoladora.
                        CheckListRoladoraGeneral.SurfactanteInicio,
                    SurfactanteFin =
                        general.CheckListRoladora.
                        CheckListRoladoraGeneral.SurfactanteFin,
                    ContadorAguaInicio =
                        general.CheckListRoladora.
                        CheckListRoladoraGeneral.ContadorAguaInicio,
                    ContadorAguaFin =
                        general.CheckListRoladora.
                        CheckListRoladoraGeneral.ContadorAguaFin,
                    GranoEnteroFinal =
                        general.CheckListRoladora.
                        CheckListRoladoraGeneral.GranoEnteroFinal
                }).FirstOrDefault();
                List <CheckListRoladoraDetalleInfo> checkListDetalle =
                    checkListRoladoraDetalle.Where(clave => clave.CheckListRoladoraDetalleID > 0).OrderBy(
                        clave => clave.CheckListRoladoraDetalleID).Select(det => det).ToList();
                bool completado = !string.IsNullOrEmpty(checkListRoladora.CheckListRoladoraHorometro.HorometroFinal) &&
                                  checkListRoladoraGeneral.SurfactanteInicio.HasValue &&
                                  checkListRoladoraGeneral.SurfactanteFin.HasValue &&
                                  checkListRoladoraGeneral.ContadorAguaInicio.HasValue &&
                                  checkListRoladoraGeneral.ContadorAguaFin.HasValue &&
                                  checkListRoladoraGeneral.GranoEnteroFinal.HasValue
                                  &&
                                  (checkListDetalle != null && checkListDetalle.Any() &&
                                   checkListDetalle.Count(accion => accion.CheckListRoladoraAccionID > 0) > 0);

                var checkListRoladoraHorometroDAL = new Integracion.DAL.Implementacion.CheckListRoladoraHorometroDAL();

                var checkList = checkListRoladoraDetalle.FirstOrDefault();


                List <CheckListRoladoraHorometroInfo> listaHorometros =
                    checkListRoladoraHorometroDAL.ObtenerPorCheckListRoladoraGeneralID(checkList.CheckListRoladora.CheckListRoladoraGeneralID);


                checkListCompleto =
                    new
                {
                    Completo                   = completado ? 1 : 0,
                    CheckListRoladora          = checkListRoladora,
                    CheckListRoladoraGeneral   = checkListRoladoraGeneral,
                    CheckListRoladoraDetalle   = checkListDetalle,
                    CheckListRoladoraHorometro = listaHorometros
                };
            }
            else
            {
                checkListCompleto = new { Completo = 0 };
            }
            return(checkListCompleto);
        }