@using Common
@model string
<div class="main">
    <form method="post" class="form-horizontal form ui-validForm" action="@Url.Action()">
        <div class="control-group">
            <label class="control-label"><span class="bgname">查找用户</span></label>
            <div class="controls">
                <input type="text" name="request_username" id="request_username" maxlength="100" class="form-control ui-edit-readonly" placeholder="填写好友的用户名，务必填写正确" data-validate="dataType:'*" nullMsg:'请填写好友用户名">
                <span class="help-block request_username"></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">好友分组</label>
            <div class="controls">
                <select id="friend_sortid" name="friend_sortid" class="form-control">
                    <option value="0">无分组</option>
                </select>
                <span class="help-block"></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">好友备注</label>
            <div class="controls">
                <input type="text" id="friend_beizhu" name="friend_beizhu" class="form-control" maxlength="100" PlaceHolder="选填">
                <span class="help-block"></span>
            </div>
        </div>
        <div class="control-group request_info">
            <label class="control-label">请求内容</label>
            <div class="controls">
                <input type="text" id="request_info" name="request_info" class="form-control" maxlength="100" PlaceHolder="我是某某某">
                <span class="help-block"></span>
            </div>
        </div>

        <div class="postarea">
            <div class="control-group">
                <div class="controls">
                    <input type="hidden" id="uid" name="uid" value="@PA.GetCurrentUser().Uid">
                    <input type="hidden" id="state" name="state" value="0">
                    <input type="hidden" id="thedate" name="thedate" value="@DateTime.Now">
                    <button type="button" class="btn btn-primary btn-sm ui-pagePost" data-custom-params="url:'@Url.Action()',callBack:'PostRefreshBack',failCallBack:'failcallback'">提交</button>
                    <button type="button" class="btn btn-default btn-sm ui-closeDialog">关闭</button>
                </div>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    var params = { valueField: "id", textField: "name" }
    var sortid = CallAjax("get", false, "@Url.Action("ListData", "FriendsSort")");
    $("#friend_sortid").FillSelect(eval(sortid), params);

    function failcallback(data) {
        $(".request_username").text(data.Msg).css({ "color": "red" })
    }
</script>