AspNet Two Tables on a View

Viewed 28

I im build a ASP.Net MVC 4 Application and i need to use two tables.

Example: enter image description here

The first table i have the products that is in my database, when i click on the green button, the item need to be inside the table down, i can choose any item that i want and when i finish, i click on Save to register that "Sell", but i cant do that.

My question:

How can i get the item values from the first table using a button and pass to the controller?

Can i just put on the other table using JavaScript and when i finish i send to the controller?

I Just want pass data from table 1 to table 2!

My code:

Table 1

    <!--Table to display registered products-->
<table class="table table-condensed table-hover">
    <thead>
        <tr>
            <th>CODIGO</th>
            <th>NOME</th>
            <th>PRECO</th>
            <th>QUANTIDADE</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @if (Model != null)
        {
            foreach (var product in Model)
            {
                <tr>
                    <td>@Html.DisplayFor(model => product.idProduct)</td>
                    <td>@Html.DisplayFor(model => product.nameProduct)</td>
                    <td><p>R$@Html.DisplayFor(model => product.pricesaleProduct)</p></td>
                    <td><input type="text" class="form-control bfh-number" value="1"></td>
                    <!--Here i want get values to put on other table Or send to a controller-->
                    <td>
                        <a class="btn btn-success"><span class="glyphicon glyphicon-plus"> Adicionar</span></a>
                    </td>
                </tr>
            }
        }
    </tbody>
</table>

Table 2:

<!--Table to display selected products-->
<table class="table table-condensed table-hover">
    <thead>
        <tr>
            <th>CODIGO</th>
            <th>NOME</th>
            <th>PRECO</th>
            <th>QUANTIDADE</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
    </tbody>
</table>
1 Answers
Related