Exemple #1
0
 public void UpdateUserRoles(SecurityModels.UpdateUserRolesRequest updateUserRolesRequest)
 {
     try
     {
         using (SqlConnection con = new SqlConnection(securityConnectionString))
         {
             using (SqlCommand cmd = new SqlCommand("UpdateUserRoles", con))
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@Id", SqlDbType.Int).Value        = updateUserRolesRequest.id;
                 cmd.Parameters.Add("@Roles", SqlDbType.VarChar).Value = updateUserRolesRequest.roles;
                 con.Open();
                 cmd.ExecuteNonQuery();
             }
             con.Close();
         }
     }
     catch
     {
         throw;
     }
 }
Exemple #2
0
 public IActionResult UpdateUserRoles([FromBody] SecurityModels.UpdateUserRolesRequest updateUserRolesRequest)
 {
     securityInventoryRepo.UpdateUserRoles(updateUserRolesRequest);
     return(StatusCode(StatusCodes.Status200OK, ""));
 }