Ejemplo n.º 1
0
        public void ActivatePerson(int id)
        {
            if (BaseSecurity.IsDistrictAdminOrCurrentPerson(id, Context))
            {
                throw new ChalkableSecurityException();
            }
            var person = GetPerson(id);

            person.Active = true;
            PersonStorage.Update(person);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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();
     }
 }