Pull Only one data within a Modal

0

Personal I need your help.

On a page cshtml I made foreach where I pull all the data I have in a table, along with the values that have in it, as you can see the picture below.

Hereismyforeachbelow.

@foreach(variteminModel){varIdCentro=10000+item.CentroId;//EstoqueAvareABag=double.Parse((item.EstoqueA*2).ToString("N1"));
                    var eABagString = eABag >= 2 ? $"{eABag} bags" : $"{eABag} bag";

                    // Estoque B
                    var eBBag = double.Parse((item.EstoqueB * 2).ToString("N1"));
                    var eBBagString = eBBag >= 2 ? $"{eBBag} bags" : $"{eBBag} bag";

                    // Estoque C
                    var eCBag = double.Parse((item.EstoqueC * 2).ToString("N1"));
                    var eCBagString = eCBag >= 2 ? $"{eCBag} bags" : $"{eCBag} bag";

                    // Estoque D
                    var eDBag = double.Parse((item.EstoqueD * 2).ToString("N1"));
                    var eDBagString = eDBag >= 2 ? $"{eDBag} bags" : $"{eDBag} bag";

                    // Estoque E
                    var eEBag = double.Parse((item.EstoqueE * 2).ToString("N1"));
                    var eEBagString = eEBag >= 2 ? $"{eEBag} bags" : $"{eEBag} bag";

                    // Estoque F
                    var eFBag = double.Parse((item.EstoqueF * 2).ToString("N1"));
                    var eFBagString = eFBag >= 2 ? $"{eFBag} bags" : $"{eFBag} bag";

                    <tr>
                        <td>@IdCentro</td>
                        <td>@item.Nome</td>
                        <td class="text-center">
                            <span data-toggle="tooltip" data-placement="bottom" title="@eABagString"><i class="fa fa-flask"></i> @eABag</span>
                        </td>

                        <td class="text-center">
                            <span data-toggle="tooltip" data-placement="bottom" title="@eBBagString"><i class="fa fa-flask"></i> @eBBag</span>
                        </td>
                        <td class="text-center">
                            <span data-toggle="tooltip" data-placement="bottom" title="@eCBagString"><i class="fa fa-flask"></i> @eCBag</span>
                        </td>
                        <td class="text-center">
                            <span data-toggle="tooltip" data-placement="bottom" title="@eDBagString"><i class="fa fa-flask"></i> @eDBag</span>
                        </td>
                        <td class="text-center">
                            <span data-toggle="tooltip" data-placement="bottom" title="@eEBagString"><i class="fa fa-flask"></i> @eEBag</span>
                        </td>
                        <td class="text-center">
                            <span data-toggle="tooltip" data-placement="bottom" title="@eFBagString"><i class="fa fa-flask"></i> @eFBag</span>
                        </td>
                        <td class="text-center">
                            <a id="@item.CentroId" data-content="@item.Nome" name="btn_detalhes" class="ui grey label btn_detalhe">Detalhes</a>
                        </td>
                    </tr>
                }

My request for help is as follows.

Where is the details option I need to display a modal with data only from a selected "center".

