0
I have a table html
which is created dynamically by the user. I need to take all the data entered by him in the table and generate a List to be able to save later in a database.
Below are project data:
public class Procedimento
{
string cnes;
string cbo;
string profissional;
string procedimento;
int idade;
int quant;
}
Table code:
<table id="tabelaProducao">
<tbody>
<tr>
<th style="text-align:center;">CNES</th>
<th style="text-align:center;">CBO</th>
<th style="text-align:center;">Profissional</th>
<th style="text-align:center;">Procedimento</th>
<th style="text-align:center;">Idade</th>
<th style="text-align:center;">Quant</th>
</tr>
<tr>
<td>7559267</td>
<td>352210</td>
<td>RENATA CARVALHO DA SILVA</td>
<td>0101050062</td>
<td>0</td>
<td>18</td>
</tr>
<tr>
<td>7559267</td>
<td>352210</td>
<td>JOSE SILVANIR DA ROCHA</td>
<td>0101050062</td>
<td>0</td>
<td>18</td>
</tr>
</tbody>
</table>
I think using Json should work, but still do not know how to do.
The data will be received via POST
and the Controller
will read this data and save in the database.
how is the information sent to the backend? how does the backend capture this information? Please provide more details.
– mercador
My idea is to create an array that can be sent to the Controller to turn it into the List and save in the database. I don’t know if I’m being clear, is that I’m learning MVC and Json.
– Italo Rodrigo