SQL query for ASP.NET page with C#

Asked

Viewed 269 times

0

On my client’s website, I have an SQL query that brings the result of the level of readiness of several collaborators. Only that, for now, I can only transfer to the page the result of the query in a Gridview:

SQL QUERY

SELECT codigoAvaliacao, codigoColaborador, nomeColaborador, nivelProntidao 
FROM TableAvaliacoes

RESULT EXAMPLE

codigoAvaliacao | codigoColaborador | nomeColaborador | nivelProntidao
--------------- | ----------------- | --------------- | --------------
1               | 1                 | Fulano          | 90
2               | 3                 | João            | 75
3               | 4                 | Ciclano         | 83,5
4               | 6                 | Beltrano        | 44,44
5               | 10                | Silva           | 68,11

My idea was to bring the result of this query in another way, associating with a figure called Ninebox. She puts the names on the squares depending on the level of readiness. Here’s an example of the figure as I found on the internet: inserir a descrição da imagem aqui

So, for now, I could only put the HTML code of the table with the proper colors:

<table>
    <tr>
        <td width="200" height="200" style="color: black; background-color: yellow"><center id="names1"></center></td>
        <td width="200" height="200" style="color: black; background-color: rgb(151,195,82)"><center id="names2"></center></td>
        <td width="200" height="200" style="color: white; background-color: rgb(12,133,54)"><center id="names3"></center></td>
    </tr>
    <tr>
        <td width="200" height="200" style="color: black; background-color: rgb(245,154,73)"><center id="names4"></center></td>
        <td width="200" height="200" style="color: black; background-color: yellow"><center id="names5"></center></td>
        <td width="200" height="200" style="color: black; background-color: rgb(151,195,82)"><center id="names6"></center></td>
    </tr>
    <tr>
        <td width="200" height="200" style="color: white; background-color: red"><center id="names7"></center></td>
        <td width="200" height="200" style="color: black; background-color: rgb(245,154,73)"><center id="names8"></center></td>
        <td width="200" height="200" style="color: black; background-color: yellow"><center id="names9"></center></td>
    </tr>
</table>

What I would need then from this SQL query is created another one and comes something like this (assuming the results were the image names instead of the result example), with the names of each square separated by the tab:

QUADRADO | NOMES
-------- | -----
1        | Francisco
2        | NULL
3        | Vera
4        | NULL
5        | Alice<br>Alexandre<br>Marcos<br>Madalena
6        | Ângela<br>José 
7        | Maria
8        | João<br>Pedro
9        | Benedito<br>Carla<br>David

What I put as SQL query for this case?

  • Where are the below and above-expected values? Using what? Asp.NET MVC, Webforms, Aspx, etc?

  • @Randrade I thought that each square or strip has slightly different track values: 0 at 20% - SQUARE 7 20 at 40% - SQUARE 4 40 at 60% - SQUARE 8 60 at 65% - SQUARE 1 65 at 70% - SQUARE 5 70 at 75% - SQUARE 9 75 at 82% - SQUARE 2 82 to 90% - SQUARE 6 90 to 100% - SQUARE 3 And the language is Asp.NET MVC with C#. Is in the title.

  • which model is moving to the view? you can simply work with the list you move to the view

  • If you provide as you evaluate what is high or low and how much is expected is easy. For example calculating these values, Joining with a table of square values (to separate people) and then applying a CTE to "accumulate" the names. Although the correct one would be to just pass the list of names and their categories and let the UI "insert them" into the squares, until pq vc may want to apply different formatting to each square depending on the amount of names in each one.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.