测试成功建议提交功能。
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using ClientsLibrary;
|
||||
using CommonLibrary;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
@@ -85,5 +87,34 @@ namespace 软件系统浏览器模版.Controllers
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
//POST
|
||||
/// <summary>
|
||||
/// 获取意见反馈的界面
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[AuthorizeUser]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult AdviceFeedback(string advice)
|
||||
{
|
||||
if (Request.IsAjaxRequest())
|
||||
{
|
||||
//对建议进行保存
|
||||
HslCommunication.OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.意见反馈, UserClient.UserAccount.UserName + ":" + advice);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
return Content("<div class=\"alert alert-success\" role=\"alert\">成功提交数据</div><script>alert('建议提交成功!')</script>", "text/html");
|
||||
}
|
||||
else
|
||||
{
|
||||
return Content("<div class=\"alert alert-danger\" role=\"alert\">建议提交失败,请稍后再试!错误信息:" + result.Message + "</div>", "text/html");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Content("<div class=\"alert alert-danger\" role=\"alert\">这是一个错误的请求!</div>", "text/html");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,20 +2,38 @@
|
||||
@{
|
||||
ViewBag.Title = "意见反馈";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
|
||||
string content = Guid.NewGuid().ToString("N");
|
||||
}
|
||||
|
||||
|
||||
@section scripts
|
||||
{
|
||||
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
|
||||
}
|
||||
|
||||
<h2>请在下方填写意见反馈,字数控制在1000字以内</h2>
|
||||
<div>
|
||||
|
||||
@using (Ajax.BeginForm("AdviceFeedback", "Home", new AjaxOptions()
|
||||
{
|
||||
HttpMethod="POST",
|
||||
UpdateTargetId = content,
|
||||
InsertionMode = InsertionMode.Replace
|
||||
}, new { @class = "form-horizontal" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<div class="form-group">
|
||||
<label for="advice">请输入建议</label>
|
||||
<textarea class="form-control" name="advice" id="advice" placeholder="建议内容,字数1000字以内,不要带回车键" rows="6"></textarea>
|
||||
</div>
|
||||
|
||||
|
||||
@using (Html.BeginForm("AdviceFeedback", "Home", FormMethod.Post))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<div id="@content" class="form-group" style="padding:0px,5px,0px,5px">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="Advice">请输入建议</label>
|
||||
<textarea class="form-control" id="Advice" placeholder="建议,字数1000字以内" rows="6"></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default">提交</button>
|
||||
}
|
||||
|
||||
<button type="submit" class="btn btn-default">提交</button>
|
||||
}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user