@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    DXHelp.BLL.Model.HelpContentInfo info = ViewBag.info as DXHelp.BLL.Model.HelpContentInfo;
    string parentName = "根节点";
    if (info.ParentId > 0)
    {
        var parInfo = new DXHelp.BLL.HelpContent().GetModel(info.ParentId);
        if (parInfo != null)
        {
            parentName = parInfo.Title;
        }
    }
}
@section header{
    <script type="text/javascript" src="@Url.Content("~/Scripts/ckeditor/ckeditor.js")"></script>
    <script type="text/javascript">
        $(function () {
            var form = document.forms['helpeditform'];
            $(form).submit(function () {
                var Title = $.trim(this.Title.value);
                var Content = CKEDITOR.instances.CKEditorID.getData();
                var SortNumber = $.trim(this.SortNumber.value);
                if (Title == '') {
                    alert("标题不能为空");
                    return false;
                }
                if (SortNumber == '') {
                    alert("排序码不能为空");
                    return false;
                }
                if (Content == '') {
                    alert("内容不能为空");
                    return false;
                }
                return true;
            });
        });
    </script>
}
@section menu_left{
    @Html.Partial("~/Views/Shared/_Partial_Menu_Left.cshtml", 1)
}
@section menu_top{
    @Html.Partial("~/Views/Shared/_Partial_Menu_Top.cshtml", 1)
}
<div class="nv">
    <div class="nv-left">
        当前位置：帮助管理 > 帮助列表 > 添加帮助信息
    </div>
</div>
<div class="content">
    @using (Html.BeginForm("edit", "help", FormMethod.Post, new { name = "helpeditform", @class = "f-area" }))
    {
        <div class="f-summary">@Html.ValidationSummary()</div>

        <table width="100%" cellpadding="5" cellspacing="5" border="0">
            <tr>
                <td>
                    <label class="f-title">
                        父级：
                    </label>
                </td>
                <td>
                    <input class="f-text" name="parentName" id="parentName" value="@parentName" readonly="readonly" type="text" />
                </td>
            </tr>
            <tr>
                <td>
                    <label class="f-title">
                        标题：
                    </label>
                </td>
                <td>
                    <input class="f-text" autocomplete="off" type="text" maxlength="20" value="@info.Title" name="Title" placeholder="请输入标题" />
                </td>
            </tr>
            <tr>
                <td>
                    <label class="f-title">
                        关键字：
                    </label>
                </td>
                <td>
                    <input class="f-text" autocomplete="off" type="text" maxlength="20" value="@info.Key" name="Key" placeholder="格式如“[key1]|[key2]”，用于显示相关主题" />
                </td>
            </tr>
            <tr>
                <td>
                    <label class="f-title">
                        排序：
                    </label>
                </td>
                <td>
                    <input class="f-text" autocomplete="off" type="number" maxlength="20" value="@info.SortNumber" name="SortNumber" placeholder="请输入排序码，用于帮助的显示顺序" />
                </td>
            </tr>
            <tr>
                <td>
                    <label class="f-title">
                        内容：
                    </label>
                </td>
                <td>
                    <textarea id="Content" autocomplete="off" name="Content" cols="20" rows="2" class="ckeditor">@info.Content</textarea>
                </td>
            </tr>
        </table>
        <div class="f-submit-row">
            <input type="hidden" name="helpId" value="@info.HelpId" />
            <input type="hidden" name="backurl" value="@ViewBag.backurl" />
            <input class="f-submit" type="submit" value="保存" />
            <input class="f-cancle" type="button" id="cancle" onclick="history.back();" value="返回" />
        </div>
    }
</div>
