protected void issuBmit_Click(object sender, ImageClickEventArgs e) { IDAL.IUsers iu = BllFactory.BllAccess.CreateIUsersBLL(); string context = fckPL.Value; int userid = 100; string picString = ""; if (HttpContext.Current.Session["pic"] != null) { picString = HttpContext.Current.Session["pic"].ToString(); } if (HttpContext.Current.User.Identity.Name != "") { userid = Convert.ToInt32(HttpContext.Current.User.Identity.Name); } if (picString != txValid.Text) { ClientScript.RegisterClientScriptBlock(this.GetType(), "s", "<script type='text/javascript'>alert('验证码错误,评论失败!');</script>"); return; } else { iu.addReplayBook(userid, booId, context); Response.Redirect("BookCover.aspx?bookId=" + booId); } }
protected void hlFlower_Click(object sender, ImageClickEventArgs e) { //送鲜花 int bookId = Convert.ToInt32(Request.QueryString["bookId"]); IDAL.IUsers IU = BllFactory.BllAccess.CreateIUsersBLL(); 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.UserFlowerCard(userId, bookId); if (count > 0) { ClientScript.RegisterClientScriptBlock(this.GetType(), "ok", "<script type='text/javascript'>alert('我们代表作者对您的支持表示感谢!');this.location.href=this.location.href;</script>", false); } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "ok", "<script type='text/javascript'>alert('对不起,您道具中没有鲜花,请去商城购买!');</script>", false); } } }