Exemplo n.º 1
0
        public ActionResult Attendance(decimal studentId, decimal groupId)
        {
            var sigId    = GetSigId(studentId, groupId);
            var lectures = StudentInGroupLectureService.GetAll(x =>
                                                               x.StudentInGroup_ID == sigId).ToList();

            GroupCertService.CreateOrExistsEng(sigId, null, false);
            var model = new GroupAttendanceVM {
                GroupId      = groupId,
                Lectures     = lectures,
                SigId        = sigId,
                HasGroupCert = GroupCertService.IsCertExist(sigId, true)
            };

            return(BaseViewWithModel(new GroupAttendanceView(), model));
        }
Exemplo n.º 2
0
 public ActionResult CurrentAttendance()
 {
     if (User == null)
     {
         return(null);
     }
     if (User.Student_ID != null)
     {
         var groupId = StudentInGroupLectureService.GetAll(x =>
                                                           x.Lecture.LectureDateBeg <= DateTime.Now &&
                                                           x.Lecture.LectureDateEnd >= DateTime.Now &&
                                                           x.StudentInGroup.Student_ID == User.Student_ID &&
                                                           (x.Truancy.GetValueOrDefault() || x.Lateness > 0 || x.Departure > 0) &&
                                                           BerthTypes.AllPaidForCourses.Contains(x.StudentInGroup.BerthType_TC))
                       .Select(x => x.StudentInGroup.Group_ID).FirstOrDefault();
         if (groupId > 0)
         {
             return(Content(Url.Group().Details(groupId,
                                                Images.Main("AttendanceFail.png")).Style("float:right").ToString()));
         }
     }
     return(null);
 }