Web/Admin/Chedui/Chedui_edit.aspx.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace Maticsoft.Web.Admin.Chedui
{
public partial class Chedui_edit : System.Web.UI.Page
{
public Model.Chedui cheduiModel;
BLL.Chedui b_c = new BLL.Chedui();
protected void Page_Load(object sender, EventArgs e)
{
Model.MasterUser adminmod = (Model.MasterUser)Session["User"];
if (adminmod == null)
{
Response.Redirect("/Admin/Login.aspx");
return;
}
if (!IsPostBack)
{
CheduiBind();
}
}
protected void CheduiBind()
{
if (cheduiModel == null)
{
int aid = int.Parse(Request.QueryString["aid"]);
cheduiModel = b_c.GetModel(aid);
}
}
protected void btnEdit_Click(object sender, EventArgs e)
{
int aid = int.Parse(Request.QueryString["aid"]);
cheduiModel = b_c.GetModel(aid);
cheduiModel.Atitle = Request.Form["title"];
cheduiModel.Abstract = Request.Form["Abstract"];
if (hd_img.Value != "")
cheduiModel.Small_img = hd_img.Value;
if (b_c.Update(cheduiModel))
{
ClientScript.RegisterStartupScript(this.GetType(), "", "parent.Dialog.alert('展示修改成功!');location.href='Chedui_list.aspx';", true);
}
else
ClientScript.RegisterStartupScript(this.GetType(), "", "parent.Dialog.alert('展示修改失败!');", true);
CheduiBind();
}
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
