public List <TranslationDto> GetList(Func <TranslationDto, bool> where,
                                             params Expression <Func <TranslationDto, object> >[] navigationProperties)
        {
            var where2  = _mapper.Map <Func <Translation, bool> >(where);
            var navProp = _mapper.Map <Expression <Func <Translation, object> >[]>(navigationProperties);

            return(_mapper.Map <List <TranslationDto> >(_translationRepo.GetList(where2, navProp)));
        }
        public ApiResponse <IList <DTOReporteDinamico> > GetReporteDinamico(DTOReporteDinamico reporteDinamico)
        {
            ApiResponse <IList <DTOReporteDinamico> > apiResponse = new ApiResponse <IList <DTOReporteDinamico> >();

            try
            {
                GenericDataRepository <CatMotivosViaje> motivosViajeRepository = new GenericDataRepository <CatMotivosViaje>();

                apiResponse.Data = (from encuesta in _encuestaRepository.GetList(x => x.FechaAplicacion >= reporteDinamico.FechaInicio.Date && x.FechaAplicacion.Date <= reporteDinamico.FechaFin.Date)
                                    from derechohabiente in _derechohabienteRepository.GetList(x => x.IdDerechohabiente == encuesta.IdDerechohabiente).Take(1).DefaultIfEmpty()
                                    from tipoDestino in _tiposDestinoRepository.GetList(x => x.IdTipoDestino == encuesta.IdTipoDestino).Take(1).DefaultIfEmpty()
                                    from temporada in _temporadasRepository.GetList(x => x.IdTemporada == encuesta.IdTemporada).Take(1).DefaultIfEmpty()
                                    from viaje in _tiposViajeRepository.GetList(x => x.IdTipoViaje == encuesta.IdTipoViaje).Take(1).DefaultIfEmpty()
                                    from motivo in motivosViajeRepository.GetList(x => x.IdMotivoViaje == encuesta.IdMotivoViaje).Take(1).DefaultIfEmpty()
                                    from genero in _generoRepository.GetList(x => x.IdGenero == derechohabiente.IdGenero).Take(1).DefaultIfEmpty()
                                    from estado in _estadoRepository.GetList(x => x.IdEstado == derechohabiente.IdEstado).Take(1).DefaultIfEmpty()
                                    select new DTOReporteDinamico
                {
                    Destino = tipoDestino.Nombre,
                    TemporadaVacacional = temporada.Nombre,
                    Viaje = viaje.Nombre,
                    Motivo = motivo.Nombre,
                    Nombre = string.Join(" ", new[] { derechohabiente.Nombre, derechohabiente.ApellidoPaterno, derechohabiente.ApellidoMaterno }),
                    Lada = derechohabiente.Lada,
                    Telefono = derechohabiente.Telefono,
                    CorreoElectronico = derechohabiente.CorreoElectronico,
                    Genero = genero.Genero,
                    Edad = DateTime.Now.Year - derechohabiente.FechaNacimiento.Year,
                    Estado = estado.Nombre,
                    Derechohabiente = derechohabiente.TipoDerechohabiente,
                    Afiliacion = derechohabiente.Afiliacion,
                    RecibirInformacion = derechohabiente.RecibirInformacion == true ? "SI" : "NO"
                }).ToList();

                if (apiResponse.Data != null)
                {
                    apiResponse.Result  = (int)ApiResult.Success;
                    apiResponse.Message = Resources.ConsultaExitosa;
                }

                else
                {
                    apiResponse.Result  = (int)ApiResult.Failure;
                    apiResponse.Message = Resources.ConsultaFallida;
                }
            }
            catch (Exception ex)
            {
                apiResponse.Result  = (int)ApiResult.Exception;
                apiResponse.Message = ex.Message;
            }

            return(apiResponse);
        }
