/// <summary> /// /// </summary> /// <param name="subjectServiceService"></param> /// <param name="homeworkService"></param> /// <param name="answerService"></param> /// <param name="studentService"></param> /// <param name="schoolClassService"></param> /// <param name="textService"></param> /// all neccesery services public StudentsController(ISubjectService subjectServiceService, IHomeworkService homeworkService, IAnswerService answerService, IStudentService studentService, ISchoolClassService schoolClassService, ITextService textService, IWordDefinitionService wordDefinitionService) { _textService = textService; _schoolClassService = schoolClassService; _subjectServiceService = subjectServiceService; _homeworkService = homeworkService; _answerService = answerService; _studentService = studentService; _wordDefinitionService = wordDefinitionService; foreach (var wordDef in _wordDefinitionService.All()) { dictionary.Add(wordDef.Word, wordDef.Definition); } dictionary.Add("סירותיהם", "הסירות שלהם, פירוש מעניין.."); dictionary.Add("נמרצות", "מלא מרץ, מלא חיות, אנרגטי"); dictionary.Add("עמך", "יחד, בצוותא, בשיתוף; אחד עם השני"); dictionary.Add("שטה", "מפליגה בים"); // dictionary.Add("יפהפייה", "מהממת ביופיה"); }
private void AddWordDefinition(string word, string wordDefinition) { if (_wordDefinitionService.All().Count(x => x.Word.Equals(word)) > 0) { TempData["msg"] = "<script>alert('כבר קיים במערכת פירוש למילה המבוקשת');</script>"; return; } WordDefinition wd = new WordDefinition() { Word = word, Definition = wordDefinition, }; try { _wordDefinitionService.Add(wd); TempData["msg"] = "<script>alert('פירוש המילה נכנס למערכת בהצלחה');</script>"; } catch (Exception) { TempData["msg"] = "<script>alert('אירעה תקלה בניסיון הוספת פירוש המילה');</script>"; } }