Beispiel #1
0
        public ResponseResult GetStudentExamResult(GetStudemtExamResultVM model)
        {
            ResponseResult responseResult = new ResponseResult();

            try
            {
                var examResultList = _dbContext.GetExamInfoForStudent_SP(model.ClassId, model.SectionId,
                                                                         model.Shift, model.ExamTypeId, model.Year, model.Roll);

                if (examResultList != null)
                {
                    responseResult.Content       = examResultList;
                    responseResult.MessageCode   = MessageCode.Y.ToString();
                    responseResult.SystemMessage = "Data found.";
                }
                else
                {
                    responseResult.Content       = null;
                    responseResult.MessageCode   = MessageCode.N.ToString();
                    responseResult.SystemMessage = "Data not found.";
                }
            }
            catch (Exception ex)
            {
                responseResult.Content       = null;
                responseResult.MessageCode   = MessageCode.N.ToString();
                responseResult.SystemMessage = ex.Message;
            }
            return(responseResult);
        }
Beispiel #2
0
        public ActionResult GetStudentExamResult(int roll, int classId, int sectionId, string shift, int examTypeId, int year)
        {
            ResponseResult responseResult = new ResponseResult();
            List<GetExamInfoForStudent_SP_Result> resultList = new List<GetExamInfoForStudent_SP_Result>();
            GetStudemtExamResultVM data = new GetStudemtExamResultVM()
            {
                Roll = roll,
                ClassId = classId,
                SectionId = sectionId,
                ExamTypeId = examTypeId,
                Shift = shift,
                Year = year
            };
            try
            {
                var res = _apiRequest.HttpPostRequest(data, "api/Exam/StudentExamResult");
                string apiResponse = res.ToString();
                responseResult = JsonConvert.DeserializeObject<ResponseResult>(apiResponse);

                if (responseResult.MessageCode == "Y")
                {
                    resultList = JsonConvert.DeserializeObject<List<GetExamInfoForStudent_SP_Result>>(responseResult.Content.ToString());
                }
                //else if (responseResult.MessageCode == "N")
                //{
                //    //teachers = JsonConvert.DeserializeObject<bool>(responseResult.Content.ToString());
                //}

            }
            catch (Exception ex)
            {
                TempData["msgAlert"] = "N";
                TempData["msgAlertDetails"] = ex.Message.ToString();
            }
            ViewData["ClassList"] = new SelectList(GetClassListForDropDown(), "ClassId", "ClassWithShift");
            ViewData["SectionList"] = new SelectList(GetSectionListForDropDown(), "SectionId", "SectionName");
            ViewData["YearList"] = new SelectList(YearList(), "Year", "Year");
            return View(resultList);
        }