public static TeacherCreditReportJsonModel GetTeacherCreditReport(int teacherId)
        {
            Teacher teacher = GetTeacherById(teacherId);

            if (teacher == null)
            {
                return(null);
            }

            TeacherCreditReportJsonModel jsonModel = new TeacherCreditReportJsonModel();

            jsonModel.CreditToTake    = teacher.CreditToTake;
            jsonModel.RemainingCredit = teacher.CreditToTake - GetTakenCredit(teacherId);

            return(jsonModel);
        }
示例#2
0
        public JsonResult GetTeacherCreditReport(int teacherId)
        {
            TeacherCreditReportJsonModel jsonModel = TeacherGateway.GetTeacherCreditReport(teacherId);

            return(Json(jsonModel, JsonRequestBehavior.AllowGet));
        }