コード例 #1
0
 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));
     }
 }
コード例 #2
0
 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));
     }
 }
コード例 #3
0
 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));
     }
 }