Line Break for CheckBox

0

I'm trying to make in my Razor HTML form screen a scheme to play the "Material Pickup" checkbox for the line below, but I'm not getting it, when selecting the "Water Quantity" option, two new ones appear below which are "Public" and "Private", if the third one is on the same line, it will confuse the user, but I only managed to get the "Material Retreat" down as shown below:

Anotheralternativewouldbetotrytogiveanorderbyintheforeachofthemodesthatareloadedviatheon-screencheckbox,asshownbelow:

BelowtheHTMLcodeRazorthatloadstheExtinctionpartonthescreen,inthecodehasaptagwhereIgotpushedtotherightcornerofthescreenthe"Retract Material":

@using SDO.Domain.Entities
@model List<OcorrenciaIncendioModoExtincao>
@{
    var modo1 = Model.FirstOrDefault(m => m.ModoExtincaoId == 1);
    var modo2 = Model.FirstOrDefault(m => m.ModoExtincaoId == 2);
    var modo5 = Model.FirstOrDefault(m => m.ModoExtincaoId == 5);
    var modo6 = Model.FirstOrDefault(m => m.ModoExtincaoId == 6);
}
<div class="panel panel-default">
    <div class="panel-heading">
        <h4 class="panel-title">Modo Extinção</h4>
    </div>
    <div class="input-container panel-body" name="FormModoExtincao">
        <div class="col-sm-12">
            @foreach (var modo in ViewBag.ModoExtincao as List<ModoExtincao>)
            {
                if (modo.Id == 5)
                {
                    <div class="clearfix"></div>
                }
                    <div class="col-sm-3" name="[email protected]">
                        <p>
                            <label>
                                <input type="checkbox"
                                       classname="ModosExtincao"
                                       name="ModoExtincaoId"
                                       id="@modo.Id"
                                       value="@modo.Id"
                                       @(modo.Dependencia.HasValue ? "data-dep=" + modo.Dependencia.Value + " ignore" : "data-dep=0")
                                       @(Model.FirstOrDefault(a => a.ModoExtincaoId == modo.Id) != null ? "checked" : "")
                                       @(modo.Dependencia.HasValue && Model.FirstOrDefault(a => a.ModoExtincaoId == modo.Dependencia) != null && ((modo.Id == 5 || modo.Id == 2) && Model.FirstOrDefault(a => a.ModoExtincaoId == modo.Dependencia).QtdConsumidaPublica > 0) ? "checked" : "" )
                                       @(modo.Dependencia.HasValue && Model.FirstOrDefault(a => a.ModoExtincaoId == modo.Dependencia) != null && (modo.Id == 6 && Model.FirstOrDefault(a => a.ModoExtincaoId == modo.Dependencia).QtdConsumidaParticular > 0) ? "checked" : "" ) />

                                @modo.Descricao
                            </label>
                            @if (modo.Id == 2 || modo.Id == 5 || modo.Id == 6) //ESPUMA, PUBLICA, PARTICULAR
                            {
                                <div class="complemento" data-dep="@modo.Id">

                                    <span>@(modo.Id == 2 ? "Quantidade consumida (Litros)" : "Quantidade consumida (m³)")</span>
                                    <div>
                                        <input type="number"
                                               classname="ModosExtincao"
                                               class="form-control form-control-80"
                                               name="[email protected]"
                                               data-dep="@modo.Id"
                                               belongs-to="@(modo.Dependencia.HasValue ? modo.Dependencia : modo.Id)"
                                               searchfor="ModoExtincaoId"
                                               max="99999"
                                               maxlength="5"
                                               value="@((modo2 != null && modo.Id == 2 && modo2.QtdConsumidaEspuma != null)
	                                                    ? modo2.QtdConsumidaEspuma.ToString()
                                                            : (modo1 != null && modo.Id == 5 && modo1.QtdConsumidaPublica != null )
                                                            ? modo1.QtdConsumidaPublica.ToString()
                                                                : (modo1 != null && modo.Id == 6 && modo1.QtdConsumidaParticular != null)
                                                                    ? modo1.QtdConsumidaParticular.ToString()
                                                                    : "")" />
                                    </div>
                                    @if (modo.Id == 6)
                                    {
                                        var ed = Model.FirstOrDefault(m => m.ModoExtincaoId == modo.Dependencia);
                                        <div>
                                            <span>Do próprio imóvel?</span>
                                            <label><input type="radio" name="ProprioImovel" value="1" @(ed != null && string.IsNullOrEmpty(ed.EnderecoOutraEdificacao) ? "checked" : "" ) />Sim</label>
                                            <label><input type="radio" name="ProprioImovel" value="0" @(ed != null && !string.IsNullOrEmpty(ed.EnderecoOutraEdificacao) ? "checked" : "" ) />Não</label>
                                            <div class="complemento">
                                                <span>Endereço da edificação da qual usou a água: </span>
                                                <input type="text"
                                                       classname="ModosExtincao"
                                                       class="form-control"
                                                       belongs-to="@modo.Dependencia"
                                                       searchfor="ModoExtincaoId"
                                                       maxlength="80"
                                                       name="EnderecoOutraEdificacao"
                                                       value="@(ed != null ? ed.EnderecoOutraEdificacao : "" )" />
                                            </div>
                                        </div>
                                    }
                                </div>
                            }
                        </p>&nbsp;
                    </div>
                }
        </div>
    </div>
</div>

I would like to know if I can do an Orderby in the checkbox in the foreach by changing the order of the options, leaving Water quantity last or in Razor itself to solve this question, thanks.

    
asked by anonymous 20.12.2018 / 21:22

0 answers