Пример #3
0
 public IList <tbl_RoleScreenMapping> GetMappedIDs(int roleId)
 {
     try
     {
         IGenericDataRepository <tbl_RoleScreenMapping> rep = new GenericDataRepository <tbl_RoleScreenMapping>();
         IList <tbl_RoleScreenMapping> mappedIds            = rep.GetList(q => q.RoleID.Equals(roleId));
         return(mappedIds);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #4
0
        //public List<sp_GetTransactionsForHeader_Result> GetTransactionHeader(int daId)
        //{
        //    IGenericDataRepository<sp_GetTransactionsForHeader_Result> repository = new GenericDataRepository<sp_GetTransactionsForHeader_Result>();
        //    return repository.ExecuteStoredProcedure("EXEC sp_GetTransactionsForHeader @daId", new SqlParameter("daId", SqlDbType.Int) { Value = daId }).ToList();
        //}

        public IList <tbl_Transactions> GetTransactionHeader(int daId)
        {
            try
            {
                IGenericDataRepository <tbl_Transactions> repository = new GenericDataRepository <tbl_Transactions>();
                IList <tbl_Transactions> lstTransactions             = repository.GetList(e => e.daId.Equals(daId));
                return(lstTransactions);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #5
0
 public IList <tbl_AttributeValues> GetNegativeAttributeValue(int?daId)
 {
     try
     {
         IGenericDataRepository <tbl_AttributeValues> repository = new GenericDataRepository <tbl_AttributeValues>();
         IList <tbl_AttributeValues> lstNegAttrValues            = repository.GetList(e => e.daId == daId && e.isNegative == "1", e => e.tbl_Attribute, e => e.tbl_DesignAccelerator, e => e.tbl_DesignAccelerator.tbl_Transactions);
         return(lstNegAttrValues);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #6
0
        //public tbl_AttributeValues FindAttributeValue(string attributeValue)
        //{
        //    IGenericDataRepository<tbl_AttributeValues> repository = new GenericDataRepository<tbl_AttributeValues>();
        //    tbl_AttributeValues attribVals = repository.GetSingle(c => c.AttributeValue == attributeValue);
        //    return attribVals;
        //}

        public IList <tbl_AttributeValues> GetAttributeValListbyDaID(int?daId)
        {
            try
            {
                IGenericDataRepository <tbl_AttributeValues> repository = new GenericDataRepository <tbl_AttributeValues>();
                IList <tbl_AttributeValues> lstAttribVals = repository.GetList(e => e.daId.Equals(daId), e => e.isNegative == "1");
                return(lstAttribVals);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #7
0
 public IList <tbl_AttributeValues> GetAttributeValList(int?attrID)
 {
     try
     {
         IGenericDataRepository <tbl_AttributeValues> repository = new GenericDataRepository <tbl_AttributeValues>();
         IList <tbl_AttributeValues> lstAttribVals = repository.GetList(e => e.AttributeID.Equals(attrID));
         return(lstAttribVals);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #8
0
        public IList <tbl_Applications> GetApplicationDetails(int?projectId)
        {
            try
            {
                IGenericDataRepository <tbl_Applications> repository = new GenericDataRepository <tbl_Applications>();
                IList <tbl_Applications> lstApplications             = repository.GetList(e => e.ProjectId == projectId);

                return(lstApplications);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #9
0
        public IList <tbl_Source> GetSourceDetails(int daID)
        {
            try
            {
                IGenericDataRepository <tbl_Source> repository = new GenericDataRepository <tbl_Source>();
                IList <tbl_Source> lstSource = repository.GetList(e => e.daId.Equals(daID));

                return(lstSource);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #10
0
        public IList <tbl_ChannelAlert> GetLinkedDataForChannelAlert(int daid)
        {
            try
            {
                IGenericDataRepository <tbl_ChannelAlert> repository = new GenericDataRepository <tbl_ChannelAlert>();
                IList <tbl_ChannelAlert> linkedCAlst = repository.GetList(e => e.daId.Equals(daid), e => e.tbl_ChannelAlertAttrMapping, e => e.tbl_Transactions);

                return(linkedCAlst);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #11
0
        public IList <tbl_Interface> GetLinkedDataForInterface(int daid)
        {
            try
            {
                IGenericDataRepository <tbl_Interface> repository = new GenericDataRepository <tbl_Interface>();
                IList <tbl_Interface> linkedInterfaceLst          = repository.GetList(e => e.daId.Equals(daid), e => e.tbl_InterfaceAttrMapping, e => e.tbl_Transactions);

                return(linkedInterfaceLst);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #12
0
        public IList <tbl_TxnAttributeMapping> GetLinkedDataAttrVals(int daid)
        {
            try
            {
                IGenericDataRepository <tbl_TxnAttributeMapping> repository = new GenericDataRepository <tbl_TxnAttributeMapping>();
                IList <tbl_TxnAttributeMapping> linkedAttrVals = repository.GetList(e => e.daId.Equals(daid), e => e.tbl_Attribute, e => e.tbl_Transactions);

                return(linkedAttrVals);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #13
0
        public IList <tbl_BusinessRule> GetLinkedDataForBR(int daid)
        {
            try
            {
                IGenericDataRepository <tbl_BusinessRule> repository = new GenericDataRepository <tbl_BusinessRule>();
                IList <tbl_BusinessRule> linkedBRData = repository.GetList(e => e.daId.Equals(daid), e => e.tbl_BuzRulesAttrMapping, e => e.tbl_Transactions);

                return(linkedBRData);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #14
0
        public IList <tbl_DesignAccelerator> GetDADetails(int appId)
        {
            try
            {
                IGenericDataRepository <tbl_DesignAccelerator> repository = new GenericDataRepository <tbl_DesignAccelerator>();
                IList <tbl_DesignAccelerator> lstDAs = repository.GetList(e => e.ModuleId.Equals(appId));

                return(lstDAs);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #15
0
        public IList <tbl_ModeType> GetModeTypes(int?daId)
        {
            try
            {
                IGenericDataRepository <tbl_ModeType> repository = new GenericDataRepository <tbl_ModeType>();
                IList <tbl_ModeType> lstModeType = repository.GetList(e => e.daId.Equals(daId));

                return(lstModeType);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #16
0
        public IList <tbl_LOB> GetLOBs(int?daid)
        {
            try
            {
                IGenericDataRepository <tbl_LOB> repository = new GenericDataRepository <tbl_LOB>();
                IList <tbl_LOB> lstLOBs = repository.GetList(e => e.daId.Equals(daid));

                return(lstLOBs);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #17
0
        public IList <tbl_Transactions> FindReqRef(int?daid)
        {
            try
            {
                IGenericDataRepository <tbl_Transactions> repository = new GenericDataRepository <tbl_Transactions>();
                IList <tbl_Transactions> tblTransactions             = repository.GetList(q => q.daId.Equals(daid));

                return(tblTransactions);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #18
0
        public IList <tbl_Products> GetAllProducts(int?daId)
        {
            try
            {
                IGenericDataRepository <tbl_Products> repository = new GenericDataRepository <tbl_Products>();
                IList <tbl_Products> lstProds = repository.GetList(e => e.daid.Equals(daId));

                return(lstProds);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #19
0
        public IList <tbl_Reports> GetLinkedDataForReports(int?daid)
        {
            try
            {
                IGenericDataRepository <tbl_Reports> repository = new GenericDataRepository <tbl_Reports>();
                IList <tbl_Reports> linkedData = repository.GetList(e => e.daId.Equals(daid), e => e.tbl_Transactions);

                return(linkedData);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #20
0
        public IList <tbl_BuzProd> GetBusinessProducts(int?daId)
        {
            try
            {
                IGenericDataRepository <tbl_BuzProd> repository = new GenericDataRepository <tbl_BuzProd>();
                IList <tbl_BuzProd> lstBuzProds = repository.GetList(e => e.daId.Equals(daId));

                return(lstBuzProds);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #21
0
        public IList <tbl_TxnAttributeMapping> GetMappingDetails(int?daId)
        {
            try
            {
                IGenericDataRepository <tbl_TxnAttributeMapping> repository = new GenericDataRepository <tbl_TxnAttributeMapping>();
                IList <tbl_TxnAttributeMapping> lstMappingDetails           = repository.GetList(e => e.daId == daId && e.isLinked == "1", e => e.tbl_Attribute, e => e.tbl_DesignAccelerator, e => e.tbl_Transactions, e => e.tbl_Attribute.tbl_AttributeType);

                return(lstMappingDetails);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #22
0
        public IList <tbl_Destination> GetDestinationDetails(int daID)
        {
            try
            {
                IGenericDataRepository <tbl_Destination> repository = new GenericDataRepository <tbl_Destination>();
                IList <tbl_Destination> lstDest = repository.GetList(e => e.daId.Equals(daID));

                return(lstDest);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #23
0
        public IList <tbl_Projects> GetProjectDetails(int clientId)
        {
            try
            {
                IGenericDataRepository <tbl_Projects> repository = new GenericDataRepository <tbl_Projects>();
                IList <tbl_Projects> lstProjects = repository.GetList(e => e.ClientId.Equals(clientId));

                return(lstProjects);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #24
0
        public IList <tbl_Attribute> GetAttributeList(int?daid)
        {
            try
            {
                IGenericDataRepository <tbl_Attribute> repository = new GenericDataRepository <tbl_Attribute>();
                IList <tbl_Attribute> lstAttrib = repository.GetList(e => e.daId.Equals(daid), e => e.tbl_AttributeType, e => e.tbl_AttributeValues, e => e.tbl_TxnAttributeMapping, e => e.tbl_DesignAccelerator);

                return(lstAttrib);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #25
0
 //public IList<tbl_Module> GetAllModules(int? daId)
 public IList <tbl_Module> GetAllModules(int?applicationId)
 {
     try
     {
         IGenericDataRepository <tbl_Module> repository = new GenericDataRepository <tbl_Module>();
         //IList<tbl_Module> modules = repository.GetList(m => m.daId.Equals(daId));
         IList <tbl_Module> modules = repository.GetList(e => e.ApplicationId.Equals(applicationId));
         return(modules);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #26
0
        public IList <tbl_FrequencyType> GetAllFrequencyTypes(int?daID)
        {
            try
            {
                IGenericDataRepository <tbl_FrequencyType> repository = new GenericDataRepository <tbl_FrequencyType>();
                IList <tbl_FrequencyType> lstFrequencyTypes           = repository.GetList(e => e.daId.Equals(daID));

                return(lstFrequencyTypes);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #27
0
        public IList <tbl_Attribute> GetAllAttributes(int?daId)
        {
            try
            {
                IGenericDataRepository <tbl_Attribute> repository = new GenericDataRepository <tbl_Attribute>();
                IList <tbl_Attribute> lstAttributes = repository.GetList(e => e.daId.Equals(daId));

                return(lstAttributes);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #28
0
        //To get the common&critical values
        public IList <tbl_Attribute> GetCommonriticalAttributes(int?daId)
        {
            try
            {
                IGenericDataRepository <tbl_Attribute> repository = new GenericDataRepository <tbl_Attribute>();

                IList <tbl_Attribute> lstAttributes = repository.GetList(a => a.daId == daId && (a.AttributeTypeID == 2 || a.AttributeTypeID == 4));

                return(lstAttributes);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public MemoryStream GetReporteDinamico(DTOReporteDinamico reporteDinamico, string fileName)
        {
            MemoryStream memoryStream = null;

            try
            {
                GenericDataRepository <CatMotivosViaje> motivosViajeRepository = new GenericDataRepository <CatMotivosViaje>();

                IList <DTOReporteDinamico> reporteDinamicoList = (from encuesta in _encuestaRepository.GetList(x => x.FechaAplicacion >= reporteDinamico.FechaInicio.Date && x.FechaAplicacion.Date <= reporteDinamico.FechaFin.Date)
                                                                  from derechohabiente in _derechohabienteRepository.GetList(x => x.IdDerechohabiente == encuesta.IdDerechohabiente).Take(1).DefaultIfEmpty()
                                                                  from tipoDestino in _tiposDestinoRepository.GetList(x => x.IdTipoDestino == encuesta.IdTipoDestino).Take(1).DefaultIfEmpty()
                                                                  from temporada in _temporadasRepository.GetList(x => x.IdTemporada == encuesta.IdTemporada).Take(1).DefaultIfEmpty()
                                                                  from viaje in _tiposViajeRepository.GetList(x => x.IdTipoViaje == encuesta.IdTipoViaje).Take(1).DefaultIfEmpty()
                                                                  from motivo in motivosViajeRepository.GetList(x => x.IdMotivoViaje == encuesta.IdMotivoViaje).Take(1).DefaultIfEmpty()
                                                                  from genero in _generoRepository.GetList(x => x.IdGenero == derechohabiente.IdGenero).Take(1).DefaultIfEmpty()
                                                                  from estado in _estadoRepository.GetList(x => x.IdEstado == derechohabiente.IdEstado).Take(1).DefaultIfEmpty()
                                                                  select new DTOReporteDinamico
                {
                    Destino = tipoDestino.Nombre,
                    TemporadaVacacional = temporada.Nombre,
                    Viaje = viaje.Nombre,
                    Motivo = motivo.Nombre,
                    Nombre = derechohabiente.Nombre + " " + derechohabiente.ApellidoPaterno + " " + derechohabiente.ApellidoMaterno,
                    Genero = genero.Genero,
                    Edad = DateTime.Now.Year - derechohabiente.FechaNacimiento.Year,
                    Estado = estado.Nombre,
                    Derechohabiente = derechohabiente.TipoDerechohabiente,
                    Afiliacion = derechohabiente.Afiliacion
                })
                                                                 .ToList();

                DataTable reporteDinamicoDataTable = ToDataTable.IListToDataTable(new List <DTOReporteDinamico>(reporteDinamicoList));

                memoryStream = ToExcel.ExportToExcel(reporteDinamicoDataTable, fileName);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(memoryStream);
        }
Пример #30
0
 public List <LOAISP> GetList()
 {
     return(dao.GetList());
 }