private void deleteCoures()
 {
     try
     {
         string CouresID = context.Request.Form.Get("CouresID");
         CouresService cs = new CouresService();
         cs.del(cs.getCouresByID(CouresID));
         context.Response.Write("1");
     }
     catch (Exception e)
     {
         context.Response.Write("0");
     }
 }
 private void getCouresByID()
 {
     try
     {
         string CouresID = context.Request.Form.Get("CouresID");
         CouresService cs = new CouresService();
         Coures coures = cs.getCouresByID(CouresID);
         String json = JsonConvert.SerializeObject(coures);
         context.Response.Write(json);
     }
     catch (Exception e)
     {
         context.Response.Write("0");
     }
 }
        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");
            }
        }