Esempio n. 1
0
        public int AddEdit(ExamGrades entity)
        {
            entity.DateCreated = DateTime.Now;
            entity.DateModified = DateTime.Now;

            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            if (string.IsNullOrEmpty(entity.ExamGradeID))
            {
                entity.ExamGradeID = Utility.GeneratorUniqueId("EXMGRD_");

                if (objUser != null && !string.IsNullOrEmpty(objUser.UserID))
                {
                    entity.CreatedByID = objUser.UserID;
                    entity.ModifiedByID = objUser.UserID;
                }
                else
                {
                    entity.CreatedByID = "1";
                    entity.ModifiedByID = "1";
                }
            }
            else
            {
                if (objUser != null && !string.IsNullOrEmpty(objUser.UserID))
                    entity.ModifiedByID = objUser.UserID;
                else
                    entity.ModifiedByID = "1";
            }

            string[] addParams = new string[] { ExamGrades_Constant.EXAM_GRADE_ID, ExamGrades_Constant.EXAM_ID, ExamGrades_Constant.MARKS_PERCENT_FROM, ExamGrades_Constant.MARKS_PERCENT_TO, ExamGrades_Constant.GRADE, ExamGrades_Constant.CREATED_BY_ID, ExamGrades_Constant.MODIFIED_BY_ID };

            return _IExamGradesRepository.ExecuteNonQuery(entity, addParams, ExamGrades_Constant.SPROC_EXAMGRADES_UPS);
        }
Esempio n. 2
0
        private SelectList GetGradesForExam(string ExamID)
        {
            List<ExamGrades> lstExamGrade = new List<ExamGrades>();
            ExamGrades obj = new ExamGrades();
            obj.ExamID = ExamID;

            lstExamGrade = _IExamGradesService.GetGradesForExam(obj).ToList();

            SelectList retList = new SelectList(lstExamGrade, "ExamGradeID", "Grade");

            return retList;
        }
Esempio n. 3
0
 public ActionResult DeleteExamGrades(string ExamGradeID, string ExamID = "")
 {
     ExamGrades model = new ExamGrades();
     model.ExamGradeID = ExamGradeID;
     model.ExamID = ExamID;
     _IExamGradesService.Delete(model);
     return RedirectToAction("ManageExamGrades", "Exam", new { ExamId = model.ExamID });
 }
Esempio n. 4
0
 public ActionResult AddEditExamGrades(ExamGrades model)
 {
     _IExamGradesService.AddEdit(model);
     return RedirectToAction("ManageExamGrades", "Exam", new { ExamID = model.ExamID });
 }
Esempio n. 5
0
        public ActionResult AddEditExamGrades(string ExamGradeID = "", string ExamId = "")
        {
            ExamGrades model = new ExamGrades();

            if (!string.IsNullOrEmpty(ExamGradeID))
            {
                model.ExamGradeID = ExamGradeID;
                model = _IExamGradesService.Get(model);
            }
            model.ExamID = ExamId;
            ViewBag.GradeList = GetLookupValues("Grade");
            return PartialView("_AddEditExamGrades", model);
        }
Esempio n. 6
0
 public object GetScalar(ExamGrades obj)
 {
     throw new NotImplementedException();
 }
Esempio n. 7
0
 public IEnumerable<ExamGrades> GetGradesForExam(ExamGrades obj)
 {
     string[] addParams = new string[] { ExamGrades_Constant.EXAM_ID};
     return _IExamGradesRepository.GetAll(obj, addParams, ExamGrades_Constant.SPROC_EXAMGRADES_FOREXAM);
 }
Esempio n. 8
0
 public IEnumerable<ExamGrades> GetAll(ExamGrades entity)
 {
     string[] addParams = new string[] { ExamGrades_Constant.EXAM_ID, Constants.PAGEINDEX, Constants.PAGESIZE, Constants.SORTEXP };
     return _IExamGradesRepository.GetAll(entity, addParams, ExamGrades_Constant.SPROC_EXAMGRADES_LSTALL);
 }
Esempio n. 9
0
 public ExamGrades Get(ExamGrades obj)
 {
     string[] addParams = new string[] { ExamGrades_Constant.EXAM_GRADE_ID};
     return _IExamGradesRepository.Get(obj, addParams, ExamGrades_Constant.SPROC_EXAMGRADES_SEL);
 }
Esempio n. 10
0
 public int Delete(ExamGrades entity)
 {
     string[] addParams = new string[] { ExamGrades_Constant.EXAM_GRADE_ID};
     return _IExamGradesRepository.ExecuteNonQuery(entity, addParams, ExamGrades_Constant.SPROC_EXAMGRADES_DEL);
 }