Пример #1
0
        public JsonResult GroupCommentLikeOrDislike(ClassTeacherTopicComment Info)
        {
            ClassTeacher classteacher             = new ClassTeacher();
            ResultInfo <ClassTeacherForum> result = classteacher.GroupCommentLikeOrDislike(Info);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public JsonResult EditClassTeacherCommunityComment(ClassTeacherTopicComment Info)
        {
            ClassTeacher classteacher             = new ClassTeacher();
            ResultInfo <ClassTeacherForum> result = classteacher.EditOnlineForumComment(Info);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        public JsonResult GetTopicWiseComment(long TopicId, long SchoolId)
        {
            ClassTeacher classteacher             = new ClassTeacher();
            ResultInfo <ClassTeacherForum> result = classteacher.GetTopicWiseComment(TopicId, SchoolId);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        public JsonResult InsertCommentGroupTopicWise(ClassTeacherTopicComment Info)
        {
            ClassTeacher classteacher             = new ClassTeacher();
            ResultInfo <ClassTeacherForum> result = classteacher.InsertCommentGroupTopicWise(Info);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #5
0
        public JsonResult GetStudentsAssignmentFeedback(ClassTeacherAssignmentDetails Info)
        {
            ClassTeacher classteacher = new ClassTeacher();
            ResultInfo <ClassTeacherAssignmentDetails> result = classteacher.GetTeacherAssignmentDetails(Info);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #6
0
        public JsonResult getMessageCount(long SenderId, long ReceiverId, long SchoolId)
        {
            ClassTeacher classteacher = new ClassTeacher();
            long         Count        = classteacher.getMessageCount(SenderId, ReceiverId, SchoolId);

            return(Json(Count, JsonRequestBehavior.AllowGet));
        }
Пример #7
0
        public JsonResult GetTeacherForumGroupsList(long SchoolID)
        {
            ClassTeacher classteacher             = new ClassTeacher();
            ResultInfo <ClassTeacherForum> result = classteacher.GetTeacherForumGroupsList(SchoolID);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #8
0
        public JsonResult GetCurriculumClassWise(TeachersCurriculum Info)
        {
            ClassTeacher classteacher = new ClassTeacher();
            ResultInfo <TeachersCurriculum> result = classteacher.GetCurriculumClassWise(Info);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #9
0
        public JsonResult GetTopicSemesterWise(long SubjectId, int SemesterId, long ClassId, int Level_Id, long SchoolID)
        {
            ClassTeacher      classteacher = new ClassTeacher();
            AddStudentDetails result       = classteacher.getTopicDetails(SubjectId, SemesterId, ClassId, Level_Id, SchoolID);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #10
0
        public JsonResult GetClassTeacherTimeTable(timetable_prop prop)
        {
            ClassTeacher classteacher         = new ClassTeacher();
            List <ClassTeacherTimetable> list = classteacher.getClassTeacherTimeTable(prop);

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Пример #11
0
        public JsonResult GetSemesterDetails()
        {
            ClassTeacher      classteacher = new ClassTeacher();
            AddStudentDetails result       = classteacher.getSemesterDetails();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #12
0
        public ActionResult BindSubjectOnClassIDAndLevelID(long SchoolId, long ClassId, int LvlId)
        {
            ClassTeacher      classteacher = new ClassTeacher();
            AddStudentDetails result       = classteacher.getSubjectDetails(SchoolId, ClassId, LvlId);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #13
0
        public JsonResult GetClassByLevelAndDivisionId(long SchoolId, int DivId, int LvlId)
        {
            ClassTeacher      classteacher = new ClassTeacher();
            AddStudentDetails result       = classteacher.getClassDetails(SchoolId, DivId, LvlId);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #14
0
        public JsonResult GetLevelDetailsOnDivisionId(int Div)
        {
            ClassTeacher      classteacher = new ClassTeacher();
            AddStudentDetails result       = classteacher.getLevelDetails(Div);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #15
0
        public JsonResult CreateOnlineForumGroup(ClassTeacherForumGroups Info)
        {
            ClassTeacher classteacher             = new ClassTeacher();
            ResultInfo <ClassTeacherForum> result = classteacher.CreateOnlineGroup(Info);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #16
0
        public JsonResult ReportCommunityComment(ClassTeacherCommunityCommentReport Info)
        {
            ClassTeacher classteacher             = new ClassTeacher();
            ResultInfo <ClassTeacherForum> result = classteacher.ReportCommunityComment(Info);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #17
0
        public JsonResult GetForumTopicListGroupIDWise(long Forum_ID, long SchoolID, string Forum_Name)
        {
            ClassTeacher classteacher             = new ClassTeacher();
            ResultInfo <ClassTeacherForum> result = classteacher.GetGroupWiseTopic(Forum_ID, SchoolID, Forum_Name);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #18
0
        public JsonResult GetTeachersTopicClassWise(ClassTeacherAssignmentDetails Info)
        {
            ClassTeacher classteacher = new ClassTeacher();
            ResultInfo <ClassTeacherAssignmentDetails> result = classteacher.GetSubjectWiseTopic(Info);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #19
0
        public JsonResult CreateClassTeacherForumTopic(ClassTeacherTopic Info)
        {
            ClassTeacher classteacher             = new ClassTeacher();
            ResultInfo <ClassTeacherForum> result = classteacher.CreateGroupWiseTopic(Info);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #20
0
        public JsonResult InsertClassTeacherMessages(ClassTeacherMessages messages)
        {
            ClassTeacher classteacher = new ClassTeacher();
            string       Result       = classteacher.InsertClassteacherMessagesByUID(messages);

            return(Json(Result, JsonRequestBehavior.AllowGet));
        }
Пример #21
0
        public JsonResult DeleteCommunityComment(long CommentId)
        {
            ClassTeacher classteacher             = new ClassTeacher();
            ResultInfo <ClassTeacherForum> result = classteacher.DeleteCommunityComment(CommentId);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #22
0
        private bool InsertOrUpdate(ClassTeacher classTeacher, ref StringBuilder sbError)
        {
            bool dbFlag = false;
            var  list   = _uofRepository.ClassTeacherRepository.GetListByTermID(_user.TermID, _user.SchoolID, ref dbFlag);

            if (dbFlag)
            {
                sbError.Append("Error getting class teacher list if the problem persit ask system admin");
                return(false);
            }
            if (list != null)
            {
                var classTeacherExist = list.Where(c => c.TeacherID == classTeacher.TeacherID).FirstOrDefault();

                if (classTeacherExist != null)
                {
                    sbError.Append("Teacher already has a class");
                    return(false);
                }
            }

            var isSaved = _uofRepository.ClassTeacherRepository.Save(classTeacher, _user.Username, ref dbFlag);

            if (!isSaved)
            {
                sbError.Append("Error saving if the problem persit ask system admin");
                return(false);
            }

            return(true);
        }
Пример #23
0
        public JsonResult getSubjectTeacherListCount(long UserId, long SchoolId)
        {
            ClassTeacher classteacher = new ClassTeacher();
            long         Count        = classteacher.getSubjectTeacherListCount(UserId, SchoolId);

            return(Json(Count, JsonRequestBehavior.AllowGet));
        }
Пример #24
0
        private void Show()
        {
            tablePersTeacher.Items.Clear();
            Operations a = new ClassTeacher();

            a.ShowPers(tablePersTeacher);
        }
Пример #25
0
 private void Remove()
 {
     if (Index >= 0)
     {
         ClassTeacher.RemoveAt(Index);
     }
 }
Пример #26
0
        private void ShowRank(string rank)
        {
            tablePersTeacher.Items.Clear();
            TeacherInterface a = new ClassTeacher();

            a.ShowPersRank(tablePersTeacher, rank);
        }
Пример #27
0
 private void Remove()
 {
     if (Index >= 0)
     {
         var teacher = ClassTeacher[Index];
         var list    = new List <int>();
         var element = ClassTeacher.Where(c => c.CodeOfTeacher == teacher.CodeOfTeacher).Select(t => t.CodeOfTeacher);
         foreach (var item in element)
         {
             list.Add(item);
         }
         if (list.Count == 2)
         {
             if (RequestToDataBase.Instance.requestDeleteFromTeacherAndDepartments(ClassTeacher, Index))
             {
                 ClassTeacher.Clear();
                 foreach (var value in RequestToDataBase.Instance.ReadTeachers())
                 {
                     ClassTeacher.Add(value);
                 }
             }
         }
         else
         {
             if (RequestToDataBase.Instance.requestDeleteFromTeacher(ClassTeacher, Index))
             {
                 ClassTeacher.Clear();
                 foreach (var value in RequestToDataBase.Instance.ReadTeachers())
                 {
                     ClassTeacher.Add(value);
                 }
             }
         }
     }
 }
Пример #28
0
        private void Add()
        {
            var context = new TeacherVM(departments.ToArray());
            var wind    = new NewTeacher()
            {
                DataContext = context
            };

            wind.ShowDialog();
            if (wind.DialogResult == true)
            {
                bool res = false;
                if (context.Teacher != null)
                {
                    res = RequestToDataBase.Instance.requestInsertIntoTeacher(context.Teacher);
                }
                if (context.Teacher.DepartmentTwo != null && context.Teacher.PostTwo != null)
                {
                    res = RequestToDataBase.Instance.requestInsertIntoTeacherDepartmentTwo(context.Teacher) || res;
                }
                if (res)
                {
                    ClassTeacher.Clear();
                    foreach (var value in RequestToDataBase.Instance.ReadTeachers())
                    {
                        ClassTeacher.Add(value);
                    }
                }
            }
        }
Пример #29
0
        public ActionResult <object> Save([FromBody] ClassTeacher classTeacher)
        {
            try
            {
                Init();
                StringBuilder sbError = new StringBuilder("");

                if (!ModelState.IsValid || classTeacher == null)
                {
                    Response.StatusCode = 400;
                    return("Failed getting classTeacher id");
                }
                else
                {
                    var list = new List <ClassTeacher>();
                    list.Add(classTeacher);
                    var isSaved = _classTeacherService.Save(list, ref sbError);
                    if (isSaved <= 0)
                    {
                        Response.StatusCode = 400;
                        return("classTeacher save failed " + sbError.ToString());
                    }
                    else
                    {
                        return((string)"classTeacher saved successfully");
                    }
                }
            }
            catch (Exception er)
            {
                return(Error(er));
            }
        }
Пример #30
0
        public bool Save(ClassTeacher objClass, string modifiedBy, ref bool dbError)
        {
            try
            {
                using (var connection = GetConnection())
                {
                    var update = @"UPDATE ClassTeacher SET TeacherID = @TeacherID ,
                                    LastModifiedBy = @modifiedBy
                                                                    WHERE ClassID = @ClassID
                                                                    AND TermID = @TermID 
            
                                    AND IsDeleted Is NULL
                                ";
                    var id     = connection.Execute(update,
                                                    new
                    {
                        ClassID    = objClass.ClassID,
                        TermID     = objClass.TermID,
                        TeacherID  = objClass.TeacherID,
                        modifiedBy = modifiedBy,
                    });

                    if (id <= 0)
                    {
                        var insert = @" 
                                            INSERT INTO ClassTeacher
                                               (
                                                ClassID ,
                                                TermID ,
                                               TeacherID , 
                                                LastModifiedBy
                                                )
                                             VALUES
                                               (
                                                @ClassID,  
                                                @TermID , 
                                                @TeacherID  ,
                                                @modifiedBy
                                                ) 
                                ";
                        var idI    = connection.Execute(insert,
                                                        new
                        {
                            ClassID    = objClass.ClassID,
                            TermID     = objClass.TermID,
                            TeacherID  = objClass.TeacherID,
                            modifiedBy = modifiedBy
                        });
                    }
                    return(true);
                }
            }
            catch (Exception er)
            {
                dbError = true;
                DbLog.Error(er);
                return(false);
            }
        }