/// <summary> /// מחיקת בוחן מרשימת הבוחנים /// </summary> /// <param name="mytester">הבוחן למחיקה</param> public void DeleteTester(Tester mytester) { try { IEnumerable <Test> deleteTest = GetAllTest(t => (t.TesterId == mytester.TesterId) && (t.DateTimeOfTest > DateTime.Now)); if (deleteTest.Count() == 0) { dal.DeleteTester(mytester); throw new Exception("You have been deleted"); } else { mytester.isActive = false; UpdateTester(mytester); DateTime last = DateTime.Now; foreach (Test item in deleteTest) { if (item.DateTimeOfTest > last) { last = item.DateTimeOfTest; } } last.AddDays(1); throw new Exception("We have update your status to not active - please try to remove yourself from the system in: " + last.ToString("dd/MM/yyyy")); } } catch (Exception e) { throw e; } }