public ActionResult UpdateCurrentBussinessGroupID([FromBody] EditCurrentBussinessGroupUserViewModel model) { if (model == null) { return(BadRequest("Job Master is null.")); } if (!ModelState.IsValid) { return(BadRequest()); } int CurrentBussinessGroupID = Convert.ToInt32(model.CurrentBussinessGroupID); int UserID = Convert.ToInt32(model.ID); _userProvider.EditCurrentBussinessGroupID(CurrentBussinessGroupID, UserID); return(Ok()); }
public JsonResult UpdateCurrentBussinessGroupID(EditCurrentBussinessGroupUserViewModel model) { AjaxViewModel jsonViewModel = new AjaxViewModel(); try { string json = JsonConvert.SerializeObject(model); var endpoint = ApiUrl.SecurityUrl + "UpdateCurrentBussinessGroupID"; Utilities.RestAPIHelper <EditCurrentBussinessGroupUserViewModel> .Submit(json, Method.POST, endpoint); jsonViewModel.SetValues(true, null, "CurrentBussinessGroupID has been updated"); } catch (Exception ex) { jsonViewModel.SetValues(false, null, String.Format("Failed\\nMessage: {0}", ex.GetBaseException().Message)); } return(Json(jsonViewModel)); }