example ID: 10001 - HOSP OF THE HEART OF SAO PAULO - Details, display those data that are in the table. (I need it to display because I'll add more refined data to what appears in the table.)

On another page of my system I have this modal working, but I'm not able to implement this page because of the

@model IEnumerable<Basics.Domain.Entities.Centro>

Below is the modal I need to display

I need this modal below to be displayed in the image above

@model Basics.Domain.Entities.Centro

<div id="estoque-centro" class="modal fade" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">@(Model.CentroId > 0 ? "Estoque atual" : "Atenção")</h4>
            </div>
            <div class="modal-body">
                @if (Model.CentroId > 0)
                {
                    // Estoque A
                    var eACaixa = double.Parse((Model.EstoqueA / 15).ToString("N1"));
                    var eACaixaString = eACaixa >= 2 ? $"{eACaixa} caixas" : $"{eACaixa} caixa";
                    var eALitro = double.Parse(Model.EstoqueA.ToString("N1"));
                    var eALitroString = eALitro >= 2 ? $"{eALitro} litros" : $"{eALitro} litro";
                    var eABag = double.Parse((Model.EstoqueA * 2).ToString("N1"));
                    var eABagString = eABag >= 2 ? $"{eABag} bags" : $"{eABag} bag";

                    // Estoque B
                    var eBCaixa = double.Parse((Model.EstoqueB / 15).ToString("N1"));
                    var eBCaixaString = eBCaixa >= 2 ? $"{eBCaixa} caixas" : $"{eBCaixa} caixa";
                    var eBLitro = double.Parse(Model.EstoqueB.ToString("N1"));
                    var eBLitroString = eBLitro >= 2 ? $"{eBLitro} litros" : $"{eBLitro} litro";
                    var eBBag = double.Parse((Model.EstoqueB * 2).ToString("N1"));
                    var eBBagString = eBBag >= 2 ? $"{eBBag} bags" : $"{eBBag} bag";

                    // Estoque C
                    var eCCaixa = double.Parse((Model.EstoqueC / 15).ToString("N1"));
                    var eCCaixaString = eCCaixa >= 2 ? $"{eCCaixa} caixas" : $"{eCCaixa} caixa";
                    var eCLitro = double.Parse(Model.EstoqueC.ToString("N1"));
                    var eCLitroString = eCLitro >= 2 ? $"{eCLitro} litros" : $"{eCLitro} litro";
                    var eCBag = double.Parse((Model.EstoqueC * 2).ToString("N1"));
                    var eCBagString = eCBag >= 2 ? $"{eCBag} bags" : $"{eCBag} bag";

                    // Estoque D
                    var eDCaixa = double.Parse((Model.EstoqueD / 15).ToString("N1"));
                    var eDCaixaString = eDCaixa >= 2 ? $"{eDCaixa} caixas" : $"{eDCaixa} caixa";
                    var eDLitro = double.Parse(Model.EstoqueD.ToString("N1"));
                    var eDLitroString = eDLitro >= 2 ? $"{eDLitro} litros" : $"{eDLitro} litro";
                    var eDBag = double.Parse((Model.EstoqueD * 2).ToString("N1"));
                    var eDBagString = eDBag >= 2 ? $"{eDBag} bags" : $"{eDBag} bag";

                    // Estoque E
                    var eECaixa = double.Parse((Model.EstoqueE / 15).ToString("N1"));
                    var eECaixaString = eECaixa >= 2 ? $"{eECaixa} caixas" : $"{eECaixa} caixa";
                    var eELitro = double.Parse(Model.EstoqueE.ToString("N1"));
                    var eELitroString = eELitro >= 2 ? $"{eELitro} litros" : $"{eELitro} litro";
                    var eEBag = double.Parse((Model.EstoqueE * 2).ToString("N1"));
                    var eEBagString = eEBag >= 2 ? $"{eEBag} bags" : $"{eEBag} bag";

                    // Estoque F
                    var eFCaixa = double.Parse((Model.EstoqueF / 15).ToString("N1"));
                    var eFCaixaString = eFCaixa >= 2 ? $"{eFCaixa} caixas" : $"{eFCaixa} caixa";
                    var eFLitro = double.Parse(Model.EstoqueF.ToString("N1"));
                    var eFLitroString = eFLitro >= 2 ? $"{eFLitro} litros" : $"{eFLitro} litro";
                    var eFBag = double.Parse((Model.EstoqueF * 2).ToString("N1"));
                    var eFBagString = eFBag >= 2 ? $"{eFBag} bags" : $"{eFBag} bag";

                    <div class="row" style="font-size: 1.5em;">
                        <div class="col-md-12">
                            <div class="row">
                                <div class="col-md-6">
                                    <label>A:</label>
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eACaixaString"><i class="fa fa-th-large"></i> @eACaixa</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eALitroString"><i class="fa fa-tint"></i> @eALitro</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eABagString"><i class="fa fa-flask"></i> @eABag</span>
                                </div>
                                <div class="col-md-6">
                                    <label>D:</label>
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eDCaixaString"><i class="fa fa-th-large"></i> @eDCaixa</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eDLitroString"><i class="fa fa-tint"></i> @eDLitro</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eDBagString"><i class="fa fa-flask"></i> @eDBag</span>
                                </div>
                            </div>
                            <div class="row" style="margin-top: 15px;">
                                <div class="col-md-6">
                                    <label>B:</label>
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eBCaixaString"><i class="fa fa-th-large"></i> @eBCaixa</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eBLitroString"><i class="fa fa-tint"></i> @eBLitro</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eBBagString"><i class="fa fa-flask"></i> @eBBag</span>
                                </div>
                                <div class="col-md-6">
                                    <label>E:</label>
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eECaixaString"><i class="fa fa-th-large"></i> @eECaixa</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eELitroString"><i class="fa fa-tint"></i> @eELitro</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eEBagString"><i class="fa fa-flask"></i> @eEBag</span>
                                </div>
                            </div>
                            <div class="row" style="margin-top: 15px;">
                                <div class="col-md-6">
                                    <label>C:</label>
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eCCaixaString"><i class="fa fa-th-large"></i> @eCCaixa</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eCLitroString"><i class="fa fa-tint"></i> @eCLitro</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eCBagString"><i class="fa fa-flask"></i> @eCBag</span>
                                </div>
                                <div class="col-md-6">
                                    <label>F:</label>
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eFCaixaString"><i class="fa fa-th-large"></i> @eFCaixa</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eFLitroString"><i class="fa fa-tint"></i> @eFLitro</span> |
                                    <span data-toggle="tooltip" data-placement="bottom" title="@eFBagString"><i class="fa fa-flask"></i> @eFBag</span>
                                </div>
                            </div>
                        </div>
                    </div>
                }
            </div>
        </div>
    </div>
</div>

This code above will display the following modal on the screen

    
asked by anonymous 15.03.2018 / 14:46

0 answers