Exemple #1
0
 public void AsignarRol([FromBody] AsignarRolDTO dto)
 {
     try
     {
         blsa.AsignarRol(dto.idUsuario, dto.rol, dto.fechaVencLibreta);
     }
     catch (Exception e)
     {
         throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e.Message));
     }
 }
Exemple #2
0
        public async Task <ICollection <Vehiculo> > AsignarRol(int idUsuario, Rol rol, DateTime?fechaVencLibreta = null)
        {
            try
            {
                AsignarRolDTO ar = new AsignarRolDTO()
                {
                    idUsuario        = idUsuario,
                    rol              = rol,
                    fechaVencLibreta = fechaVencLibreta
                };

                HttpResponseMessage response = await client.PutAsJsonAsync(basicPath + "AsignarRol", ar);

                response.EnsureSuccessStatusCode();

                return(await response.Content.ReadAsAsync <ICollection <Vehiculo> >());
            }
            catch (Exception e)
            {
                throw e;
            }
        }