Ejemplo n.º 1
0
        public IActionResult Save([FromBody] ExamStatusModel model)
        {
            var result = examStatusManager.Save(model);

            if (result.status)
            {
                return(Ok(new { TestId = result.Data.Id, TestTitle = result.Data.Name }));
            }
            else
            {
                return(BadRequest(result.message));
            }
        }
Ejemplo n.º 2
0
        // [ValidateInput(false)]
        public ActionResult Create(ExamStatusModel examModel)
        {
            ResponseModel <ExamStatusModel> result = null;

            if (examModel.Id == 0)
            {
                result = examStatus.Save(examModel);
            }
            else
            {
                result = examStatus.Update(examModel);
            }
            if (result.status)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ViewBag.ErrorMessage = result.message;
                return(View("Error"));
            }
        }