public Data.School.Model.School GetSchool(int schoolId) { if (!(BaseSecurity.IsDistrictAdmin(Context) || Context.SchoolLocalId == schoolId)) { throw new ChalkableSecurityException(); } return(SchoolStorage.GetById(schoolId)); }
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); }
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); }
public IList <Data.School.Model.School> GetSchools() { return(SchoolStorage.GetAll()); }
public void Delete(IList <Data.School.Model.School> schools) { SchoolStorage.Delete(schools); }