public void PingLun() {//评论int Id = int.Parse(Request["Id"]);string Neirong = Request["Neirong"];int Uid = int.Parse( Common.UICookie.ReadCookie("Id"));var umodel = Common.SqlExption.GetList<Model.YongHu>().FirstOrDefault(c=>c.Id.Equals(Uid));var uname = umodel.NiCheng!=null?umodel.NiCheng:"";var wmodel=Common.SqlExption.GetList<Model.MeiShi>().FirstOrDefault(c => c.Id.Equals(Id));Model.PingLun pmodel = new Model.PingLun(){MeiShiId = Id,MeiShiName = wmodel.MingChen,NeiRong = Neirong,ShiJiang = DateTime.Now.ToString("yyyy-MM-dd"),YongHuId = Uid,YongHuMing = uname,YongHuTouXiang = umodel.TouXiang};Common.SqlExption.Add<Model.PingLun>(pmodel);Response.Write(Common.JsonHelper.ObjectToJson<string>("1", System.Text.ASCIIEncoding.UTF8));}public void LoadPingLun() {int Id = int.Parse(Request["Id"]);var list = Common.SqlExption.GetList<Model.PingLun>().Where(c=>c.MeiShiId.Equals(Id)).OrderByDescending(c=>c.ShiJiang).ToList();Response.Write(Common.JsonHelper.ObjectToJson<List<Model.PingLun>>(list, System.Text.ASCIIEncoding.UTF8));}在以上代码中的int Id = int.Parse(Request["Id"]); string Neirong = Request["Ne"];
添加回答
举报
0/150
提交
取消