Beispiel #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int pageIndex = int.Parse(context.Request["pageIndex"] ?? "1");
            int pageSize  = 500;

            BLL.ZhiWuXinXi mainService = new BLL.ZhiWuXinXi();
            var            ds          = mainService.GetListByPage(string.Empty, " ", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex);

            //取当前页的数据
            list = mainService.DataTableToList(ds.Tables[0]);
            foreach (var item in list)
            {
                item.FBQuYu = Common.UBB2Html.Decode(item.FBQuYu);
            }
            //设置一共多少页
            var allCount = mainService.GetRecordCount(string.Empty);

            PageCount = Math.Max((allCount + pageSize - 1) / pageSize, 1);
            //生成 分页的标签
            Navstring = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, allCount);
            var    jsonstr1 = new { list1 = list, Navstring1 = Navstring, count = allCount };
            string jsonstr  = new JavaScriptSerializer().Serialize(jsonstr1);

            context.Response.Write(jsonstr);
        }
Beispiel #2
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 #3
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 #4
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 #5
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");
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int pageIndex = int.Parse(Request["pageIndex"] ?? "1");
            int pageSize  = 5;

            BLL.ZhiWuXinXi mainService = new BLL.ZhiWuXinXi();
            var            ds          = mainService.GetListByPage(string.Empty, " ", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex);

            zhiwulist = mainService.DataTableToList(ds.Tables[0]);
            var allCount = mainService.GetRecordCount("");

            DataCount = allCount;
            PageCount = Math.Max((allCount + pageSize - 1) / pageSize, 1);
            Navstring = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, allCount);
        }
Beispiel #7
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 #8
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string plant     = TextBox1.Text.ToString();
            int    pageIndex = 1;

            pageindex = pageIndex;
            int allcount = 0;

            BLL.ZhiWuXinXi mainService = new BLL.ZhiWuXinXi();
            int            pageSize    = 0;

            if (plant.Length == 0)
            {
                pageSize = 5;
                var ds = mainService.GetListByPage(" ", " ", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex);
                //取当前页的数据
                list = mainService.DataTableToList(ds.Tables[0]);
                //设置一共多少页
                allcount  = mainService.GetRecordCount(" ");
                DataCount = allcount;
                if (DataCount == 0)
                {
                    showinfo = "没有数据!";
                }
                PageCount = Math.Max((allcount + pageSize - 1) / pageSize, 1);
                //   生成 分页的标签
                Navstring = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, allcount);
            }
            else
            {
                pageSize = 1000;
                var ds = mainService.GetListByPage(plant, " ", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex);
                //取当前页的数据
                list = mainService.DataTableToList(ds.Tables[0]);
                //设置一共多少页
                var allCount = mainService.GetRecordCount(plant);
                DataCount = allCount;
                if (DataCount == 0)
                {
                    showinfo = "没有数据!";
                }
                PageCount = 1;
                //生成 分页的标签
                Navstring = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, allCount);
            }
        }
Beispiel #9
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 #10
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 #11
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);
                    }
                }
            }
        }