protected void btnOK_Click(object sender, EventArgs e) { if (Request.QueryString.Get("TrainTypeID") != null) { int bookID = Convert.ToInt32(Request.QueryString.Get("BookID")); int trainTypeID = Convert.ToInt32(Request.QueryString.Get("TrainTypeID")); BookTrainTypeBLL objBll = new BookTrainTypeBLL(); BookTrainType obj = objBll.GetBookTrainType(bookID, trainTypeID); int order = Convert.ToInt32(txtOrderIndex.Text); int max = Convert.ToInt32(Request.QueryString.Get("MaxOrder")); if (order > max) { obj.OrderIndex = max; } else { obj.OrderIndex = order; } objBll.UpdateBookTrainType(obj); } else { BookBLL objBll = new BookBLL(); RailExam.Model.Book obj = objBll.GetBook(Convert.ToInt32(Request.QueryString.Get("BookID"))); int order = Convert.ToInt32(txtOrderIndex.Text); int max = Convert.ToInt32(Request.QueryString.Get("MaxOrder")); if (order > max) { obj.OrderIndex = max; } else { obj.OrderIndex = order; } objBll.UpdateBook(obj); } Response.Write("<script>top.returnValue='true';window.close();</script>"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.CurrentLoginUser == null) { Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!"); return; } //ViewState["NowID"] = "false"; if (PrjPub.HasEditRight("教材管理") && PrjPub.IsServerCenter)//&& PrjPub.CurrentLoginUser.SuitRange == 1 { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasDeleteRight("教材管理") && PrjPub.IsServerCenter)//&& PrjPub.CurrentLoginUser.SuitRange == 1 { HfDeleteRight.Value = "True"; } else { HfDeleteRight.Value = "False"; } OrganizationBLL orgBll = new OrganizationBLL(); int orgID = orgBll.GetStationOrgID(PrjPub.CurrentLoginUser.OrgID); HfOrgId.Value = orgID.ToString(); hfEmployeeID.Value = PrjPub.CurrentLoginUser.EmployeeID.ToString(); if (!string.IsNullOrEmpty(Request.QueryString.Get("postID"))) { hfPostID.Value = Request.QueryString.Get("postID"); } BindGrid(); } else { if (Request.Form.Get("Refresh") == "true") { //ViewState["NowID"] = "false"; BindGrid(); } } #region //string strGet = Request.Form.Get("Index"); //if (strGet != null && strGet != "") //{ // GetIndex(strGet); // BindGrid(); //} //string strCover = Request.Form.Get("RefreshCover"); //if(strCover!= null && strCover !="") //{ // string strBookUrl = "../Book/" + strCover + "/cover.htm"; // BookBLL objBill = new BookBLL(); // objBill.UpdateBookUrl(Convert.ToInt32(strCover), strBookUrl); // string strBookName = objBill.GetBook(Convert.ToInt32(strCover)).bookName; // string strPath = "../Online/Book/" + strCover + "/Cover.htm"; // string str = File.ReadAllText(Server.MapPath(strPath), System.Text.Encoding.UTF8); // if (str.IndexOf("booktitle") < 0) // { // str = "<link href='book.css' type='text/css' rel='stylesheet' />" // + "<div id='booktitle'>" + strBookName + "</div>" + "<br>" // + str; // File.WriteAllText(Server.MapPath(strPath), str, System.Text.Encoding.UTF8); // } // BookChapterBLL objChapterBll = new BookChapterBLL(); // objChapterBll.GetIndex(strCover); // SystemLogBLL objLogBll = new SystemLogBLL(); // objLogBll.WriteLog("编辑教材《" + strBookName + "》前言"); // BindGrid(); //} #endregion string strDeleteID = Request.Form.Get("DeleteID"); if (strDeleteID != null && strDeleteID != "") { DelBook(strDeleteID); BindGrid(); } string strUpID = Request.Form.Get("UpID"); if (strUpID != null && strUpID != "") { if (Request.QueryString.Get("id") != null) { BookBLL objBll = new BookBLL(); RailExam.Model.Book obj = objBll.GetBook(Convert.ToInt32(strUpID)); obj.OrderIndex = obj.OrderIndex - 1; objBll.UpdateBook(obj); } if (Request.QueryString.Get("id1") != null) { int trainTypeID = Convert.ToInt32(Request.QueryString.Get("id1")); BookTrainTypeBLL objTrainTypeBll = new BookTrainTypeBLL(); BookTrainType objTrainType = objTrainTypeBll.GetBookTrainType(Convert.ToInt32(strUpID), trainTypeID); objTrainType.OrderIndex = objTrainType.OrderIndex - 1; objTrainTypeBll.UpdateBookTrainType(objTrainType); } BindGrid(); } string strDownID = Request.Form.Get("DownID"); if (strDownID != null && strDownID != "") { if (Request.QueryString.Get("id") != null) { BookBLL objBll = new BookBLL(); RailExam.Model.Book obj = objBll.GetBook(Convert.ToInt32(strDownID)); obj.OrderIndex = obj.OrderIndex + 1; objBll.UpdateBook(obj); } if (Request.QueryString.Get("id1") != null) { int trainTypeID = Convert.ToInt32(Request.QueryString.Get("id1")); BookTrainTypeBLL objTrainTypeBll = new BookTrainTypeBLL(); BookTrainType objTrainType = objTrainTypeBll.GetBookTrainType(Convert.ToInt32(strDownID), trainTypeID); objTrainType.OrderIndex = objTrainType.OrderIndex + 1; objTrainTypeBll.UpdateBookTrainType(objTrainType); } BindGrid(); } string strRefreshDown = Request.Form.Get("RefreshDown"); if (strRefreshDown != null && strRefreshDown != "") { if (!DownloadBook(strRefreshDown)) { SessionSet.PageMessage = "当前教材不存在电子版教材!"; BindGrid(); return; } BindGrid(); } if (!string.IsNullOrEmpty(hfPostID.Value)) { PostBLL post = new PostBLL(); txtPost.Text = post.GetPost(Convert.ToInt32(hfPostID.Value)).PostName; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.CurrentLoginUser == null) { Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!"); return; } //ViewState["NowID"] = "false"; if (PrjPub.HasEditRight("教材管理") && PrjPub.IsServerCenter) //&& PrjPub.CurrentLoginUser.SuitRange == 1 { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasDeleteRight("教材管理") && PrjPub.IsServerCenter) //&& PrjPub.CurrentLoginUser.SuitRange == 1 { HfDeleteRight.Value = "True"; } else { HfDeleteRight.Value = "False"; } OrganizationBLL orgBll = new OrganizationBLL(); int orgID = orgBll.GetStationOrgID(PrjPub.CurrentLoginUser.OrgID); HfOrgId.Value = orgID.ToString(); BindGrid(); } else { if (Request.Form.Get("Refresh") == "true") { //ViewState["NowID"] = "false"; BindGrid(); } } string strDeleteID = Request.Form.Get("DeleteID"); if (strDeleteID != null && strDeleteID != "") { DelBook(strDeleteID); BindGrid(); } string strUpID = Request.Form.Get("UpID"); if (strUpID != null && strUpID != "") { if (Request.QueryString.Get("id") != null) { BookBLL objBll = new BookBLL(); RailExam.Model.Book obj = objBll.GetBook(Convert.ToInt32(strUpID)); obj.OrderIndex = obj.OrderIndex - 1; objBll.UpdateBook(obj); } if (Request.QueryString.Get("id1") != null) { int trainTypeID = Convert.ToInt32(Request.QueryString.Get("id1")); BookTrainTypeBLL objTrainTypeBll = new BookTrainTypeBLL(); BookTrainType objTrainType = objTrainTypeBll.GetBookTrainType(Convert.ToInt32(strUpID), trainTypeID); objTrainType.OrderIndex = objTrainType.OrderIndex - 1; objTrainTypeBll.UpdateBookTrainType(objTrainType); } BindGrid(); } string strDownID = Request.Form.Get("DownID"); if (strDownID != null && strDownID != "") { if (Request.QueryString.Get("id") != null) { BookBLL objBll = new BookBLL(); RailExam.Model.Book obj = objBll.GetBook(Convert.ToInt32(strDownID)); obj.OrderIndex = obj.OrderIndex + 1; objBll.UpdateBook(obj); } if (Request.QueryString.Get("id1") != null) { int trainTypeID = Convert.ToInt32(Request.QueryString.Get("id1")); BookTrainTypeBLL objTrainTypeBll = new BookTrainTypeBLL(); BookTrainType objTrainType = objTrainTypeBll.GetBookTrainType(Convert.ToInt32(strDownID), trainTypeID); objTrainType.OrderIndex = objTrainType.OrderIndex + 1; objTrainTypeBll.UpdateBookTrainType(objTrainType); } BindGrid(); } }