<div id="detailDiv">
<table>
<tr>
<td>标题:</td>
<td><input class="easyui-textbox" style="width:250px;height:32px" id="title"/></td>
</tr>
<tr>
<td>作者:</td>
<td><input class="easyui-textbox" style="width: 250px; height: 32px" id="author" /></td>
</tr>
<tr>
<td>发布日期:</td>
<td><input class="easyui-textbox" style="width: 250px; height: 32px" id="subDateTime" /></td>
</tr>
<tr>
<td>内容:</td>
<td><input class="easyui-textbox" data-options="multiline:true" style="width: 400px; height: 250px" id="Msg" /></td>
</tr>
</table>
</div>
//设置详细框为不可见
$("#detailDiv").css("display", "none");
//显示新闻详情
function showDetail(index) {
//弹出div
$("#detailDiv").css("display", "block");
$.post("/NewInfo/ShowModelById", { id: index }, function (data) {
$("#title").textbox("setValue", data.Title);
$("#author").textbox("setValue", data.Author);
$("#subDateTime").textbox("setValue", ChangeDateFormat(data.SubDateTime));
$("#Msg").textbox("setValue", data.Msg);
});
//弹出dialog
$("#detailDiv").dialog({
title: "新闻详情",
modal: true,
width: 500,
height: 500,
});
}
/// <summary>
/// 根据id查询出记录
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public NewInfo GetEntityModel(int id)
{
string sql = "select * from T_News where Id=@Id";
DataTable da = SqlHelper.ExcuteDataTable(sql, CommandType.Text, new SqlParameter("@Id", id));
NewInfo newInfo = null;
if (da.Rows.Count > 0)
{
newInfo = new NewInfo();
LoadEntity(da.Rows[0], newInfo);
}
return newInfo;
}
/// <summary>
/// 根据id查询记录
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public NewInfo GetEntityModel(int id)
{
return NewInfoDal.GetEntityModel(id);
}
/// <summary>
/// 根据id查询记录
/// </summary>
/// <returns></returns>
public ActionResult ShowModelById()
{
int id = int.Parse(Request["id"]);
NewInfo model = NewInfoBll.GetEntityModel(id);
return Json(model, JsonRequestBehavior.AllowGet);
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-3 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2026 源码网商城 (www.yuanmawang.com) 版权所有