Example #1
0
 public void RemoveEvaluation(int id)
 {
     LoadEvaluationsFromDatabase();
     Evaluation eval = new Evaluation();
     foreach (Evaluation e in evaluationList)
     {
         if (e.Id == id) eval = e;
     }
     using (ISession session = NhibernateService.OpenSession())
     {
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Delete(eval);
             transaction.Commit();
         }
     }
     LoadEvaluationsFromDatabase();
     Notify();
 }
Example #2
0
 public void AddEvaluation(DateTime date, string description, Prisoner pris)
 {
     LoadEvaluationsFromDatabase();
     Evaluation eval = new Evaluation(description, date, pris);
     using (ISession session = NhibernateService.OpenSession())
     {
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Save(eval);
             transaction.Commit();
         }
     }
     LoadEvaluationsFromDatabase();
     Notify();
 }