コード例 #1
0
        public ActionResult ProfessorIndicatorManagement()
        {
            Session["ScoreList"] = new List <Model.Models.Score>();

            SetViewBag(title: "مدیریت شاخص های اساتید", menuItem: "ProfessorIndicatorManagement");
            var professorIndicators = _indicatorService.GetMany(g => g.ObjectType.Name == "اساتید").OrderBy(o => o.Id).ToList();

            return(View(Mapper.Map <List <Model.Models.Indicator>, List <Models.Indicator> >(professorIndicators)));
        }
コード例 #2
0
        //[HttpPost]
        //public ActionResult EducationalGroupManagerPresenceForAdmin(string college)
        //{
        //    var collegeId = Convert.ToInt32(college);
        //    var groups = _educationalGroupService.GetMany(g => g.College.CollegeCode == collegeId).ToList();
        //    TempData["model"] = groups;
        //    TempData["collegeId"] = collegeId;
        //    return this.Json(string.Empty);
        //}
        public ActionResult EditEducationalGroupManagerPresence()
        {
            var groupId = 0;
            var termId  = 0;

            if (int.TryParse(Request.QueryString["group"], out groupId) && int.TryParse(Request.QueryString["termId"], out termId))
            {
                var group                                = _educationalGroupService.Get(g => g.EducationalGroupCode == groupId && g.Term.Id == termId);
                var onlineIndicator                      = _indicatorService.GetMany(g => g.CountOfType == "g" + (int)IndicatorGroupName.وضعیت_حضور_آنلاین_مدیر_گروه).FirstOrDefault();
                var physicalIndicator                    = _indicatorService.GetMany(g => g.CountOfType == "g" + (int)IndicatorGroupName.وضعیت_حضور_فیزیکی_مدیران_گروه).FirstOrDefault();
                var otherIndicator                       = _indicatorService.GetMany(g => g.CountOfType == "g" + (int)IndicatorGroupName.وضعیت_سایر_جلسات_حضور_مدیر_گروه).FirstOrDefault();
                var onlineHolidaysIndicator              = _indicatorService.GetMany(g => g.CountOfType == "g" + (int)IndicatorGroupName.تعطیلات_رسمی_کلاس_آنلاین_مدیر_گروه).FirstOrDefault();
                var offlineHolidaysIndicator             = _indicatorService.GetMany(g => g.CountOfType == "g" + (int)IndicatorGroupName.تعطیلات_رسمی_کلاس_فیزیکی_مدیر_گروه).FirstOrDefault();
                var educationAndResearchCouncilIndicator = _indicatorService.GetMany(g => g.CountOfType == "g" + (int)IndicatorGroupName.جلسات_شورای_آموزشی_پژوهشی).FirstOrDefault();
                var ol   = onlineIndicator.Scores.ToList();
                var pl   = physicalIndicator.Scores.ToList();
                var othl = otherIndicator.Scores.ToList();
                var onhl = onlineHolidaysIndicator.Scores.ToList();
                var ofhl = offlineHolidaysIndicator.Scores.ToList();
                var erl  = educationAndResearchCouncilIndicator.Scores.ToList();

                if (ol.Count() > 0)
                {
                    ViewBag.OnlineScoreList = new SelectList(ol, "Id", "Name");
                    var currentOnlineScore = GetCurrentRating(groupId, "g" + (int)IndicatorGroupName.وضعیت_حضور_آنلاین_مدیر_گروه, termId) / onlineIndicator.Ratio.Point;
                    if (currentOnlineScore != 0)
                    {
                        ViewBag.OnlineScoreId = ol.FirstOrDefault(f => f.Point == currentOnlineScore).Id;
                    }
                }
                if (pl.Count() > 0)
                {
                    ViewBag.PhysicalScoreList = new SelectList(pl, "Id", "Name");
                    var currentPhysicalScore = GetCurrentRating(groupId, "g" + (int)IndicatorGroupName.وضعیت_حضور_فیزیکی_مدیران_گروه, termId) / physicalIndicator.Ratio.Point;
                    if (currentPhysicalScore != 0)
                    {
                        ViewBag.PhysicalScoreId = pl.FirstOrDefault(f => f.Point == currentPhysicalScore).Id;
                    }
                }
                if (othl.Count() > 0)
                {
                    ViewBag.OtherScoreList = new SelectList(othl, "Id", "Name");
                    var currentOtherScore = GetCurrentRating(groupId, "g" + (int)IndicatorGroupName.وضعیت_سایر_جلسات_حضور_مدیر_گروه, termId) / otherIndicator.Ratio.Point;
                    if (currentOtherScore != 0)
                    {
                        ViewBag.OtherScoreId = othl.FirstOrDefault(f => f.Point == currentOtherScore).Id;
                    }
                }

                if (onhl.Count() > 0)
                {
                    ViewBag.OnlineHolidayScoreList = new SelectList(ol, "Id", "Name");
                    var currentOnlineHolidayScore = GetCurrentRating(groupId, "g" + (int)IndicatorGroupName.تعطیلات_رسمی_کلاس_آنلاین_مدیر_گروه, termId) / onlineHolidaysIndicator.Ratio.Point;
                    if (currentOnlineHolidayScore != 0)
                    {
                        ViewBag.OnlineHolidayScoreId = onhl.FirstOrDefault(f => f.Point == currentOnlineHolidayScore).Id;
                    }
                }
                if (ofhl.Count() > 0)
                {
                    ViewBag.offlineHolidayScoreList = new SelectList(ol, "Id", "Name");
                    var currentOfflineHolidayScore = GetCurrentRating(groupId, "g" + (int)IndicatorGroupName.تعطیلات_رسمی_کلاس_فیزیکی_مدیر_گروه, termId) / offlineHolidaysIndicator.Ratio.Point;
                    if (currentOfflineHolidayScore != 0)
                    {
                        ViewBag.OfflineHolidayScoreId = ofhl.FirstOrDefault(f => f.Point == currentOfflineHolidayScore).Id;
                    }
                }
                if (erl.Count() > 0)
                {
                    ViewBag.EducationalAndResearchCouncilScoreList = new SelectList(ol, "Id", "Name");
                    var currentEducationAndResearchCouncilScore = GetCurrentRating(groupId, "g" + (int)IndicatorGroupName.جلسات_شورای_آموزشی_پژوهشی, termId) / educationAndResearchCouncilIndicator.Ratio.Point;
                    if (currentEducationAndResearchCouncilScore != 0)
                    {
                        ViewBag.EducationAndResearchCouncilId = erl.FirstOrDefault(f => f.Point == currentEducationAndResearchCouncilScore).Id;
                    }
                }

                ViewBag.TermId = Request.QueryString["termId"];
                return(PartialView(group));
            }
            else
            {
                return(null);
            }
        }