Example #1
0
        public void save_guide(HttpContext context)
        {
            int    id        = Convert.ToInt32(context.Request["id"]);
            string title     = context.Request["title"];
            int    tourrange = Convert.ToInt32(context.Request["tourrange"]);
            int    tourtype  = Convert.ToInt32(context.Request["tourtype"]);

            TourGuideTemp temp = tgt.GetModel(id);
            TourGuide     gde  = new TourGuide();

            gde.userid       = temp.userid;
            gde.nickname     = temp.nickname;
            gde.title        = temp.title;
            gde.createtime   = temp.createtime;
            gde.imagelist    = temp.imagelist;
            gde.imagecount   = temp.imagecount;
            gde.commentcount = temp.commentcount;
            gde.areamatch    = temp.areamatch;
            gde.areamathrow  = temp.areamathrow;
            gde.istuijian    = temp.istuijian;
            gde.ispublish    = 0;
            gde.tourdays     = temp.tourdays;
            gde.browsecount  = 0;
            gde.updatetime   = temp.updatetime;
            gde.prasecount   = temp.prasecount;
            gde.ishot        = temp.ishot;
            gde.isindex      = temp.isindex;
            gde.tourrange    = temp.tourrange;
            gde.tourtype     = temp.tourtype;
            gde.temp_id      = temp.Id;
            guide.Add(gde);
        }
Example #2
0
        public void AddRoute(HttpContext context)
        {
            int            id    = Convert.ToInt32(context.Request["gid"]);
            TourGuideTemp  temp  = tgt.GetModel(id);
            TourGuideRoute route = new TourGuideRoute();

            route.guideid   = id;
            route.routetime = DateTime.Now;
            route.title     = "";
            route.contents  = "";
            tre.Add(route);
        }
