Example #1
0
 public ActionResult GetSubjectByGrade(string grade)
 {
     try
     {
         var objTemporary = new Ex_SubjectAction().GetSubjectByGrade(grade);
         return(Json(new { status = "success", Message = Ultity.Constant.Ajax_Success, Data = objTemporary }));
     }
     catch (Exception exception)
     {
         Ultity.TFunction.WriteToLog(exception);
         return(Json(new { status = "fail", Message = Ultity.Constant.Ajax_Fail }));
     }
 }
Example #2
0
        public ActionResult GetInfoData(int type, string grade, string examId, string subjectId)
        {
            try
            {
                switch (type)
                {
                case 1:     //lấy môn học theo khối
                {
                    var objTemporary = new Ex_SubjectAction().GetSubjectByGrade(grade);
                    return(Json(new { status = "success", Message = Ultity.Constant.Ajax_Success, Data = objTemporary }));
                }

                case 2:     //Lấy đề thi theo môn và khối
                {
                    var objTemporary = new SysAdminAction <Ex_Exam>().List("a.SubjectId=" + subjectId + " and a.Grade='" + grade.Trim() + "'", "a.Orders desc", 0, 100);
                    return(Json(new { status = "success", Message = Ultity.Constant.Ajax_Success, Data = objTemporary }));
                }

                case 3:    //Lấy chương theo đề thi
                {
                    var objTemporary = new SysAdminAction <Ex_ExamConfig>().List("a.ExamCode='" + examId + "'", "a.Orders desc", 0, 100);
                    return(Json(new { status = "success", Message = Ultity.Constant.Ajax_Success, Data = objTemporary }));
                }

                default:     //break;
                {
                    return(Json(new { status = "err", Message = Ultity.Constant.Ajax_Fail }));
                }
                }
            }
            catch (Exception exception)
            {
                Ultity.TFunction.WriteToLog(exception);
                return(Json(new { status = "fail", Message = Ultity.Constant.Ajax_Fail }));
            }
        }