RoleGroups.cshtml 4.65 KB
@*
    -----------------------------------------
    User - RoleGroups.cshtml
    -----------------------------------------
*@
@using VRH.Log4Pro.MultiLanguageManager
@using Vrh.Web.Common.Lib
@using Vrh.Web.Membership.Areas.UserAdministration.Controllers

@model UserManagerModel
@{
    object routeVal = new { area = WebConst.AREA, editMode = Model.EditMode };
    string dataNewInputId = "newdatainputid-rolegroups";
    string dataRowsPlaceId = "datarowsplaceid-rolegroups";
}

@*
    -----------------------------------------
    User - RoleGroups.cshtml
    -----------------------------------------
*@
<h2>@Html.Raw(Model.Trans(typeof(WordCodes.MvcMembership.Titles.RoleGroupManagement)))</h2>
<div class="table-responsive" style="max-height:500px;overflow-y:auto;">
    <table class="table table-sm table-dark table-hover">
        <thead>
            <tr>
                <th style="text-align:center;width:30px;">#</th>
                <th>@Html.Raw(Model.Trans(typeof(WordCodes.MvcMembership.Labels.RoleGroupName)))</th>
            </tr>
        </thead>
        <tbody id="@(dataRowsPlaceId)"></tbody>
    </table>
</div>
<table class="table" style="margin-bottom:0px;">
    <tr>
        <td>
            @if (Model.EditMode != EditModes.Select)
            {
                <div class="input-group" style="width:300px;">
                    <input id="@(dataNewInputId)" class="form-control" />
                    <span class="input-group-btn">
                        <button type="button" class="btn btn-success ml-1" onclick="handler.addData();">
                            @(Html.Raw(Model.Trans(typeof(GeneralWordCodes.MLM.General.Words.Add))))
                        </button>
                    </span>
                </div>
            }
        </td>
        <td style="text-align:right;">
            <button type="button" class="btn btn-secondary" style="" onclick="vrhct.bootbox.hide('@(Model.BootboxId)');">
                @(Html.Raw(Model.Trans(typeof(GeneralWordCodes.MLM.General.Words.Cancel))))
            </button>
        </td>
    </tr>
</table>

<script type="text/javascript">
    var handler;
    $(document).ready(function () {
        'use strict';
        var thisfn = 'RoleGroups.cshtml: document.ready: ';
        console.log(thisfn + 'PING');

        handler = new VrhIdNameHandler({
            AllowAdd: @((Model.EditMode != EditModes.Select).ToString().ToLower()),
            AllowDelete: @((Model.EditMode != EditModes.Select && Model.EditMode != EditModes.Add).ToString().ToLower()),
            AllowUpdate: @((Model.EditMode != EditModes.Select).ToString().ToLower()),
            Confirm: {
                Delete: '@Html.Raw(Model.Trans(typeof(WordCodes.MvcMembership.Messages.Confirmations.RoleGroupDelete)))'
            },
            Id: {
                Editor: '@(Model.BootboxId)',
                DataRows: '@(dataRowsPlaceId)',
                DataNew: '@(dataNewInputId)',
            },
            Label: {
                Button: {
                    No: '@Html.Raw(Model.Trans(typeof(GeneralWordCodes.MLM.General.Words.No)))',
                    Yes: '@Html.Raw(Model.Trans(typeof(GeneralWordCodes.MLM.General.Words.Yes)))',
                },
                Data: '@Html.Raw(Model.Trans(typeof(WordCodes.MvcMembership.Labels.RoleGroupName)))',
            },
            LCID: '@(Model.LCID)',
            Message: {
                Delete: '@Html.Raw(Model.Trans(typeof(WordCodes.MvcMembership.Messages.Warnings.RoleGroupDelete)))',
                Wait: '@Html.Raw(Model.Trans(typeof(GeneralWordCodes.MLM.General.Messages.PleaseWait)))',
            },
            Title: {
                Confirm: '@Html.Raw(Model.Trans(typeof(GeneralWordCodes.MLM.General.Titles.Confirmation)))',
                IconPencil: '@Html.Raw(Model.Trans(typeof(WordCodes.MvcMembership.Titles.RoleGroupEdit)))',
                IconTrash: '@Html.Raw(Model.Trans(typeof(WordCodes.MvcMembership.Titles.RoleGroupEdit)))',
            },
            Url: {
                Add: '@Html.Raw(Url.Action(nameof(UserController.RoleGroupAdd), WebConst.CONTROLLER_USER, routeVal))',
                Delete: '@Html.Raw(Url.Action(nameof(UserController.RoleGroupDelete), WebConst.CONTROLLER_USER, routeVal))',
                List: '@Html.Raw(Url.Action(nameof(UserController.RoleGroupList), WebConst.CONTROLLER_USER, routeVal))',
                Update: '@Html.Raw(Url.Action(nameof(UserController.RoleGroupUpdate), WebConst.CONTROLLER_USER, routeVal))'
            }
        });
        console.log(thisfn + 'handler=', handler);
    });// $(document).ready event VÉGE
</script>

@*
    -----------------------------------------
    User - RoleGroups.cshtml
    -----------------------------------------
*@