Beispiel #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string url = context.Request["url"];

            if (url.Length > 50)
            {
                int id = Convert.ToInt32(context.Request["id"]);
                Model.ZhiWuTuPian img        = new Model.ZhiWuTuPian();
                BLL.ZhiWuXinXi    zhiWuXinXi = new BLL.ZhiWuXinXi();
                if (zhiWuXinXi.GetModel(id) != null)
                {
                    Model.ZhiWuXinXi zhiwumodel = zhiWuXinXi.GetModel(id);
                    zhiwumodel.Mu = url;
                    zhiWuXinXi.Update(zhiwumodel);
                }
                img.DiZhi     = url;
                img.ZWBianHao = id;
                BLL.ZhiWuTuPian zhiWuTuPian = new BLL.ZhiWuTuPian();
                zhiWuTuPian.Add(img);
                context.Response.Write("上传成功!!!");
            }
            else
            {
                context.Response.Write("请选择图片!!!");
            }
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int id = Int32.Parse(Request["id"] ?? "0");
         model          = ZhiWuXinXi.GetModel(id);
         this.zyjz.Text = model.ZYJiaZhi;
     }
 }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int id = Int32.Parse(Request["id"] ?? "0");
         model = ZhiWuXinXi.GetModel(id);
         this.plantsDetail.Text = model.FBQuYu;
         jingdu.Text            = model.JingDu;
         weidu.Text             = model.WeiDu;
         MainKey = id;
     }
 }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int tid = Convert.ToInt32(Request["tupianid"]);
            int pid = Convert.ToInt32(Request["zhiwuid"]);

            BLL.ZhiWuTuPian zhiWuTuPian = new BLL.ZhiWuTuPian();
            BLL.ZhiWuXinXi  zhiWuXinXi  = new BLL.ZhiWuXinXi();
            //先删除植物图片里的地址
            zhiWuTuPian.Delete(tid);
            //遍历植物图片里的图片地址,并把植物信息里的植物地址修改成遍历出来的第一个地址
            List <Model.ZhiWuTuPian> modellist = zhiWuTuPian.GetModelList(pid.ToString());

            Model.ZhiWuXinXi model = zhiWuXinXi.GetModel(pid);
            if (modellist != null)
            {
                //遍历删除之后剩下的地址,将第一个赋值
                foreach (var item in modellist)
                {
                    model.Mu = item.DiZhi;
                    break;
                }
            }
            else
            {
                model.Mu = null;
            }
            zhiWuXinXi.Update(model);
            Response.Redirect("addplantImage.aspx?id=" + pid);
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = Int32.Parse(Request["id"]);

            BLL.ZhiWuXinXi zhiwu = new BLL.ZhiWuXinXi();
            list = zhiwu.GetModel(id);
        }
Beispiel #6
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int id = Int32.Parse(context.Request["id"] ?? "0");

            BLL.ZhiWuXinXi   zhiWuXinXi = new BLL.ZhiWuXinXi();
            Model.ZhiWuXinXi model      = new Model.ZhiWuXinXi();
            model = zhiWuXinXi.GetModel(id);
            var list = zhiWuXinXi.GetModel(id);

            list.FZFangFa   = Common.UBB2Html.Decode(model.FZFangFa);
            list.SZXiXing   = Common.UBB2Html.Decode(model.SZXiXing);
            list.XTTeZheng  = Common.UBB2Html.Decode(model.XTTeZheng);
            list.ZYJiaZhi   = Common.UBB2Html.Decode(model.ZYJiaZhi);
            list.SCHuanJing = Common.UBB2Html.Decode(model.SCHuanJing);
            list.ZPJiShu    = Common.UBB2Html.Decode(model.ZPJiShu);
            list.FBQuYu     = Common.UBB2Html.Decode(model.FBQuYu);
            var jsonstr = new JavaScriptSerializer().Serialize(list);

            context.Response.Write(jsonstr);
        }
Beispiel #7
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int id = int.Parse(context.Request["id"]);

            BLL.ZhiWuTuPian pic       = new BLL.ZhiWuTuPian();
            var             plantpic  = pic.GetModel(id);
            var             plantpic2 = pic.GetModelList(id.ToString());

            //浏览次数
            BLL.ZhiWuXinXi xinxi = new BLL.ZhiWuXinXi();
            if (plantpic == null)
            {
                string str = new JavaScriptSerializer().Serialize("error");
                context.Response.Write(str);
            }
            else
            {
                Model.ZhiWuXinXi model = xinxi.GetModel(plantpic.ZWBianHao);
                int ViewCount          = int.Parse(model.BeiZhu);
                ViewCount    = ViewCount + 1;
                model.BeiZhu = ViewCount.ToString();
                xinxi.Update(model);


                var plantintroduce = xinxi.GetModel(plantpic.ZWBianHao);
                plantintroduce.FBQuYu     = Common.UBB2Html.Decode(plantintroduce.FBQuYu);
                plantintroduce.SZXiXing   = Common.UBB2Html.Decode(plantintroduce.SZXiXing);
                plantintroduce.SCHuanJing = Common.UBB2Html.Decode(plantintroduce.SCHuanJing);
                plantintroduce.XTTeZheng  = Common.UBB2Html.Decode(plantintroduce.XTTeZheng);
                plantintroduce.ZPJiShu    = Common.UBB2Html.Decode(plantintroduce.ZPJiShu);
                plantintroduce.ZYJiaZhi   = Common.UBB2Html.Decode(plantintroduce.ZYJiaZhi);
                plantintroduce.FZFangFa   = Common.UBB2Html.Decode(plantintroduce.FZFangFa);
                var    plant   = new { pic = plantpic, itd = plantintroduce, pic2 = plantpic2 };
                string jsonstr = new JavaScriptSerializer().Serialize(plant);
                context.Response.Write(jsonstr);
            }
        }
Beispiel #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int            id         = Convert.ToInt32(Request["id"] ?? "1019");
         BLL.ZhiWuXinXi zhiWuXinXi = new BLL.ZhiWuXinXi();
         zhiwuxinxi   = zhiWuXinXi.GetModel(id);
         zhiwuname    = zhiwuxinxi.ZWXueMing.ToString();
         zhiwubianhao = id;
         BLL.ZhiWuTuPian zhiWuTuPian = new BLL.ZhiWuTuPian();
         modellisttupian = zhiWuTuPian.GetModelList(id.ToString());
     }
     else
     {
     }
 }
Beispiel #9
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);
                    }
                }
            }
        }