public ActionResult Update(UpdateRoleModel updateRoleModel) // working Ok { if (ModelState.IsValid) { _roleMasterRepository.UpdateRoleMaster(updateRoleModel); if (updateRoleModel != null) { responsemessage2 = new ResponseMessage2("success", ""); } else { responsemessage2 = new ResponseMessage2("Failed", ""); } } return(Ok(responsemessage2)); }
public ActionResult Save([FromBody] InsertRoleModel insertRoleModel) { if (ModelState.IsValid) { var inserrdata = _roleMasterRepository.InsertRoleMaster(insertRoleModel); if (inserrdata != 0) { responsemessage2 = new ResponseMessage2("success", ""); } else { responsemessage2 = new ResponseMessage2("Failed", ""); } } return(Ok(responsemessage2)); }
public async Task <ActionResult <RoleModel> > DeleteSingle([FromQuery] string id) { if (id == null) { return(BadRequest("Invalid State")); } _roleMasterRepository.BulkDelete(id); if (id != null) { responsemessage2 = new ResponseMessage2("success", ""); } else { responsemessage2 = new ResponseMessage2("failure", "Could not Delete"); } return(Ok(responsemessage2)); }
public async Task <ActionResult <RoleModel> > Delete([FromBody] RoleModel roleModel) { if (roleModel == null) { return(BadRequest("Invalid State")); } int[] rollid = roleModel.id; // For Multiple RoleId Sepration by ; var newrollid = String.Join(";", rollid); _roleMasterRepository.BulkDelete(newrollid); if (newrollid != null) { responsemessage2 = new ResponseMessage2("success", ""); } else { responsemessage2 = new ResponseMessage2("failure", "Could not Delete"); } return(Ok(responsemessage2)); }