protected void submitButton_Click(object sender, EventArgs e) { string idString = Request.QueryString["id"]; int idInt = Convert.ToInt32(idString); if (null == idString || idString.Equals(string.Empty) || 1 > idInt) { UtilFunctions.AlertBox("请输入正确的请求代号!", Page); return; } string title = TitleTextBox.Text; string article = ArticleTextBox.Text; NewsDAO newsDao = new NewsDAO(); int categoryId = Convert.ToInt32(this.CategoryDropDownList.SelectedValue); if (1 > categoryId) { UtilFunctions.AlertBox("请选择正确的文章类型!", Page); return; } if (-1 == newsDao.EditNews(idInt, categoryId, title, article)) { UtilFunctions.AlertBox("修改失败!", Page); } else { UtilFunctions.AlertBox("修改成功!", Page); } }
protected void SubmitButton_Click(object sender, EventArgs e) { string categoryType = Request.QueryString["id"]; int categoryId = Convert.ToInt32(categoryType); if (null == categoryType || categoryType.Equals(string.Empty)) { UtilFunctions.AlertBox("页面ID错误,请重新载入!", Page); return; } InformationDAO informationDao = new InformationDAO(); if (0 < informationDao.UpdateInformation(categoryId, ContentTextBox.Text)) { UtilFunctions.AlertBox("修改成功!", Page); } else { UtilFunctions.AlertBox("修改失败,请仔细检查输入内容!", Page); } }
protected void deleteButton_Click(object sender, EventArgs e) { string idString = Request.QueryString["id"]; int idInt = Convert.ToInt32(idString); if (null == idString || idString.Equals(string.Empty) || 1 > idInt) { UtilFunctions.AlertBox("请输入正确的请求代号!", Page); return; } NewsDAO newsDao = new NewsDAO(); if (0 < newsDao.DeleteNews(idInt)) { Response.Redirect("ManagementNews.aspx?type=" + CategoryDropDownList.SelectedValue + "&page_request=1"); } else { UtilFunctions.AlertBox("删除失败!", Page); } }