public int AddMeeting(AddMeetingVM model)
 {
     if (ModelState.IsValid)
     {
         return(lessonOperation.AddMeeting(model));
     }
     else
     {
         return(0);
     }
 }
        public int AddMeeting(AddMeetingVM model)
        {
            User   fromUser = Services.User.FirstOrDefault(x => x.ID == model.FromID && x.AccountType == (int)EnumUserType.Student);
            Lesson lesson   = Services.Lesson.FirstOrDefault(x => x.ID == model.LessonID);

            if (fromUser != null && lesson != null)
            {
                LessonStudentMeeting meeting = Services.LessonStudentMeeting.FirstOrDefault(x => x.StudentID == fromUser.ID && x.LessonID == lesson.ID);

                if (meeting == null)
                {
                    Services.LessonStudentMeeting.Insert(new LessonStudentMeeting {
                        LessonID = lesson.ID, StudentID = fromUser.ID
                    });
                }
                return(1);
            }
            else
            {
                return(0);
            }
        }