Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Request["id"]);

            Model.YongHuPingLun model         = new Model.YongHuPingLun();
            BLL.YongHuPingLun   yongHuPingLun = new BLL.YongHuPingLun();

            model = yongHuPingLun.GetModel(id);
            int pid = model.ZWBianHao;

            yongHuPingLun.Delete(id);

            Response.Redirect("CommentView1.aspx?id=" + pid);
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = int.Parse(Request["id"] ?? "0");

            //删除植物之前,先删除植物所关联的图片以及用户对此植物的评论
            BLL.ZhiWuXinXi    zhiWuXinXi    = new BLL.ZhiWuXinXi();
            BLL.ZhiWuTuPian   zhiWuTuPian   = new BLL.ZhiWuTuPian();
            BLL.YongHuPingLun yongHuPingLun = new BLL.YongHuPingLun();

            zhiWuTuPian.DeleteByZhiwuId(id);
            yongHuPingLun.DeleteByZhiwuId(id);
            zhiWuXinXi.Delete(id);
            Response.Redirect("Zhiwulist.aspx");
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int            id         = Convert.ToInt32(Request["id"]);
                BLL.ZhiWuXinXi zhiWuXinXi = new BLL.ZhiWuXinXi();
                zhiwuxinxi = zhiWuXinXi.GetModel(id);
                ////根据植物编号寻找与他相关的所有的评论
                list = new BLL.YongHuPingLun().GetModelList(id.ToString());

                foreach (var item in list)
                {
                    if (item.BeiZhu == "")
                    {
                        item.BeiZhu = "匿名用户";
                    }
                    if (item.NeiRong.Length > 40)
                    {
                        item.NeiRong = item.NeiRong.Substring(0, 40);
                    }
                }
            }
        }