示例#1
0
        public async Task <GroupEntity> SetCenterType(string chatId, CenterTypeEnum input)
        {
            var info = await GetGroupInfo(chatId);

            info.CenterType = input;
            await _context.SaveChangesAsync();

            return(info);
        }
示例#2
0
        public static CenterTypeEnum?GetCenterTypeEnumByValue(this string input)
        {
            var result = new CenterTypeEnum();

            if (input == "دولتی")
            {
                result = CenterTypeEnum.Public;
            }
            else if (input == "غیردولتی")
            {
                result = CenterTypeEnum.Private;
            }


            return(result);
        }
        public StaffCountData[] GetStaffCounts(string year, string reviewCode, string definitionCode, string misCode, CenterTypeEnum center)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                IStaffCountRepository staffCountRepository = _DataRepositoryFactory.GetDataRepository <IStaffCountRepository>();

                List <StaffCountData> staffCount = new List <StaffCountData>();
                IEnumerable <StaffCountInfo> staffCountInfos = staffCountRepository.GetStaffCounts(year, reviewCode, definitionCode, misCode, center).ToArray();

                foreach (var staffCountInfo in staffCountInfos)
                {
                    staffCount.Add(
                        new StaffCountData
                    {
                        StaffCountId = staffCountInfo.StaffCount.EntityId,
                        Year = staffCountInfo.StaffCount.Year,
                        ClassificationCode = staffCountInfo.StaffCount.ClassificationCode,
                        ClassificationName = staffCountInfo.PayClassification.Name,
                        GradeCode = staffCountInfo.Grade.Code,
                        GradeName = staffCountInfo.Grade.Name,
                        CenterType = staffCountInfo.StaffCount.CenterType,
                        CurrencyCode = staffCountInfo.StaffCount.CurrencyCode,
                        DefintionCode = staffCountInfo.TeamDefinition.Code,
                        DefintionName = staffCountInfo.TeamDefinition.Name,
                        MisCode = staffCountInfo.Team.Code,
                        MisName = staffCountInfo.Team.Name,
                        TransactionType = staffCountInfo.StaffCount.TransactionType,
                        ReviewCode = staffCountInfo.StaffCount.ReviewCode,
                        Active = staffCountInfo.StaffCount.Active
                    });
                }

                return staffCount.ToArray();
            }));
        }
        public IEnumerable <StaffCostInfo> GetStaffCosts(string year, string reviewCode, string definitionCode, string misCode, CenterTypeEnum center)
        {
            using (BudgetContext entityContext = new BudgetContext())
            {
                var query = from a in entityContext.StaffCostSet
                            join b in entityContext.PayClassificationSet on a.ClassificationCode equals b.Code into bparents
                            from bp in bparents.Where(bpt => (a.Year == bpt.Year && a.ReviewCode == bpt.ReviewCode)).DefaultIfEmpty()
                            join c in entityContext.GradeSet on a.GradeCode equals c.Code into cparents
                            from cp in cparents.Where(cpt => (a.Year == cpt.Year && a.ReviewCode == cpt.ReviewCode)).DefaultIfEmpty()
                            join d in entityContext.TeamSet on a.MisCode equals d.Code into dparents
                            from dp in dparents.Where(dpt => (a.Year == dpt.Year && a.ReviewCode == dpt.ReviewCode)).DefaultIfEmpty()
                            join e in entityContext.TeamDefinitionSet on dp.DefinitionCode equals e.Code into eparents
                            from ep in eparents.Where(ept => (dp.Year == ept.Year && dp.ReviewCode == ept.ReviewCode)).DefaultIfEmpty()

                            where a.Year == year && a.ReviewCode == reviewCode && a.DefintionCode == definitionCode && a.MisCode == misCode && a.CenterType == center

                            select new StaffCostInfo()
                {
                    StaffCost         = a,
                    PayClassification = bp,
                    Grade             = cp,
                    Team           = dp,
                    TeamDefinition = ep
                };

                return(query.ToFullyLoaded());
            }
        }
示例#5
0
        public async Task <PriceEntity> GetPrice(CenterTypeEnum type, long axId)
        {
            var list = await _cacheService.GetOrSet(PriceCacheKey, GetPricesListAsync);

            return(list.FirstOrDefault(x => x.FestivalAxesId == axId && x.CenterType == type));
        }
        public IEnumerable <TeamPayClassificationInfo> GetTeamPayClassifications(string year, string reviewCode, CenterTypeEnum center, string definitionCode, string misCode)
        {
            using (BudgetContext entityContext = new BudgetContext())
            {
                var query = from a in entityContext.TeamPayClassificationSet
                            join b in entityContext.PayClassificationSet on a.ClassificationCode equals b.Code into bparents
                            from bp in bparents.Where(bpt => (a.Year == bpt.Year && a.ReviewCode == bpt.ReviewCode)).DefaultIfEmpty()
                            join c in entityContext.TeamDefinitionSet on a.DefinitionCode equals c.Code into cparents
                            from cp in cparents.Where(cpt => (a.Year == cpt.Year && a.ReviewCode == cpt.ReviewCode)).DefaultIfEmpty()
                            join d in entityContext.TeamSet on a.MisCode equals d.Code into dparents
                            from dp in dparents.Where(dpt => (a.Year == dpt.Year && a.ReviewCode == dpt.ReviewCode)).DefaultIfEmpty()

                            where a.Year == year && a.ReviewCode == reviewCode && a.Center == center && a.DefinitionCode == definitionCode && a.MisCode == misCode
                            select new TeamPayClassificationInfo()
                {
                    TeamPayClassification = a,
                    PayClassification     = bp,
                    TeamDefinition        = cp,
                    Team = dp
                };

                return(query.ToFullyLoaded());
            }
        }