Пример #1
0
 public Data.School.Model.School GetSchool(int schoolId)
 {
     if (!(BaseSecurity.IsDistrictAdmin(Context) || Context.SchoolLocalId == schoolId))
     {
         throw new ChalkableSecurityException();
     }
     return(SchoolStorage.GetById(schoolId));
 }
Пример #2
0
        public void Edit(IList <Data.School.Model.School> schools)
        {
            if (!Context.DistrictId.HasValue)
            {
                throw new UnassignedUserException();
            }

            SchoolStorage.Update(schools);
            ServiceLocator.ServiceLocatorMaster.SchoolService.Edit(schools.Select(x => new SchoolInfo
            {
                LocalId = x.Id,
                Name    = x.Name
            }).ToList(), Context.DistrictId.Value);
        }
Пример #3
0
        public void Add(Data.School.Model.School school)
        {
            SchoolStorage.Add(school);

            var l = new List <SchoolInfo>
            {
                new SchoolInfo
                {
                    Name = school.Name,
                    IsChalkableEnabled = school.IsChalkableEnabled,
                    LocalId            = school.Id
                }
            };

            ServiceLocator.ServiceLocatorMaster.SchoolService.Add(l, Context.DistrictId.Value);
        }
Пример #4
0
 public IList <Data.School.Model.School> GetSchools()
 {
     return(SchoolStorage.GetAll());
 }
Пример #5
0
 public void Delete(IList <Data.School.Model.School> schools)
 {
     SchoolStorage.Delete(schools);
 }