private void saveCoures()
        {
            try
            {
                string ProfessionID = context.Request.Form.Get("Profession");
                string FacultyID = context.Request.Form.Get("Faculty");

                DepartmentService ds = new DepartmentService();
                Profession profession = ds.getProfessionByID(ProfessionID);
                Faculty faculty = ds.getFacultyByID(FacultyID);
                if (profession != null && faculty != null)
                {
                    ISet<Coures> couresSet = new HashedSet<Coures>();
                    string[] couresArr = context.Request.Form.GetValues("Coures");
                    CouresService cs = new CouresService();
                    foreach (string c in couresArr) {
                       Coures coures = cs.getCouresByID(c);
                       if (coures != null)
                       couresSet.Add(coures);
                    }

                    ExamPlan p = new ExamPlan();
                    setValue(p, context);
                    p.Profession = profession;
                    p.Faculty = faculty;
                    p.CouresSet = couresSet;
                    PlanService ps = new PlanService();
                    ps.save(p);
                    context.Response.Write("1");
                }
            }
            catch (Exception e)
            {
                context.Response.Write("0");
            }
        }
 private void deleteExamPlan()
 {
     try
     {
         string ExamPlanID = context.Request.Form.Get("ExamPlanID");
         PlanService planService = new PlanService();
         ExamPlan examPlan = planService.getExamPlanByID(ExamPlanID);
         examPlan.CouresSet = null;
         planService.save(examPlan);
         planService.del(examPlan);
         context.Response.Write("1");
     }
     catch (Exception e)
     {
         context.Response.Write("0");
     }
 }