public void PostStudentPref(StudentPref studentPref)
 {
     if (!Moderators.ModStudentPref.SetStudentPref(studentPref))
     {
         throw new HttpResponseException(HttpStatusCode.BadRequest);
     }
 }
 private static void ParseStudentPref(StudentPref stud)
 {
     stud.FavoriteLang   = Parser(stud.FavoriteLang);
     stud.KindOfProject  = Parser(stud.KindOfProject);
     stud.FieldOfProject = stud.FieldOfProject.Replace("תעשיה", "Industry").Replace("מחקר", "Research").Replace("לא משנה", "Industry,Research");
     stud.GroupSize      = stud.GroupSize.Replace("4", "GroupSize_4").Replace("3", "GroupSize_3").Replace("2", "GroupSize_2").Replace("1", "GroupSize_1")
                           .Replace("לא משנה", "GroupSize_4,GroupSize_3,GroupSize_2,GroupSize_1");
 }
        public static bool SetStudentPref(StudentPref studP)
        {
            ParseStudentPref(studP);
            String pref = "UserName,";

            pref += studP.GroupSize + ',' + studP.FieldOfProject;
            String values     = studP.UserName + SetValueString(pref);
            string kindcols   = "UserName," + studP.KindOfProject;
            String kindvalues = studP.UserName + SetValueString(kindcols);
            string langcols   = "UserName," + studP.FavoriteLang;
            String langvalues = studP.UserName + SetValueString(langcols);

            return(AddStudentPreference.AddStudentsPref(pref, values) &&
                   AddStudentPreference.AddStudentsPrefKind(kindcols, kindvalues) &&
                   AddStudentPreference.AddStudentsPrefLang(langcols, langvalues)
                   );
        }