public IQueryOver <ForecastMonth, ForecastMonth> Apply(IQueryOver <ForecastMonth, ForecastMonth> queryOver, ForecastMonth monthAlias, Trex.Server.Core.Model.Forecast.Forecast forecastAlias)
        {
            ForecastProjectHours projectRegAlias = null;

            var projectCrit = QueryOver
                              .Of <ForecastProjectHours>()
                              .Where(x => x.Project.ProjectID == _projectId)
                              .And(x => x.Parent.Id == forecastAlias.Id)
                              .Select(x => x.Id)
                              .Take(1);

            return(queryOver
                   .JoinAlias(() => forecastAlias.ProjectRegistrations, () => projectRegAlias)
                   .Where(Subqueries.WhereExists(projectCrit)));
        }
Exemplo n.º 2
0
        public IQueryOver <ForecastMonth, ForecastMonth> Apply(IQueryOver <ForecastMonth, ForecastMonth> queryOver, ForecastMonth monthAlias, Trex.Server.Core.Model.Forecast.Forecast forecastAlias)
        {
            Company companyAlias = null;
            Project projectAlias = null;
            ForecastProjectHours projectRegAlias = null;

            var projectCrit = QueryOver
                              .Of <Company>()
                              .Where(x => x.CustomerID == _companyId)
                              .And(x => x.CustomerID == companyAlias.CustomerID)
                              .Select(x => x.CustomerID)
                              .Take(1);

            return(queryOver
                   .JoinAlias(() => forecastAlias.ProjectRegistrations, () => projectRegAlias)
                   .JoinAlias(() => projectRegAlias.Project, () => projectAlias)
                   .JoinAlias(() => projectAlias.Company, () => companyAlias)
                   .Where(Subqueries.WhereExists(projectCrit)));
        }
Exemplo n.º 3
0
        public IQueryOver <ForecastMonth, ForecastMonth> Apply(IQueryOver <ForecastMonth, ForecastMonth> queryOver, ForecastMonth monthAlias, Trex.Server.Core.Model.Forecast.Forecast forecastAlias)
        {
            var forecastTypeCrit = QueryOver
                                   .Of <Trex.Server.Core.Model.Forecast.Forecast>()
                                   .Where(x => x.ForecastType.Id == _forecastTypeId)
                                   .And(x => x.ForecastMonth.Id == monthAlias.Id)
                                   .Select(x => x.Id)
                                   .Take(1);

            return(queryOver.Where(Subqueries.WhereExists(forecastTypeCrit)));
        }