The index controller get all the information needed and set the View variable to send the web page to the client. The Index controller was developed as follows:

public ActionResult Index(int langid = 1)
{
  //Help strings
    Text Text_ = new Text ();
    ViewBag.Texto = Text_.textMainMenu(langid);
    ViewBag.Labels = Text_.textEtMenu(langid);
    ViewBag.Lang = Text_.textLang();
    ViewBag.langid = langid; 
    return View();
}

Here, the controller call to the Text Model to get all the web page strings as (Text) that is send to the veiw as viewbag. Then this viewbag is interpreted by @razor technology

The view code was developed as follows:

@{
    List<string> Texto = ViewBag.Texto;
    List<string> Labels = ViewBag.Labels;
    List<string> Lang = ViewBag.Lang;
    var langid = ViewBag.langid;
    Forest_MTIS.Models.ControllerModels gmController = new Forest_MTIS.Models.ControllerModels();
    List<int> control = gmController.controles();
    }

<head>
    <title>@Texto[0]</title>
    <link href="~/Style/Style.css" rel="stylesheet" />
</head>

<header>
    <section>
        <div  style="background-color:black; position:absolute; width:100%; text-align: right"><button onclick="langid_s(1)">@Lang[0]</button><button onclick="    langid_s(2)"> @Lang[1]</button><button style="margin-right: 10px" onclick="    langid_s(3)">@Lang[2]</button></div>
        <table style="width: 100%;height: 150px; background-color: rgb(235, 235, 235); background-image: url('../../Images/header_backgroud.png'); background-size:100% 100%">
            <tr>
                <td style=" width:30%; text-align:left" onclick="main()">
                    <img src="~/Images/header_Icon_left.png" style="width:auto; height: 150px" />
                </td>
                <td style="width:40%; text-align:center">
                </td>
                <td style="width:30%; text-align:right">
                    <img src="~/Images/header_Icon_right.png" style="width:auto; height: 150px" />
                </td>
            </tr>
        </table>
    </section>
</header>

