protected void imgbtEdit_Click(object sender, ImageClickEventArgs e) { Model.BooksInfo item = new Model.BooksInfo(); item.BookId = Convert.ToInt32(Request.QueryString["BookId"]); item.BookName = TextBox1.Text; item.BookIntroduction = fckAddbooks.Value; item.BookType = dBookType.SelectedIndex + 1; item.BookState = DropDownList1.SelectedIndex + 1; int count = Ia.EditBookFace(item); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ok", "<script type='text/javascript'>alert('修改成功!');</script>", false); }
protected void Unnamed1_Click(object sender, ImageClickEventArgs e) { IDAL.IAuthor ia = BllFactory.BllAccess.CreateIAuthorBLL(); int userId = Convert.ToInt32(HttpContext.Current.User.Identity.Name); Model.BooksInfo item = new Model.BooksInfo(); item.BookName = TextBox1.Text; item.AuthorId = userId; item.BookIntroduction = fckAddbooks.Value; item.BookType = (dBookType.SelectedIndex) + 1; string fileName = ""; if (f1.HasFile) { switch (System.IO.Path.GetExtension(f1.FileName).ToLower()) { case ".jpg": fileName = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(f1.FileName); f1.SaveAs(Server.MapPath("~/Images/Books/" + fileName)); break; case ".gif": fileName = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(f1.FileName); f1.SaveAs(Server.MapPath("~/Images/Books/" + fileName)); break; default: ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "error", "<script type='text/javascript'>alert('不支持此格式,请使用图片文件');</script>", false); break; } item.Images = fileName; } if (fileName == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "error", "<script type='text/javascript'>alert('请选择书本封面');</script>", false); return; } int count = ia.AuaddBook(item); if (count > 0) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ok", "<script type='text/javascript'>alert('添加成功!');</script>", false); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ok", "<script type='text/javascript'>alert('添加失败!');</script>", false); } }
protected void Page_Load(object sender, EventArgs e) { booId = Convert.ToInt32(Request.QueryString["bookId"]); string userId2 = HttpContext.Current.User.Identity.Name; if (userId2 != null && userId2 != "") { userId = Convert.ToInt32(Convert.ToInt32(userId2)); } item = BllFactory.BllAccess.CreateINovelBLL().getBookCoverInfo(booId); if (!IsPostBack) { ibookImg.ImageUrl = @"~/Images/books/" + item.Images; hlBookName.Text = item.BookName; lbAuthor.Text = item.UserName; bookType.InnerHtml = item.TypeName; chickAll.InnerHtml = item.AllSumClick; updateTime.InnerHtml = item.AddTime.ToShortDateString(); stateName.InnerHtml = item.StateName; contents.InnerHtml = item.BookIntroduction.Length > 300 ? item.BookIntroduction.Substring(0, 300) + "……" : item.BookIntroduction; keyName.InnerHtml = item.BookName + " " + item.UserName + " " + item.TypeName; replayTitle.InnerHtml = item.BookName + " - 评论列表"; Model.BooksInfo BookFinallySection = novel.getBookFinallySection(booId); SectionTitle.Text = BookFinallySection.SectionTitle.Length > 15 ? BookFinallySection.SectionTitle.Substring(0, 14) + "……" : BookFinallySection.SectionTitle; SectionTitle.NavigateUrl = "~/BookSectionsInfo.aspx?SectiuonId=" + BookFinallySection.SectiuonId + "&&BookId=" + item.BookId; ibBookRead.PostBackUrl = "~/BooksInfo.aspx?BookId=" + item.BookId; BookReplayInfo.DataSource = novel.getBookReplayInfo(booId); BookReplayInfo.DataBind(); //rpPropInfo.DataSource = novel.getUserPropInfo(booId); //rpPropInfo.DataBind(); itemNumber = novel.getTicketNumber(booId); lbTicketPlace.Text = itemNumber.ticketNumber.ToString(); lbTicketAmount.Text = "排名:" + itemNumber.flowerNumber.ToString(); itemNumber = novel.getFlowerNumber(booId); lbFlowerPlace.Text = itemNumber.flowerNumber.ToString(); lbFlowerAmout.Text = "排名:" + itemNumber.ticketNumber.ToString(); itemNumber = novel.getAuthorIdBooksOne(booId); } }
protected void Page_Load(object sender, EventArgs e) { int bookId = Convert.ToInt32(Request.QueryString["BookId"]); face.NavigateUrl = Request.Url.AbsolutePath + "?type=2&ct=1&bookId=" + bookId; vs.NavigateUrl = Request.Url.AbsolutePath + "?type=2&ct=2&bookId=" + bookId; //书本状态 List <Model.BookStateInfo> state = new List <Model.BookStateInfo>(); Model.BookStateInfo item = new Model.BookStateInfo(); item.StateId = 1; item.StateName = "连载中"; Model.BookStateInfo item1 = new Model.BookStateInfo(); item1.StateId = 2; item1.StateName = "已完本"; state.Add(item); state.Add(item1); DropDownList1.DataSource = state; DropDownList1.DataTextField = "StateName"; DropDownList1.DataValueField = "StateId"; DropDownList1.DataBind(); //书本类型 IDAL.INovel novel = BllFactory.BllAccess.CreateINovelBLL(); dBookType.DataSource = novel.getBookType(); dBookType.DataTextField = "TypeName"; dBookType.DataValueField = "TypeId"; dBookType.DataBind(); //书本名称 Model.BooksInfo bookItem = novel.getBookIdBooksInfo(bookId); TextBox1.Text = bookItem.BookName; fckAddbooks.Value = bookItem.BookIntroduction; dBookType.SelectedIndex = bookItem.BookType - 1; DropDownList1.SelectedIndex = bookItem.BookState - 1; }
protected void Page_Load(object sender, EventArgs e) { Model.BooksInfo item = new Model.BooksInfo(); item.BookName = Request["BookName"]; item.AuthorId = Convert.ToInt32(Request["userId"]); item.Images = Request.QueryString["imgname"].ToString(); item.BookIntroduction = Request["BookIntroduction"]; item.BookType = Convert.ToInt32(Request["typeId"]); INovel novel = BllFactory.BllAccess.CreateINovelBLL(); try { novel.addBook(item); Response.Write("{success:true,msg:'添加成功'}"); } catch (Exception ex) { string msg = ex.Message; Response.Write("{success:false,msg:'" + msg + "'}"); } }
protected void Page_Load(object sender, EventArgs e) { BooksId = Convert.ToInt32(Request.QueryString["bookId"]); VolumeId = dal.getNovelClassInfo(BooksId)[0].VolumeId; List <Model.VolumeInfo> List = dal.getNovelClassInfo(BooksId); List <Model.VolumeInfo> changeList = new List <VolumeInfo>(); foreach (Model.VolumeInfo item in List) { item.ValumeName = Common.Myweeks.changeNumber(item.ValumeName); changeList.Add(item); } repeater.DataSource = changeList; repeater.DataBind(); Model.BooksInfo bookInfo = dal.getBookIdBooksInfo(BooksId); lbBookName.Text = bookInfo.BookName; lbUserName.Text = "作者:" + bookInfo.UserName + " " + "类型:" + bookInfo.TypeName; lbUpdateTime.Text = "更新时间:" + bookInfo.AddTime.ToShortDateString(); }
protected void Page_Load(object sender, EventArgs e) { int bookid = Convert.ToInt32(Request.QueryString["BookId"]); int sectionId = Convert.ToInt32(Request.QueryString["sectionId"]); string BookNmae = Request.QueryString["BookName"].ToString(); IDAL.INovel novel = BllFactory.BllAccess.CreateINovelBLL(); Model.BooksInfo item = novel.getBookCoverInfo(bookid); IDAL.IAuthor ia = BllFactory.BllAccess.CreateIAuthorBLL(); int count = ia.SectionCheckYES(sectionId, bookid, item.BookName); if (count > 0) { Response.Write("{success:true,msg:'操作成功'}"); } else { Response.Write("{success:false,msg:'操作失败'}"); } }
protected void Page_Load(object sender, EventArgs e) { //判断用户是否有阅读权限 IDAL.INovel vn = BllFactory.BllAccess.CreateINovelBLL(); List <Model.SectionsInfo> volumeNumber = vn.sectionsVolumeNumber(Convert.ToInt32(Request.QueryString["SectiuonId"])); //处理URL string parentURl = Request.UrlReferrer.ToString(); int temp = parentURl.LastIndexOf("/"); parentURl = parentURl.Substring(0, temp); parentURl = parentURl + "/BooksInfo.aspx?bookId=" + Request.QueryString["bookId"]; if (volumeNumber[0].VolumeId > 1) { if (User.Identity.Name != "" && Session["NewUser"] != null) { List <UsersInfo> list = (List <UsersInfo>)Session["NewUser"]; if (list[0].UserType < 2 || list[0].UserType > 4) { ClientScript.RegisterClientScriptBlock(this.GetType(), "noread", "<script type='text/javascript'>alert('对不起,您没有阅读权限,请成为本站VIP!');this.location.href='" + parentURl + "';</script>", false); return; } } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "noread", "<script type='text/javascript'>alert('对不起,您没有阅读权限,请成为本站VIP!');this.location.href='" + parentURl + "';</script>", false); return; } } if (!IsPostBack) { //增加点击量 novel.sectionClickCount(Convert.ToInt32(Request.QueryString["SectiuonId"])); if (Request.QueryString["Next"] == null) { booksInfo = novel.getSectionsInfo(Convert.ToInt32(Request.QueryString["SectiuonId"])); } else if (Request.QueryString["Next"] == "0") { booksInfo = novel.getAnteSections(Convert.ToInt32(Request.QueryString["SectiuonId"]), Convert.ToInt32(Request.QueryString["bookId"])); if (booksInfo == null) { string url = "~/BooksInfo.aspx?bookId=" + Request.QueryString["bookId"]; Response.Redirect(url); } } else if (Request.QueryString["Next"] == "1") { booksInfo = novel.getNextSections(Convert.ToInt32(Request.QueryString["SectiuonId"]), Convert.ToInt32(Request.QueryString["bookId"])); if (booksInfo == null) { string url = "~/BooksInfo.aspx?bookId=" + Request.QueryString["bookId"]; Response.Redirect(url); } } booksInfo.ValumeName = Common.Myweeks.changeNumber(booksInfo.ValumeName); lbBookName.Text = booksInfo.SectionTitle; lbUserName.Text = "小说名称:" + booksInfo.BookName + " " + "作者:" + booksInfo.UserName; AddTime.Text = "更新时间:" + booksInfo.AddTime.ToShortDateString(); sectionsinfo.InnerHtml = booksInfo.Contents; cataLog.NavigateUrl = "~/BooksInfo.aspx?bookId=" + booksInfo.BookId; hlUpLeaf.NavigateUrl = "~/BookSectionsInfo.aspx?bookId=" + booksInfo.BookId + "&&SectiuonId=" + booksInfo.SectiuonId + "&&Next=0"; lbNextLeaf.NavigateUrl = "~/BookSectionsInfo.aspx?bookId=" + booksInfo.BookId + "&&SectiuonId=" + booksInfo.SectiuonId + "&&Next=1"; } }