Example #3
0
        public void savetemp(HttpContext context)
        {
            int    id        = Convert.ToInt32(context.Request["id"]);
            string title     = context.Request["title"];
            int    tourrange = Convert.ToInt32(context.Request["tourrange"]);
            int    tourtype  = Convert.ToInt32(context.Request["tourtype"]);

            TourGuideTemp temp = tgt.GetModel(id);

            temp.title     = title;
            temp.tourrange = tourrange;
            temp.tourtype  = tourtype;
            tgt.Update(temp);
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetNoStore();
            if (!IsPostBack)
            {
                int id;
                int.TryParse(Request["id"], out id);
                gd = guide.GetModel(id);
                if (gd != null)
                {
                    gd.browsecount = gd.browsecount + 1;
                    guide.Update(gd);
                    gd = guide.GetModel(id);
                    string userid = gd.userid;
                    user      = club.GetModel(Convert.ToInt32(userid));
                    tt        = tgt.GetModel(gd.temp_id);
                    routelist = tre.GetList(tt.Id);
                    if (routelist.Count > 0)
                    {
                        begindate = routelist[0].routetime.ToString("yyyy-MM-dd");
                        //Response.Write(routelist[0].routetime);
                    }
                    StringBuilder sb = new StringBuilder();

                    for (int i = 0; i < routelist.Count; i++)
                    {
                        sb.Append("<div class=\"day_box\">");
                        sb.Append("<div class=\"day_item\">");
                        sb.Append("<div class=\"room-title\">");
                        sb.Append("<p>第<em>" + (i + 1) + "</em>天</p>");
                        sb.Append("<p class=\"date\">" + routelist[i].routetime.ToString("yyyy-MM-dd") + "</p>");
                        sb.Append("<p class=\"cities\">");
                        sb.Append("<span></span>&nbsp;&nbsp;<a href=\"javascript:;\" rel=\"nofollow\">" + routelist[i].title + "</a>");
                        //sb.Append("<span></span>&nbsp;&nbsp;<a href=\"javascript:;\" rel=\"nofollow\">上海</a>");
                        sb.Append("&nbsp;&nbsp;&gt;");
                        sb.Append("</p>");
                        sb.Append("</div>");

                        sb.Append("<div class=\"day_content\">");
                        sb.Append("<div class=\"route_title\">" + routelist[i].title + "</div>");
                        int routeid = routelist[i].id;
                        List <TourGuideSpot> spotlist = spot.GetList(routeid);
                        for (int j = 0; j < spotlist.Count; j++)
                        {
                            sb.Append("<div class=\"day_spot\">");
                            sb.Append(" <div class=\"room-city\">");
                            sb.Append("<p class=\"city-name\" data-destination=\"" + spotlist[j].areaname + "\"><span></span>&nbsp;<a href=\"javascript:;\" rel=\"nofollow\">" + spotlist[j].areaname + "</a></p>");
                            sb.Append("</div>");
                            sb.Append("<div class=\"spot_gallery_list\">");
                            sb.Append("<ul>");
                            int spotid = spotlist[j].id;
                            List <TourGuideGallery> gallerylist = tgy.GetList(spotid);
                            for (int p = 0; p < gallerylist.Count; p++)
                            {
                                sb.Append("<li class=\"pic_item\">");
                                sb.Append("<a href=\"\"><img src=\"../" + gallerylist[p].image + "\"/></a>");
                                sb.Append("</li>");
                            }


                            sb.Append("</ul>");
                            sb.Append("</div>");
                            sb.Append("</div>");
                        }
                        ///////////////////////////////

                        //////////////////////////////////////
                        //
                        sb.Append("<div class=\"day_desc\">" + routelist[i].contents + "</div>");
                        sb.Append("</div>");
                        sb.Append("</div>");
                        sb.Append("</div>");
                    }
                    J_nbox_0.InnerHtml = sb.ToString();
                    comlist            = comment.GetList(id);
                    CommentList(comlist);
                }
            }
            if (gd == null)
            {
                gd = new TourGuide(); Response.Redirect("/Opr.aspx?t=error&msg=opr");
            }
            if (tt == null)
            {
                tt = new TourGuideTemp(); Response.Redirect("/Opr.aspx?t=error&msg=opr");
            }
            if (user == null)
            {
                user = new Club(); Response.Redirect("/Opr.aspx?t=error&msg=opr");
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetNoStore();
            if (!IsPostBack)
            {
                string userid = TravelAgent.Tool.CookieHelper.GetCookieValue("uid");
                if (userid == "" || userid == null)
                {
                    Response.Redirect("../member/Login.aspx");
                }
                string username = TravelAgent.Tool.CookieHelper.GetCookieValue("username");
                //
                TourGuideTemp tg = tgt.GetModelByUser(userid);
                tourid.Value = tg.Id.ToString();
                int id = tg.Id;
                guid = id;
                if (tg != null && tg.Id != null)
                {
                    //TourGuideTemp tg = tgt.GetModel(id);
                    List <TourGuideRoute>   routelist   = tre.GetList(id);
                    List <TourGuideGallery> gallerylist = tgy.GetList(id);
                    StringBuilder           sb          = new StringBuilder();
                    for (int i = 0; i < routelist.Count; i++)
                    {
                        int sid = routelist[i].id;
                        sb.Append(getTempstr(id, sid, (i + 1)));
                    }
                    htmlstr = sb.ToString();
                }
                else
                {
                    //TourGuideTemp tg = new TourGuideTemp();
                    StringBuilder sb = new StringBuilder();

                    tg.userid     = userid;
                    tg.nickname   = username;
                    tg.createtime = DateTime.Now;
                    tg.updatetime = DateTime.Now;
                    tgt.Add(tg);
                    int sid = tgt.GetMaxID("id");
                    guid = sid;
                    tg   = tgt.GetModel(sid);
                    List <TourGuideRoute> routelist = tre.GetList(sid);
                    TourGuideRoute        route     = new TourGuideRoute();
                    if (routelist.Count == 0)
                    {
                        route.guideid   = sid;
                        route.routetime = DateTime.Now;
                        tre.Add(route);
                    }

                    routelist = tre.GetList(sid);

                    List <TourGuideGallery> gallerylist = tgy.GetList(sid);

                    for (int i = 0; i < routelist.Count; i++)
                    {
                        int pid = routelist[i].id;
                        sb.Append(getTempstr(id, sid, (i + 1)));
                    }
                    htmlstr = sb.ToString();
                }
                temp1 = tgt.GetModel(guid);
                if (temp1.tourrange == null)
                {
                    temp1.tourrange = 1;
                }
                if (temp1.tourtype == null)
                {
                    temp1.tourtype = 1;
                }
                show_guide.InnerHtml = htmlstr;
            }
        }