毕业论文
计算机论文
经济论文
生物论文
数学论文
物理论文
机械论文
新闻传播论文
音乐舞蹈论文
法学论文
文学论文
材料科学
英语论文
日语论文
化学论文
自动化
管理论文
艺术论文
会计论文
土木工程
电子通信
食品科学
教学论文
医学论文
体育论文
论文下载
研究现状
任务书
开题报告
外文文献翻译
文献综述
范文
ASP.net网络信息发布系统设计与实现+ER图+流程图(9)
protected void Button1_Click(object sender, EventArgs e)
{
string sSql = "insert into News(Title,Contents,Publisher,Sort) values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + Session["Users"].ToString() + "','" + DropDownList1.Text + "')";
SQL s = new SQL();
bool result = s.SqlResults(sSql);
if (result == true)
{
TextBox1.Text = "";
TextBox2.Text = "";
Page.RegisterStartupScript("alert", "<script>alert('添加成功!');</script>");
}
else
{
Page.RegisterStartupScript("alert", "<script>alert('添加失败!');</script>");
}
}
4.3 信息修改设计及实现
信息修改页面主要是针对已添加的信息进行相关信息的修改。页面设计如图4.3所示。
图4.3 信息修改页面
点击‘编辑’后,可进入到内容修改页面,如图4.4所示。
图4.4 撰写修改页面
通过对之前已经添加进入数据库的信息内容的调用来实现该步中对信息修改的操作,修改完成的信息将添加到数据库中并覆盖之前信息的内容,发布时间等信息。系统功能实现的关键代码如下:
//信息检索
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
private void bind()
{
string sSql = "select * from News where Checks=0";
SQL s = new SQL();
DataSet ds = s.DSSearch(sSql);
GridView1.DataSource = ds.Tables[0].DefaultView;
GridView1.DataKeyNames = new string[] { "id" };
GridView1.DataBind();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
bind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
string id = GridView1.DataKeys[e.NewEditIndex].Value.ToString();
Response.Redirect("News_editdetail.aspx?id="+id);
}
//信息更新
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
共16页:
上一页
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
下一页
上一篇:
Html5+CSS3川南苗族文化传播网站的分析设计与开发+ER图+流程图
下一篇:
C#公司考勤管理系统设计+可行性研究+需求分析
IEEE802.15.4网络自适应策略研究
Android员工请假系统设计
MATLAB基于流形学习与神经网络的预测建模
社交网络个性化推荐方法对比研究
高校校园网信息安全隐患及防范措施
大数据时代下电子商务个性化信息服务研究
jsp+mysql网络招标评审系统设计+源代码
小学《道德与法治》学习心得体会
紫陵阁
淮安市老漂族心理与休闲体育现状的研究
适合宝妈开的实体店,适...
大学生就业方向与专业关系的研究
人事管理系统开题报告
组态王文献综述
弹道修正弹实测弹道气象数据使用方法研究
浅谈动画短片《天降好运》中的剧本创作
林业机械作业中的安全性问题【2230字】