Exemple #1
0
        public IActionResult ExamParameterAssign(ExamParameter examParameter)
        {
            var result = _examParameterService.AddOrUpdate(examParameter);

            if (result.Success)
            {
                return(RedirectToAction("Index", "ExamParameter"));
            }

            return(BadRequest());
        }
Exemple #2
0
        public IResult AddOrUpdate(ExamParameter examParameter)
        {
            var list = _examParameterDal.GetList();

            if (list.Any())
            {
                list[0].LengthOfExam      = examParameter.LengthOfExam;
                list[0].NumberOfQuestions = examParameter.NumberOfQuestions;
                _examParameterDal.Update(list[0]);
                return(new SuccessResult(Messages.UpdatedSuccess));
            }

            examParameter.Id = "1";
            _examParameterDal.Insert(examParameter);
            return(new SuccessResult(Messages.AddedSuccess));
        }
Exemple #3
0
 public IResult Delete(ExamParameter examParameter)
 {
     _examParameterDal.Delete(examParameter);
     return(new SuccessResult(Messages.DeletedSuccess));
 }