// [TypeFilter(typeof(AuthorizeAction), Arguments = new object[] { "Read" })] public IActionResult SummaryView() { HoldingNatureViewModel model = new HoldingNatureViewModel(); InitAccessModel(model); return(View(model)); }
/// <summary> /// Get the Data based on ID and return to the model to update view. /// </summary> /// <param name="ID"></param> /// <returns></returns> // [TypeFilter(typeof(AuthorizeAction), Arguments = new object[] { "Write" })] public IActionResult Update(int ID) { HoldingNatureViewModel model = new HoldingNatureViewModel(); model.HoldingNature = _holdingNatureService.GetData(ID); if (model != null) { return(View("Index", model)); } else { return(View("SummaryView", model)); } }
public IActionResult AddUpdate(HoldingNatureViewModel model) { JsonResponse response = new JsonResponse(); // If the model valid go to the next level if (ModelState.IsValid) { response = _holdingNatureService.AddUpdate(model.HoldingNature); return(Json(response)); }// Else it shows the error message. else { JsonResponse resp = new JsonResponse { Message = Constants.ControllerMessage.All_Fields_Mandatory }; return(Json(resp)); } }