Linha 101: |
Linha 101: |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | <big><b>3.4)</b></big> Ainda em <code>C:\TOTVS\CorporeRM\EducaMobile\Views\Shared</code> fazer uma cópia do arquivo <code>_Menu.cshtml</code> (backup). | + | <big><b>3.4)</b></big> Ainda em <code>C:\TOTVS\CorporeRM\EducaMobile\Views\Shared</code> fazer uma cópia do arquivo <code>_Menu.cshtml</code> (backup) e, no arquivo original, após a linha <code>@model TOTVS.Models.ProfileModel</code>, insira o seguinte script: |
− | | |
− | <big><b>3.4.1)</b></big> No arquivo original, após a linha <code>@using System.Drawing;</code>, insira o seguinte script:
| |
− | <syntaxhighlight lang="javascript">
| |
− | @using System.Text;
| |
− | @using System.IO;
| |
− | @using System.Runtime.Serialization.Json;
| |
− | </syntaxhighlight>
| |
− | <big><b>3.4.2)</b></big> No arquivo original, após a linha <code>@model TOTVS.Models.ProfileModel</code>, insira o seguinte script:
| |
| <syntaxhighlight lang="javascript"> | | <syntaxhighlight lang="javascript"> |
| <script type="text/javascript"> | | <script type="text/javascript"> |
| var _nameUser = '@Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase((Model.UserName ?? string.Empty).ToLower())'; | | var _nameUser = '@Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase((Model.UserName ?? string.Empty).ToLower())'; |
| </script> | | </script> |
− |
| |
− | @if (@Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase((Model.UserName ?? string.Empty).ToLower()) == "Eduardo Abeling Alves")
| |
− | {
| |
− | @:<script type="text/javascript">var _entrou = true; var _jsonModel; var _jsonSession;</script>
| |
− |
| |
− | try
| |
− | {
| |
− | DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Model));
| |
− | MemoryStream ms = new MemoryStream();
| |
− | ser.WriteObject(ms, Model);
| |
− | string jsonString = Encoding.UTF8.GetString(ms.ToArray());
| |
− | ms.Close();
| |
− | @:<script type="text/javascript">_jsonModel = '@jsonString';</script>
| |
− | }
| |
− | catch
| |
− | {
| |
− | @:<script type="text/javascript">console.log('Deu erro na Model!');</script>
| |
− | }
| |
− |
| |
− | try
| |
− | {
| |
− | ser = new DataContractJsonSerializer(typeof(Session));
| |
− | ms = new MemoryStream();
| |
− | ser.WriteObject(ms, Session);
| |
− | jsonString = Encoding.UTF8.GetString(ms.ToArray());
| |
− | ms.Close();
| |
− | @:<script type="text/javascript">_jsonSession = '@jsonString' ;</script>
| |
− | }
| |
− | catch
| |
− | {
| |
− | @:<script type="text/javascript">console.log('Deu erro na Session!');</script>
| |
− | }
| |
− | }
| |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |