private void DeleteData(int nBookChapterUpdateID) { BookUpdateBLL BookChapterUpdateBLL = new BookUpdateBLL(); ItemBLL objItemBll = new ItemBLL(); objItemBll.DeleteItemByChapterID(nBookChapterUpdateID, ""); BookChapterUpdateBLL.DeleteBookUpdate(nBookChapterUpdateID); BindGrid(); }
private void FillPage(int nBookUpdateID) { BookUpdateBLL BookUpdateBLL = new BookUpdateBLL(); BookUpdate BookUpdate = BookUpdateBLL.GetBookUpdate(nBookUpdateID); if (BookUpdate != null) { lblPerson.Text = BookUpdate.updatePerson; lblDate.Text = BookUpdate.updateDate.ToShortDateString(); txtCause.Text = BookUpdate.updateCause; txtContent.Text = BookUpdate.updateContent; txtMemo.Text = BookUpdate.Memo; string strUpdateObject = Request.QueryString.Get("Object"); if (strUpdateObject == "delbook") { lblBookName.Text = BookUpdate.BookNameBak; lblChapterName.Text = "删除教材《" + BookUpdate.BookNameBak + "》"; } else if (strUpdateObject == "delchapter") { lblBookName.Text = BookUpdate.BookName; lblChapterName.Text = "删除章节" + BookUpdate.ChapterNameBak; } else if (strUpdateObject == "insertchapterinfo") { lblBookName.Text = BookUpdate.BookName; lblChapterName.Text = "新增《" + BookUpdate.ChapterNameBak + "》章节基本信息"; } else if (strUpdateObject == "bookinfo") { lblChapterName.Text = PrjPub.BOOKUPDATEOBJECT_BOOKINFO; } else if (strUpdateObject == "bookcover") { lblChapterName.Text = PrjPub.BOOKUPDATEOBJECT_BOOKCOVER; lblBookName.Text = BookUpdate.BookName; } else if (strUpdateObject == "updatechapterinfo") { lblChapterName.Text = "修改《" + BookUpdate.ChapterNameBak + "》章节基本信息"; lblBookName.Text = BookUpdate.BookName; } else if (strUpdateObject == "chaptercontent") { lblChapterName.Text = "《" + BookUpdate.ChapterNameBak + "》" + PrjPub.BOOKUPDATEOBJECT_CHAPTERCONTENT; lblBookName.Text = BookUpdate.BookName; } } ViewState["AddFlag"] = 0; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hfIsWuhan.Value = PrjPub.IsWuhan().ToString(); if (PrjPub.HasEditRight("教材管理") && PrjPub.IsServerCenter) //&& PrjPub.CurrentLoginUser.SuitRange == 1 { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasDeleteRight("教材管理") && PrjPub.IsServerCenter) { HasDeleteRight.Value = "True"; } else { HasDeleteRight.Value = "False"; } BindDdl(); DateTime start = new DateTime(2000, 1, 1); DateTime end = new DateTime(2100, 12, 31); BookUpdateBLL objBll = new BookUpdateBLL(); IList <BookUpdate> objList = objBll.GetBookUpdateBySelect(0, "", "", start, end, ""); dgUpdate.DataSource = objList; dgUpdate.DataBind(); } string strRefreshGrid = Request.Form.Get("RefreshGrid"); if (strRefreshGrid != null & strRefreshGrid != "") { BindGrid(); } string strID = Request.Form.Get("DeleteID"); if (strID != null & strID != "") { BookUpdateBLL objBll = new BookUpdateBLL(); objBll.DeleteBookUpdate(Convert.ToInt32(strID)); BindGrid(); } }
private void BindGrid() { DateTime start = new DateTime(2000, 1, 1); DateTime end = new DateTime(2100, 12, 31); if (smalldate.DateValue.ToString() != string.Empty) { start = DateTime.Parse(smalldate.DateValue.ToString()); } if (bigdate.DateValue.ToString() != string.Empty) { end = DateTime.Parse(bigdate.DateValue.ToString()); } string updateObject = ""; if (ddlUpdateObject.SelectedValue == "0") { updateObject = ""; } else { updateObject = ddlUpdateObject.SelectedValue; } BookUpdateBLL objBll = new BookUpdateBLL(); IList <BookUpdate> objList = null; if (ddlType.SelectedValue == "0") { objList = objBll.GetBookUpdateBySelect(Convert.ToInt32(hfBookID.Value), "", txtPerson.Text, start, end, updateObject); } else { objList = objBll.GetBookUpdateBySelect(0, txtBookName.Text, txtPerson.Text, start, end, updateObject); } dgUpdate.DataSource = objList; dgUpdate.DataBind(); hfBookID.Value = "0"; }
protected void SaveButton_Click(object sender, EventArgs e) { BookUpdateBLL BookUpdateBLL = new BookUpdateBLL(); BookUpdate BookUpdate = new BookUpdate(); string strUpdateObject = Request.QueryString.Get("Object"); if (txtCause.Text == string.Empty) { SessionSet.PageMessage = "更改原因不能为空!"; return; } if (txtContent.Text == string.Empty) { SessionSet.PageMessage = "更改内容不能为空!"; return; } if (ViewState["AddFlag"].ToString() == "1") //新增 { BookBLL objBookBll = new BookBLL(); BookUpdate.BookId = int.Parse(ViewState["BookID"].ToString()); BookUpdate.ChapterId = int.Parse(ViewState["ChapterID"].ToString()); BookUpdate.updatePerson = lblPerson.Text; BookUpdate.updateDate = DateTime.Parse(lblDate.Text); BookUpdate.updateCause = txtCause.Text; BookUpdate.updateContent = txtContent.Text; BookUpdate.Memo = txtMemo.Text; BookUpdate.BookNameBak = objBookBll.GetBook(Convert.ToInt32(ViewState["BookID"].ToString())).bookName; if (ViewState["ChapterID"].ToString() != "0") { BookChapterBLL objChapterBll = new BookChapterBLL(); BookUpdate.ChapterNameBak = objChapterBll.GetBookChapter(Convert.ToInt32(ViewState["ChapterID"].ToString())).ChapterName; } if (strUpdateObject == "insertchapterinfo") { BookUpdate.ChapterNameBak = Server.UrlDecode(Request.QueryString.Get("newchaptername")); BookUpdate.UpdateObject = PrjPub.BOOKUPDATEOBJECT_INSERTCHAPTERINFO; } else if (strUpdateObject == "updatechapterinfo") { BookUpdate.UpdateObject = PrjPub.BOOKUPDATEOBJECT_UPDATECHAPTERINFO; } else if (strUpdateObject == "chaptercontent") { BookUpdate.UpdateObject = PrjPub.BOOKUPDATEOBJECT_CHAPTERCONTENT; } else if (strUpdateObject == "delbook") { BookUpdate.UpdateObject = PrjPub.BOOKUPDATEOBJECT_DELBOOK; } else if (strUpdateObject == "delchapter") { BookUpdate.UpdateObject = PrjPub.BOOKUPDATEOBJECT_DELCHAPTER; } else { BookUpdate.UpdateObject = lblChapterName.Text; } BookUpdateBLL.AddBookUpdate(BookUpdate); Response.Write("<script>top.returnValue='true';window.close();</script>"); } else //修改 { BookUpdate.BookId = int.Parse(ViewState["BookID"].ToString()); BookUpdate.ChapterId = int.Parse(ViewState["ChapterID"].ToString()); BookUpdate.updatePerson = lblPerson.Text; BookUpdate.updateDate = DateTime.Parse(lblDate.Text); BookUpdate.updateCause = txtCause.Text; BookUpdate.updateContent = txtContent.Text; BookUpdate.Memo = txtMemo.Text; BookUpdate.bookUpdateId = int.Parse(Request.QueryString.Get("id")); BookUpdateBLL.UpdateBookUpdate(BookUpdate); if (PrjPub.IsWuhan()) { Response.Write("<script>window.opener.form1.RefreshGrid.value='true';window.opener.form1.submit();window.close();</script>"); } else { Response.Write("<script>top.returnValue='true';window.close();</script>"); } } }
private void DeleteData(int nBookChapterUpdateID) { BookUpdateBLL BookChapterUpdateBLL = new BookUpdateBLL(); BookChapterUpdateBLL.DeleteBookUpdate(nBookChapterUpdateID); }