public HttpResponseMessage Post([FromBody] SystemRolePermission systemRolePermission) { try { DbLibrary dbLibrary = new DbLibrary(); BO_SystemRolePermission boSystemRolePermission = new BO_SystemRolePermission(dbLibrary); DataMessage dataMessage = new DataMessage(boSystemRolePermission.Create(systemRolePermission)); return(Request.CreateResponse(HttpStatusCode.OK, dataMessage)); } catch (Exception e) { ErrorMessage mensaje = new ErrorMessage("2.1", "Excepción en la creación del permiso role: " + e.GetBaseException().Message, e.ToString()); return(Request.CreateResponse(HttpStatusCode.BadRequest, mensaje)); } }
public HttpResponseMessage PutStateRolePermission(string PermissionId, string RoleId, bool State) { try { DbLibrary dbLibrary = new DbLibrary(); BO_SystemRolePermission boSystemRolePermission = new BO_SystemRolePermission(dbLibrary); DataMessage dataMessage = new DataMessage(boSystemRolePermission.ChangeState(PermissionId, RoleId, State)); return(Request.CreateResponse(HttpStatusCode.OK, dataMessage)); } catch (Exception e) { ErrorMessage mensaje = new ErrorMessage("2.1", "Excepción en el cambio de estado del permiso role: " + e.GetBaseException().Message, e.ToString()); return(Request.CreateResponse(HttpStatusCode.BadRequest, mensaje)); } }
public HttpResponseMessage GetPermissionRoles(string RoleId) { try { DbLibrary dbLibrary = new DbLibrary(); BO_SystemRolePermission boSystemRolePermission = new BO_SystemRolePermission(dbLibrary); DataMessage dataMessage = new DataMessage(boSystemRolePermission.GetrolId(RoleId)); return(Request.CreateResponse(HttpStatusCode.OK, dataMessage)); } catch (Exception e) { ErrorMessage mensaje = new ErrorMessage("2.1", "Excepción en la obtención del roles users: " + e.GetBaseException().Message, e.ToString()); return(Request.CreateResponse(HttpStatusCode.BadRequest, mensaje)); } }