<body style="background-color:rgb(128, 128, 128); width:100%; float:left">
    <section style="background-image:url('../../Images/body_background.png'); background-repeat:no-repeat; background-size:100% 100%">
        <table class="bar_menu" align="center">
            <tr>
                @if (control[0] + control[1] + control[2] == 0 && control[3] + control[4] + control[5] == 0)
                {
                    <td class="label" style=" width:50%; height:50px" onclick="main()">
                        <img src="~/Images/etiquetas/label_on.png" class="bar_menu_label_Img" />
                        <div class="bar_menu_label_text"> <b>@Labels[0]</b></div>
                    </td>
                    <td class="label" style="width:50%; height:50px" onclick="info()">
                        <img src="~/Images/Labels/label_off.png" class="bar_menu_label_Img" />
                        <div class="bar_menu_label_text"> @Labels[3] </div>
                    </td>
                }
                else if (control[0] + control[1] + control[2] == 0 && control[3] + control[4] + control[5] > 0)
                {
                    <td class="label" style="width:33.3%; height:50px" onclick="main()">
                        <img src="~/Images/Labels/label_on.png" class="bar_menu_label_Img" />
                        <div class="bar_menu_label_text"> <b>@Labels[0]</b></div>
                    </td>
                    <td class="label" style="width:33.3%; height:50px" onclick="thinning()">
                        <img src="~/Images/Labels/label_off.png" class="bar_menu_label_Img" />
                        <div class="bar_menu_label_text"> @Labels[2] </div>
                    </td>
                    <td class="label" style="width:33.3%; height:50px" onclick="info()">
                        <img src="~/Images/Labels/label_off.png" class="bar_menu_label_Img" />
                        <div class="bar_menu_label_text"> @Labels[3] </div>
                    </td>
                }
                else if (control[0] + control[1] + control[2] > 0 && control[3] + control[4] + control[5] == 0)
                {
                    <td class="label" style=" width:33.3%; height:50px" onclick="main()">
                        <img src="~/Images/Labels/label_on.png" class="bar_menu_label_Img" />
                        <div class="bar_menu_label_text"> <b>@Labels[0]</b></div>
                    </td>
                    <td class="label" style="width:33.3%; height:50px" onclick="simul()">
                        <img src="~/Images/Labels/label_off.png" class="bar_menu_label_Img" />
                        <div class="bar_menu_label_text"> @Labels[1] </div>
                    </td>
                    <td class="label" style="width:33.3%; height:50px" onclick="info()">
                        <img src="~/Images/Labels/label_off.png" class="bar_menu_label_Img"/>
                        <div class="bar_menu_label_text"> @Labels[3] </div>
                    </td>
                }
                else
                {
                    <td class="label" style=" width:25%; height:50px"  onclick="main()">
                        <img class="bar_menu_label_Img" src="~/Images/Labels/label_on.png"/>
                        <div class="bar_menu_label_text"> <b>@Labels[0]</b></div>
                    </td>
                    <td class="label" style="width:25%; height:50px" onclick="simul()">
                        <img src="~/Images/Labels/label_off.png" class="bar_menu_label_Img" />
                        <div class="bar_menu_label_text"> @Labels[1] </div>
                    </td>
                    <td class="label" style="width:25%; height:50px" onclick="thinning()">
                        <img src="~/Images/Labels/label_off.png" class="bar_menu_label_Img" />
                        <div class="bar_menu_label_text"> @Labels[2] </div>
                    </td>
                    <td class="label" style="width:25%; height:50px" onclick="info()">
                        <img src="~/Images/Labels/label_off.png" class="bar_menu_label_Img" />
                        <div class="bar_menu_label_text"> @Labels[3] </div>
                    </td>
                }
            </tr>
        </table>
        <div style="margin: 0 auto 0 auto; width:1000px; height:740px; background-image: url('../../Images/background_WorkPanel.png'); background-size:100% 100%">
            <section style="width:100%">
                <div>
                    <br />
                    <h2 style="text-align: center">@Texto[1]</h2>
                    <br />
                </div>
            </section>
            <section style="width:100%; height:460px; float:left; text-align:center">
                <table style="width:95%; text-align:center">
                    <tr>
                        @if (control[0] + control[1] + control[2] == 0 && control[3] + control[4] + control[5] == 0)
                        {
                            <td style="width:100%">
                                <h1> Modo mantenimiento // Maintenance Mode // Modo de manutenção</h1>
                            </td>
                        }
                        else if (control[0] + control[1] + control[2] > 0 && control[3] + control[4] + control[5] == 0)
                        {
                            <td style="width:100%; height:100%; text-align: center">
                                <img class="" src="~/Images/Main_Img_1.png" height="350" onclick="simul()" style="cursor:pointer" />
                                <input type="button" class="buttonInic" value="@Texto[2]" onclick="simul()">
                                <div style=" height:80px; font-size:small; margin-top:10px">
                                    @Texto[7]
                                </div>
                            </td>
                        }
                        else if (control[0] + control[1] + control[2] == 0 && control[3] + control[4] + control[5] >0)
                        {
                            <td style="width:100%; height:100%; text-align: center">
                                <img src="~/Images/Main_Img_2.png" height="350" onclick=" thinning()" style="cursor:pointer" />
                                <input type="button" class="buttonInic" value="@Texto[3]" onclick="thinning()">
                                <div style=" height:80px; font-size:small; margin-top:10px">
                                    @Texto[8]
                                </div>
                            </td>
                        }
                        else
                        {
                            <td style="width:50%; margin-top:10px; text-align: center">
                                <img src="~/Images/Main_Img_1.png" height="350" onclick="simul()" style="cursor:pointer" />
                                <input type="button" class="buttonInic" value="@Texto[2]" onclick="simul()">
                                <div style=" height:80px; font-size:small; margin:10px 20px 0px 20px ">
                                    @Texto[7]
                                </div>
                            </td>
                            <td style="width:50%; margin-top:10px;  text-align: center">
                                <img src="~/Images/Main_Img_2.png" height="350" onclick=" thinning()" style="cursor:pointer" />
                                <input type="button" class="buttonInic" value="@Texto[3]" onclick="thinning()">
                                <div style=" height:80px; font-size:small; margin:10px 20px 0px 20px">
                                    @Texto[8]
                                </div>
                            </td>
                        }

                    </tr>
                </table>
            </section>
            <hr>
            <section style="float:left; width:100%; height:180px; text-align:center; background-image:url('../../Images/backgroud_right_work_panel.png'); background-repeat:no-repeat; background-size:250px 120px; background-position:bottom right ">
                <div style="width:100%; font-size:small;  text-align:center">
                    <p style="margin:10px 20px 0px 20px">@Texto[4]</p>
                    <p style="font-size:small">@Texto[5] <a href="~/Resources/lang_@langid/FlorNext users manual.pdf" target="_blank">@Texto[6]</a></p>
                </div>
            </section>
        </div>
    </section>
</body>

<footer style="width:100%; float:left">
    <section>
        <table style=" width:100%;background-color:rgb(250, 250, 250); border-top-style:ridge; border-bottom-style:ridge">
            <tr>
                <td style="text-align:left">
                    <img src="~/Images/footer_icon_left.png" style="width:auto; height: 70px" />
                </td>
                <td style="text-align:right">
                    <img src="~/Images/footer_icon_right.png" style="width:auto; height: 70px" />
                </td>
            </tr>
         </table>
    </section>
    <p style="text-align:center; font-size:x-small">----- Forest_MTIS© Copyright 2015 - All rights reserved -----</p>
</footer>



<script>



    function simul()
    {
        var url = '@Url.Action("index", "Simul", new { langid = langid})';
        window.location.href = url;
    }

    function thinning()
    {
        var url = '@Url.Action("index", "Thinning", new { langid = langid })';
        window.location.href = url;
    }

    function main() {
        var url = '@Url.Action("index", "Ppal", new { langid = langid})';
        window.location.href = url;
    }

    function info()
    {
        var url = '@Url.Action("info", "Ppal", new { langid = langid})';
        window.location.href = url;
    }

    function langid_s(a)
    {
        if(a != @langid)
        {
            switch (a)
            {
                case 1:
                    var url = '@Url.Action("index", "Ppal", new { langid = "1" })';
                    break;
                case 2:
                    var url = '@Url.Action("index", "Ppal", new { langid = "2" })';
                    break;
                case 3:
                    var url = '@Url.Action("index", "Ppal", new {langid = "3"})';
                    break;
             }
            url = url.replace("amp;","");
            window.location.href = url;
        }
    }
</script>
 

Last edit: Fernando Pérez Rodríguez 2018-02-05