protected void btnSubmit_Click(object sender, EventArgs e) { ShopCommentBLL bll = new ShopCommentBLL(); UserInfo uinfo = Session["cudoUser"] as UserInfo; ShopComment item = new ShopComment(); item.TotalPoint = Convert.ToInt32(stars_input.Value); item.TastePoint = Convert.ToInt32(ddltaste.Value); item.MilieuPoint = Convert.ToInt32(ddlmilieu.Value); item.ServicePoint = Convert.ToInt32(ddlservice.Value); item.CommentContent = txtcontent.Value; item.ShopId = shopid; item.UserId = uinfo.Id; item.UserName = uinfo.UserName; if (bll.AddShopComment(item) > 0) { Utils.alert("评价成功,感谢您的参与!", "mycommentlist.aspx"); } else { Utils.alert("评价失败!", "createcomment.aspx?shopid=" + shopid); } }
public string userComment(String commentMessage) { ShopComment item = new ShopComment(); ShopCommentBLL bll = new ShopCommentBLL(); JObject commentObject = JObject.Parse(commentMessage); item.TotalPoint = Convert.ToInt32(commentObject["totalPoint"].ToString()); item.TastePoint = Convert.ToInt32(commentObject["tastePoint"].ToString()); item.MilieuPoint = Convert.ToInt32(commentObject["milieuPoint"].ToString()); item.ServicePoint = Convert.ToInt32(commentObject["servicePoint"].ToString()); item.CommentContent = commentObject["comment"].ToString().Replace("\"", ""); item.ShopId = Convert.ToInt32(commentObject["shopId"].ToString()); item.UserId = Convert.ToInt32(commentObject["userId"].ToString()); item.UserName = commentObject["userName"].ToString().Replace("\"", ""); if (bll.AddShopComment(item) > 0) { return("ok"); } else { return("fail"); } }
public List <ShopComment> getShopComment(int shopId) { ShopCommentBLL bll = new ShopCommentBLL(); return(bll.GetShopCommentsByShopId(1, 100, shopId)); }