示例#1
0
文件: SiteService.cs 项目: iafb/gra4
 public async Task <DataWithCount <ICollection <Program> > > GetPaginatedProgramListAsync(
     BaseFilter filter)
 {
     VerifyPermission(Permission.ManagePrograms);
     filter.SiteId = GetCurrentSiteId();
     return(new DataWithCount <ICollection <Program> >
     {
         Data = await _programRepository.PageAsync(filter),
         Count = await _programRepository.CountAsync(filter)
     });
 }
示例#2
0
        public async Task <Program> AddProgramAsync(Program program)
        {
            VerifyPermission(Permission.ManagePrograms);
            var siteId = GetCurrentSiteId();
            var filter = new BaseFilter()
            {
                SiteId = siteId
            };

            program.Position = await _programRepository.CountAsync(filter);

            program.SiteId = siteId;

            return(await _programRepository.AddSaveAsync(GetClaimId(ClaimType.UserId), program));
        }