protected void hlBookcase_Click(object sender, EventArgs e) { //加入书架 int bookId = Convert.ToInt32(Request.QueryString["bookId"]); IDAL.INovel iu = BllFactory.BllAccess.CreateINovelBLL(); if (HttpContext.Current.User.Identity.Name == "") { ClientScript.RegisterClientScriptBlock(this.GetType(), "ok", "<script type='text/javascript'>alert('您还未登陆,请先登陆!');</script>", false ); } else { int userId = Convert.ToInt32(HttpContext.Current.User.Identity.Name); int count = iu.adduserBookShelf(userId, bookId); if (count > 0) { ClientScript.RegisterClientScriptBlock(this.GetType(), "ok", "<script type='text/javascript'>alert('已将书本加入您的书架!');</script>", false ); } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "buok", "<script type='text/javascript'>alert('您的书架里已有该书!');</script>", false ); } } }
protected void Page_Load(object sender, EventArgs e) { IDAL.INovel novel = BllFactory.BllAccess.CreateINovelBLL(); dBookType.DataSource = novel.getBookType(); dBookType.DataTextField = "TypeName"; dBookType.DataValueField = "TypeId"; dBookType.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { IDAL.INovel novel = BllFactory.BllAccess.CreateINovelBLL(); int bookid = Convert.ToInt32(Request["id"]); int count = novel.noRecommand(bookid); if (count > 0) { Response.Write("{success:true,msg:'取消推荐成功!'}"); } else { Response.Write("{success:false,msg:'操作失败!'}"); } }
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 linkreadingbook_Click(object sender, EventArgs e) { //订阅书 int bookID = Convert.ToInt32(Request.QueryString["bookId"]); IDAL.INovel novel = BllFactory.BllAccess.CreateINovelBLL(); if (HttpContext.Current.User.Identity.Name == "") { ClientScript.RegisterClientScriptBlock(this.GetType(), "ok", "<script type='text/javascript'>alert('您还未登陆,请先登陆!');</script>", false ); } else { int userId = Convert.ToInt32(HttpContext.Current.User.Identity.Name); int count = novel.userAfterBook(userId, bookID); if (count > 0) { ClientScript.RegisterClientScriptBlock(this.GetType(), "ok", "<script type='text/javascript'>alert('成功订阅该书,章节更新时将站内短消息通知您!');</script>", false ); } else { int userid = Convert.ToInt32(HttpContext.Current.User.Identity.Name); int counterr = novel.isReaddingBook(userid, bookID); if (counterr == -1) { ClientScript.RegisterClientScriptBlock(this.GetType(), "buok", "<script type='text/javascript'>alert('您已经订阅过该书。');</script>", false ); } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "buok", "<script type='text/javascript'>alert('你没有订阅连载卡,请到商城购买再订阅连载!');</script>", false); } } } }
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 repHaveProp_ItemCommand(object source, RepeaterCommandEventArgs e) { //获取用户类型 List <Model.UsersInfo> userList = (List <Model.UsersInfo>)Session["NewUser"]; if (e.CommandName == "useProp") { int propId = Convert.ToInt32(e.CommandArgument); IDAL.IUsers iu = BllFactory.BllAccess.CreateIUsersBLL(); IDAL.INovel novel = BllFactory.BllAccess.CreateINovelBLL(); int userID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); int isAuCheck = iu.IsCheckAuthor(userID); switch (propId) { //VIP卡使用 case 1: if (userList[0].UserType >= 2 && userList[0].UserType < 5) { ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>alert('您已经具备VIP资格了,不需要使用该道具!');window.location.href=window.location.href;</script>", false); } else { int count = novel.userVIPCard(userID); if (count > 0) { Common.UserPanel us = new Common.UserPanel(); us.userExit(); ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>var dialog = Dialog.getInstance('Diag');dialog.close();dialog.TopWindow.location.href=dialog.TopWindow.location.href;alert('恭喜您成为本站VIP,重新登陆后生效!');</script>", false); } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>alert('道具使用出错,请联系管理员。');window.location.href=window.location.href;</script>", false); } } break; case 2: ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>alert('该道具不能直接使用,请在书本封面页点击<订阅连载>!');window.location.href=window.location.href;</script>", false); break; case 3: ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>alert('该道具不能直接使用,请在书本封面页点击<投书票>!');window.location.href=window.location.href;</script>", false); break; case 4: ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>alert('该道具不能直接使用,请在书本封面页点击<送鲜花>!');window.location.href=window.location.href;</script>", false); break; case 5: if (userList[0].UserType == 3 && userList[0].UserType != 5) { ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>alert('您已经是本站作者了,不需要使用该道具!');window.location.href=window.location.href;</script>", false); } else if (isAuCheck > 0) { ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>alert('已经提交过,不需要重复使用道具!');window.location.href=window.location.href;</script>", false); } else { int count = iu.AuthorCard(userID); if (count > 0) { ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>alert('道具使用成功,请等待管理员审核!');window.location.href=window.location.href;</script>", false); } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>alert('道具使用失败,请联系管理员!');window.location.href=window.location.href;</script>", false); } } break; default: ClientScript.RegisterClientScriptBlock(this.GetType(), "isvip", "<script type='text/javascript'>alert('该道具正在开发中!');window.location.href=window.location.href;</script>", false); break; } } }
protected void Page_Load(object sender, EventArgs e) { IDAL.INovel novel = BllFactory.BllAccess.CreateINovelBLL(); WebControlExtension.LinkButtonEx[] lkState = new WebControlExtension.LinkButtonEx[3]; lkState[0] = s1; lkState[1] = s2; lkState[2] = s3; WebControlExtension.LinkButtonEx[] lkChar = new WebControlExtension.LinkButtonEx[6]; lkChar[0] = c1; lkChar[1] = c2; lkChar[2] = c3; lkChar[3] = c4; lkChar[4] = c5; lkChar[5] = c6; WebControlExtension.LinkButtonEx[] lkBookType = new WebControlExtension.LinkButtonEx[13]; lkBookType[0] = t1; lkBookType[1] = t2; lkBookType[2] = t3; lkBookType[3] = t4; lkBookType[4] = t5; lkBookType[5] = t6; lkBookType[6] = t7; lkBookType[7] = t8; lkBookType[8] = t9; lkBookType[9] = t10; lkBookType[10] = t11; lkBookType[11] = t12; lkBookType[12] = t13; int statenum = 0; string statestring = "无"; int charnum = 0; int typenum = 0; int mincharnum = 0; int maxcharnum = 0; int recordCount = 0; int pageIndex = 1; if (Request.QueryString["state"] != null) { statenum = Convert.ToInt32(Request.QueryString["state"]); lkState[statenum].ForeColor = Color.Red; if (statenum == 0) { statestring = "无"; } if (statenum == 1) { statestring = "连载中"; } if (statenum == 2) { statestring = "已完本"; } } if (Request.QueryString["charnum"] != null) { charnum = Convert.ToInt32(Request.QueryString["charnum"].ToString()); lkChar[charnum].ForeColor = Color.Red; if (charnum == 0) { mincharnum = 0; maxcharnum = 0; } if (charnum == 1) { mincharnum = 300000; maxcharnum = 0; } if (charnum == 2) { mincharnum = 299999; maxcharnum = 500001; } if (charnum == 3) { mincharnum = 500000; maxcharnum = 1000001; } if (charnum == 4) { mincharnum = 1000000; maxcharnum = 2000001; } if (charnum == 5) { mincharnum = 0; maxcharnum = 2000000; } } if (Request.QueryString["booktype"] != null) { typenum = Convert.ToInt32(Request.QueryString["booktype"].ToString()); lkBookType[typenum].ForeColor = Color.Red; } string url = ""; if (Request.QueryString["page"] != null) { pageIndex = Convert.ToInt32(Request.QueryString["page"]); } gvboos.DataSource = novel.getSelectBooks(statestring, typenum, mincharnum, maxcharnum, pageIndex, 20, out recordCount); gvboos.DataBind(); string urlparm = Request.Url.Query; urlparm = urlparm.Replace("&page=" + pageIndex, ""); url = Request.Url.AbsolutePath; int pageNumber = 0; pageNumber = (int)Math.Ceiling((double)recordCount / 20); LinkFirst.NavigateUrl = url + urlparm + "&page=" + 1; LinkPrece.NavigateUrl = url + urlparm + "&page=" + (pageIndex - 1); LinkNext.NavigateUrl = url + urlparm + "&page=" + (pageIndex + 1); LinkLast.NavigateUrl = url + urlparm + "&page=" + pageNumber; if (pageIndex == 1) { LinkFirst.Visible = false; LinkPrece.Visible = false; } if (pageIndex == pageNumber) { LinkLast.Visible = false; LinkNext.Visible = false; } lblcount.Text = "检索共有 " + recordCount.ToString() + " 本小说,页面大小:20,第" + pageIndex + "页/共" + pageNumber + "页"; }