public void ActivatePerson(int id) { if (BaseSecurity.IsDistrictAdminOrCurrentPerson(id, Context)) { throw new ChalkableSecurityException(); } var person = GetPerson(id); person.Active = true; PersonStorage.Update(person); }
public void ProcessPersonFirstLogin(int id) { if (BaseSecurity.IsDistrictAdminOrCurrentPerson(id, Context)) { throw new ChalkableSecurityException(); } var person = GetPerson(id); if (person.FirstLoginDate.HasValue) { return; } person.FirstLoginDate = Context.NowSchoolTime; PersonStorage.Update(person); }
public void ActivatePerson(int id) { if (!BaseSecurity.IsDistrictAdminOrCurrentPerson(id, Context)) { throw new ChalkableSecurityException(); } using (var uow = Update()) { var da = new PersonDataAccess(uow); var person = GetPerson(id); //TODO: change school status person.Active = true; //person.FirstLoginDate = Context.NowSchoolTime; da.Update(person); uow.Commit(); } }