Exemplo n.º 1
0
        private void BindOrderDetailData()
        {
            DataTable myTable = orderDetailBLL.GetData("orderNumber ='" + orderNumber + "'");

            StringBuilder sb = new StringBuilder();

            foreach (DataRow dr in myTable.Rows)
            {
                sb.Append("<tr>");

                ClassLibrary.Model.Routes route = routeBLL.GetModel(Convert.ToInt32(dr["routeID"]));
                string tmpClassPy = routeClassBll.GetModel(Convert.ToInt32(route.LocationID)).ClassNamePY;

                sb.AppendFormat("<td><a href='{3}/{2}/{0}.html' target='_blank'>{1}</a></td>", dr["routeID"].ToString(), dr["RouteName"].ToString(), tmpClassPy, SysConfig.webSite);
                string[] temp = dr["Number"].ToString().Split(',');
                sb.AppendFormat("<td>{0}</td>", temp[0] + "大" + temp[1] + "小");
                sb.AppendFormat("<td>{0}</td>", (Convert.ToInt32(dr["RoutePrice"]) == 0 ? "价格电讯" : "&yen;" + Convert.ToInt32(dr["RoutePrice"]) + "元"));
                sb.AppendFormat("<td>{0}</td>", dr["RouteTime"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["StartTime"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["CreatedTime"].ToString());
                sb.Append("</tr>");
            }

            dataOrderDetailList = sb.ToString();
        }
Exemplo n.º 2
0
        private void BindOrderDetailData()
        {
            DataTable myTable = orderDetailBLL.GetData(" orderNumber ='" + orderNumber + "'");

            myTable = pg.pagination(myTable, 20, "");

            StringBuilder sb = new StringBuilder();

            foreach (DataRow dr in myTable.Rows)
            {
                sb.AppendFormat("<tr id='tr_{0}'>", dr["ID"].ToString());

                ClassLibrary.Model.Routes route = routeBLL.GetModel(Convert.ToInt32(dr["routeID"]));
                string tmpClassPy = routeClassBll.GetModel(Convert.ToInt32(route.LocationID)).ClassNamePY;

                sb.AppendFormat("<td><a href='/{2}/{1}.html' target='_blank'>{0}</a></td>", dr["RouteName"].ToString(), dr["routeID"].ToString(), tmpClassPy);
                string[] temp = dr["Number"].ToString().Split(',');
                sb.AppendFormat("<td>{0}</td>", temp[0] + "大" + temp[1] + "小");
                //sb.AppendFormat("<td><input id='price_{0}' type='text' size='10' value='{1}' /><input type='button' class='button' value='修改' onclick='UpdateOrderDetailPrice({0},{2})' /></td>", dr["ID"].ToString(), Convert.ToInt32(dr["RoutePrice"]), dr["ordernumber"].ToString());
                sb.AppendFormat("<td>&yen;{0}元</td>", Convert.ToInt32(dr["RoutePrice"]));
                sb.AppendFormat("<td>{0}</td>", dr["RouteTime"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["StartTime"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["CreatedTime"].ToString());
                sb.Append("</tr>");
            }

            dataOrderDetailList = sb.ToString();
        }
Exemplo n.º 3
0
        private void BindInfo()
        {
            route = bll.GetModel(routeID);
            if (route.routesClassID == "")
            {
                Response.StatusCode = 404;
                Response.End();
            }
            gList = rcBLL.GetModelList(String.Empty);
            if (route.ThemeID != "")
            {
                ClassLibrary.Model.RouteClass classmodel = gList.Find(delegate(ClassLibrary.Model.RouteClass rc) { return(rc.ID == Convert.ToInt32(route.ThemeID.Split(',')[0])); });
                themeName = "<div class='detl_zt'>" + classmodel.ClassName + "</div>";
            }
            routeClassId = route.LocationID;
            ClassLibrary.Model.RouteClass curClass = gList.Find(delegate(ClassLibrary.Model.RouteClass rc) { return(rc.ID == routeClassId); });

            if (curClass.ClassNamePY != comePY)
            {
                Response.StatusCode = 404;
                Response.End();
            }

            mipUrl = SysConfig.webSiteApp + "/" + comePY + "/" + routeID + ".html";

            //购买事件
            buyEventStr = mipUrl;

            dateType         = route.DateType;
            price            = Convert.ToInt32(route.Price);
            childPrice       = Convert.ToInt32(route.ChildPrice);
            routeFeature     = Function.AddTargetForMip(Function.UpdateStyleForMip(Function.UpdateImgTagForMip(replaceSite(route.RouteFeature))));
            descriptionPrice = Function.AddTargetForMip(Function.UpdateStyleForMip(Function.UpdateImgTagForMip(replaceSite(route.DescriptionPrice))));
            routeNotice      = Function.AddTargetForMip(Function.UpdateStyleForMip(Function.UpdateImgTagForMip(replaceSite(route.RouteNotice))));
            detailType       = route.DetailType;

            if (route.DatePrice != "")
            {
                string[] tmpDatePrice = route.DatePrice.Split('|');
                string   cDate        = DateTime.Now.ToShortDateString().ToString();
                for (int k = 0; k < tmpDatePrice.Length; k++)
                {
                    string tmpPrices = tmpDatePrice[k];
                    if (tmpPrices == "")
                    {
                        continue;
                    }
                    string[] tmpPrice = tmpPrices.Split(',');
                    TimeSpan ts       = DateTime.Parse(tmpPrice[0]) - DateTime.Now;
                    if (ts.TotalDays > 0)
                    {
                        datePrice += tmpPrices + "|";
                    }
                }
            }

            string[] imgs = route.Image.Split(',');
            image = SysConfig.webSite + SysConfig.UploadFilePathRoutesImg + imgs[0];
        }
Exemplo n.º 4
0
        private void RouteCopy(HttpContext context)
        {
            string id = context.Request.QueryString["id"];

            ClassLibrary.BLL.Routes   routeBll   = new ClassLibrary.BLL.Routes();
            ClassLibrary.Model.Routes routemodel = routeBll.GetModel(int.Parse(id));
            if (routemodel == null || routemodel.Title == "")
            {
                Print(context, "error");
                return;
            }
            string[] oldImgs      = routemodel.Image.Split(',');
            string   fileFullPath = context.Server.MapPath(SysConfig.UploadFilePathRoutesImg);
            string   newImgs      = "";

            for (int i = 0; i < oldImgs.Length; i++)
            {
                string ext      = Path.GetExtension(oldImgs[i]);
                string fileName = Function.GetRandomTime() + ext;
                try
                {
                    File.Copy(fileFullPath + oldImgs[i], fileFullPath + fileName);
                } catch (Exception e) {
                }
                newImgs += fileName + ",";
            }
            if (!string.IsNullOrEmpty(newImgs))
            {
                newImgs = newImgs.Substring(0, newImgs.Length - 1);
            }
            routemodel.Image       = newImgs;
            routemodel.Display     = false;
            routemodel.ViewCount   = 0;
            routemodel.Order       = 999;
            routemodel.FirstTime   = DateTime.Now.ToString("yyyy-MM-dd");
            routemodel.CreatedTime = DateTime.Now;

            if (routeBll.Add(routemodel) > 0)
            {
                if (routemodel.DetailType)
                {
                    int routeId = routeBll.GetLastId();
                    ClassLibrary.BLL.RouteDetails          rdBll      = new ClassLibrary.BLL.RouteDetails();
                    List <ClassLibrary.Model.RouteDetails> detailList = rdBll.GetModelList("routeId = " + routemodel.ID);
                    foreach (ClassLibrary.Model.RouteDetails model in detailList)
                    {
                        model.RouteID = routeId;
                        rdBll.Add(model);
                    }
                    Print(context, "success");
                }
            }
            else
            {
                Print(context, "error");
            }
        }
Exemplo n.º 5
0
        private void BindList()
        {
            DataTable myTable = comBLL.GetData("UserName='******'");

            myTable  = pg.pagination(myTable, 10, "");
            pageInfo = pg.pageNumList;

            StringBuilder sb = new StringBuilder();
            List <ClassLibrary.Model.RouteClass> rcList = new List <ClassLibrary.Model.RouteClass>();

            if (myTable.Rows.Count != 0)
            {
                ClassLibrary.BLL.RouteClass rcBLL = new ClassLibrary.BLL.RouteClass();
                rcList = rcBLL.GetModelList(string.Empty);
            }
            int rowIndex = 0;

            foreach (DataRow dr in myTable.Rows)
            {
                sb.Append("<tr'>");
                ClassLibrary.Model.Routes route = routeBLL.GetModel(Convert.ToInt32(dr["routeID"]));

                string tmpClassPy = rcList.Find(delegate(ClassLibrary.Model.RouteClass rc) { return(rc.ID == route.LocationID); }).ClassNamePY;

                sb.AppendFormat("<td align='center'>{0}</td>", ++rowIndex);
                sb.AppendFormat("<td align='center'><a href='{3}/{2}/{0}.html' target='_blank'>{1}</a></td>", dr["routeID"].ToString(), route.Title, tmpClassPy, SysConfig.webSite);
                sb.AppendFormat("<td align='center'>{0}</td>", GetGradeImg(dr["Grade"].ToString()));
                sb.AppendFormat("<td align='center'>{0}</td>", dr["Content"].ToString());
                sb.AppendFormat("<td align='center'>{0}</td>", Convert.ToBoolean(dr["Checked"]) ? "<span class='red'>已审核</span>" : "审核中");
                sb.AppendFormat("<td align='center'>{0}</td>", Convert.ToDateTime(dr["CreatedTime"]).ToString("yyyy-MM-dd"));

                sb.Append("</tr>");
            }

            if (sb.Length == 0)
            {
                sb.Append("<tr><td colspan='6'>暂无评价!</td></tr>");
            }

            dataList = sb.ToString();
        }
Exemplo n.º 6
0
        private void BindData(string sql)
        {
            DataTable myTable = routeCommentBLL.GetData(sql);

            myTable  = pg.pagination(myTable, 20, "");
            pageInfo = pg.pageNumList;

            StringBuilder sb = new StringBuilder();

            foreach (DataRow dr in myTable.Rows)
            {
                sb.AppendFormat("<tr id='tr_{0}'>", dr["ID"].ToString());
                ClassLibrary.Model.Routes rmodel = routeBLL.GetModel(Convert.ToInt32(dr["routeId"]));
                string tmpClassPy = rcList.Find(delegate(ClassLibrary.Model.RouteClass rcm) { return(rcm.ID == rmodel.LocationID); }).ClassNamePY;

                sb.AppendFormat("<td><a href='/{2}/{1}.html' target='_blank'>{0}</a></td>", Function.Clip(GetRoute(Convert.ToInt32(dr["routeID"])), 10, true), Convert.ToInt32(dr["routeID"]), tmpClassPy);
                sb.AppendFormat("<td>{0}</td>", Convert.ToInt16(dr["Grade"].ToString()));
                sb.AppendFormat("<td>{0}</td>", dr["UserName"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["Nickname"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["Email"].ToString());
                sb.AppendFormat("<td>{0}</td>", Convert.ToBoolean(dr["Checked"]) ? "<span class='green'>是</span>" : "<span class='red'>否</span>");
                sb.AppendFormat("<td>{0}</td>", dr["CreatedTime"].ToString());
                sb.Append("<td>");
                if (!Convert.ToBoolean(dr["Checked"]))
                {
                    sb.AppendFormat("<a href='RouteCommentList.aspx?ID={0}'>审核</a> ", dr["ID"].ToString());
                }
                else
                {
                    sb.Append("   ");
                }
                sb.AppendFormat("<a href='RouteCommentDetail.aspx?id={0}'>查看</a> ", dr["ID"].ToString());
                sb.AppendFormat("<a href='javascript:void(0)' onclick='routeCommentDelete({0})'>删除</a>", dr["ID"].ToString());
                sb.Append("</td>");

                sb.Append("</tr>");
            }
            dataRouteCommentList = sb.ToString();
        }
Exemplo n.º 7
0
        //网站信息
        private void GetWebInfo()
        {
            webMeta.Title       = "重庆青年旅行社_重庆旅行社_重庆中国青年旅行社_重庆中青旅行社";
            webMeta.Description = "重庆中国青年旅行社(www.qu17.com)称重庆青旅,旅游热线:400-017-5761.共青团市委直属重庆旅行社,中青旅集团成员单位,优质服务示范重庆旅行社,重庆青年旅行社具有国家旅游局颁证的出境旅游资质的国际旅行社,旅游品质最高的重庆旅行社,重庆十大金牌旅行社,出入境游、国内游、重庆周边游、长江三峡游为主导。";
            webMeta.Keyword     = "重庆旅行社,重庆青年旅行社,重庆中青旅,重庆中国青年旅行社,重庆旅游网";
            string url      = HttpContext.Current.Request.CurrentExecutionFilePath.ToLower();
            string tmpTitle = "_重庆中国青年旅行社";

            if (url.IndexOf("approutesearch.aspx") > -1)
            {
                webMeta.Title       = "旅游线路搜索结果" + tmpTitle;
                webMeta.Keyword     = "";
                webMeta.Description = "";
            }
            else if (url.IndexOf("approutelist.aspx") > -1)
            {
                string ping = Function.GetQueryString("py");
                ClassLibrary.BLL.RouteClass          routeClassBll = new ClassLibrary.BLL.RouteClass();
                List <ClassLibrary.Model.RouteClass> rcList        = routeClassBll.GetModelList("classNamePy='" + ping + "'");
                if (rcList.Count > 0)
                {
                    ClassLibrary.Model.RouteClass rc = rcList[0];
                    if (rc.ClassLevel == 4)
                    {
                        webMeta.Title       = string.Format("{0}旅游线路行程_{0}跟团游报价_重庆中国青年旅行社", rc.ClassName);
                        webMeta.Keyword     = string.Format("{0}旅游,{0}跟团游,{0}旅游行程报价,{0}旅游线路,重庆中青旅{0}旅游团", rc.ClassName);
                        webMeta.Description = string.Format("重庆中国青年旅行社设计{0}旅游线路行程,重庆到{0}旅游最新报价,{0}跟团游最具性价比的旅行社,重庆出发{0}旅游选择青旅品质服务享受旅途,重庆青旅热线400-017-5761.", rc.ClassName);
                    }
                    else if (rc.ClassLevel == 3)
                    {
                        if (rc.ID == (int)SysConfig.RouteClass.重庆)
                        {
                            webMeta.Title       = "重庆周边游_重庆周边旅游线路报价_重庆中国青年旅行社";
                            webMeta.Keyword     = "重庆周边旅游,重庆周边旅游线路,重庆周边旅游行程,重庆周边旅游报价";
                            webMeta.Description = "重庆周边旅游线路、周边旅游行程报价由重庆中国青年旅行社提供设计,重庆青旅热线400-017-5761.";
                        }
                        else if (rc.ParentID == (int)SysConfig.RouteClass.豪华船)
                        {
                            webMeta.Title       = string.Format("重庆三峡{0}旅游_{0}三峡旅游报价", rc.ClassName);
                            webMeta.Keyword     = string.Format("重庆三峡{0}旅游,三峡{0}旅游报价,重庆三峡旅游", rc.ClassName);
                            webMeta.Description = string.Format("重庆青年旅行社提供重庆三峡{0}旅游线路报价,重庆三峡{0}旅游费用,长江三峡豪华游船旅游价格,三峡{0}旅游要多少钱,详询中青旅电话400-017-5761.", rc.ClassName);
                        }
                        else
                        {
                            webMeta.Title       = string.Format("{0}旅游线路行程_{0}跟团游报价_重庆中国青年旅行社", rc.ClassName);
                            webMeta.Keyword     = string.Format("{0}旅游,{0}跟团游,{0}旅游行程报价,{0}旅游线路,重庆中青旅{0}旅游团", rc.ClassName);
                            webMeta.Description = string.Format("重庆中国青年旅行社设计{0}旅游线路行程,重庆到{0}旅游最新报价,{0}跟团游最具性价比的旅行社,重庆出发{0}旅游选择青旅品质服务享受旅途,重庆青旅热线400-017-5761.", rc.ClassName);
                        }
                    }
                    else if (rc.ClassLevel == 2)
                    {
                        if (rc.ParentID == (int)SysConfig.RouteClass.峡旅游)
                        {
                            if (rc.ID == (int)SysConfig.RouteClass.豪华船)
                            {
                                webMeta.Title       = "三峡豪华游船_豪华游船航期表_重庆三峡豪华游轮_重庆中国青年旅行社";
                                webMeta.Keyword     = "重庆三峡豪华游船,长江三峡游船,豪华游船航期表,三峡涉外豪华游轮";
                                webMeta.Description = "重庆中国青年旅行社提供各系列长江三峡豪华游轮,以及三峡涉外豪华游轮旅游品质服务,重庆三峡涉外豪华游轮预定,重庆中青旅热线:400-017-5761";
                            }
                            else
                            {
                                webMeta.Title       = "三峡国内游船_重庆三峡国内船_重庆中国青年旅行社";
                                webMeta.Keyword     = "重庆三峡国内游船,长江三峡游船,三峡国内游轮";
                                webMeta.Description = "重庆中国青年旅行社提供长江三峡国内游船,长江三峡旅游品质服务,重庆三峡国内游船预定,重庆中青旅热线:400-017-5761";
                            }
                        }
                        else
                        {
                            webMeta.Title       = string.Format("{0}旅游线路行程_{0}跟团游报价_重庆中国青年旅行社", rc.ClassName);
                            webMeta.Keyword     = string.Format("{0}旅游,{0}跟团游,{0}旅游行程报价,{0}旅游线路,重庆中青旅{0}旅游团", rc.ClassName);
                            webMeta.Description = string.Format("重庆中国青年旅行社设计{0}旅游线路行程,重庆到{0}旅游最新报价,{0}跟团游最具性价比的旅行社,重庆出发{0}旅游选择青旅品质服务享受旅途,重庆青旅热线400-017-5761.", rc.ClassName);
                        }
                    }
                    else
                    {
                        if (rc.ID == (int)SysConfig.RouteClass.国内旅游)
                        {
                            webMeta.Title       = "国内旅游线路行程_重庆出发国内旅游线路_重庆中国青年旅行社";
                            webMeta.Keyword     = "国内游线路,国内游行程,国内游报价,国内游跟团,重庆出发国内游";
                            webMeta.Description = "重庆出发国内旅游线路、国内旅游行程报价由重庆中国青年旅行社提供设计,重庆青旅热线400-017-5761.";
                        }
                        else if (rc.ID == (int)SysConfig.RouteClass.出境旅游)
                        {
                            webMeta.Title       = "出境旅游线路行程_重庆出发出境旅游线路_重庆中国青年旅行社";
                            webMeta.Keyword     = "出境游线路,出境游行程,出境游报价,出境游跟团,重庆出发出境游";
                            webMeta.Description = "重庆出发出境旅游线路、出境旅游行程报价由重庆中国青年旅行社提供设计,重庆青旅热线400-017-5761.";
                        }
                        else if (rc.ID == (int)SysConfig.RouteClass.峡旅游)
                        {
                            webMeta.Title       = "重庆长江三峡旅游_重庆三峡旅游行程景点_重庆中国青年旅行社";
                            webMeta.Keyword     = "重庆三峡旅游,长江三峡旅游线路,三峡旅游报价,三峡游景点,三峡游船预定";
                            webMeta.Description = "重庆三峡旅游行程、三峡游线路、长江三峡旅游报价由重庆中国青年旅行社提供设计,重庆青旅热线400-017-5761.";
                        }
                    }
                }
                else
                {
                    ClassLibrary.BLL.RouteType          rtBll  = new ClassLibrary.BLL.RouteType();
                    List <ClassLibrary.Model.RouteType> rtList = rtBll.GetModelList("classNamePy='" + ping + "'");
                    if (rtList.Count > 0)
                    {
                        ClassLibrary.Model.RouteType rtc = rtList[0];
                        webMeta.Title       = string.Format("{0}旅游线路_重庆出发{0}旅游报价", rtc.ClassName.Replace("游", "")) + tmpTitle;
                        webMeta.Keyword     = string.Format("{0}旅游,{0}旅游报价,{0}旅游线路", rtc.ClassName.Replace("游", ""));
                        webMeta.Description = string.Format("重庆中国青年旅行社设计{0}旅游线路行程,重庆出发{0}旅游最新报价,{0}跟团游价格,重庆出发{0}旅游选择青旅品质服务享受旅途,重庆青旅热线400-017-5761.", rtc.ClassName.Replace("游", ""));
                    }
                }
            }
            else if (url.IndexOf("approutedetail.aspx") > -1)
            {
                int id = Convert.ToInt32(Function.GetQueryString("id"));
                ClassLibrary.BLL.Routes   routeBll = new ClassLibrary.BLL.Routes();
                ClassLibrary.Model.Routes rModel   = routeBll.GetModel(id);
                webMeta.Title = rModel.Title + tmpTitle;
                if (rModel.SeoTitle != null && rModel.SeoTitle.Trim() != "")
                {
                    webMeta.Title = rModel.SeoTitle;
                }
                webMeta.Keyword = rModel.SeoKeywords;
                if (webMeta.Keyword == "")
                {
                    webMeta.Keyword = rModel.Title;
                }

                webMeta.Description = rModel.SeoDescription;
                if (webMeta.Description == "")
                {
                    webMeta.Description = Function.Clip(Function.ClearHtml(rModel.RouteFeature + rModel.DescriptionRoute).Replace(" ", "").Replace("	", ""), 80, false);
                }
            }
            else if (url.IndexOf("appabout.aspx") > -1)
            {
                webMeta.Title       = "重庆中国青年旅行社简介";
                webMeta.Keyword     = "";
                webMeta.Description = "";
            }
            else if (url.IndexOf("apparticlelist.aspx") > -1)
            {
                string strId = Function.GetQueryString("id");
                if (strId != "")
                {
                    int classid = Convert.ToInt32(strId);
                    if (classid == (int)SysConfig.NewsClass.旅游资讯)
                    {
                        webMeta.Title       = "重庆旅行社旅游资讯_最新旅游资讯指南" + tmpTitle;
                        webMeta.Description = "重庆旅游资讯,重庆旅游指南,旅游最新资讯,重庆旅行社资讯";
                        webMeta.Keyword     = "重庆青年旅行社旅游资讯大致包含旅行社资讯,旅游相关实时新闻,旅游行业最新资讯消息,重庆以及周边旅游指南,重庆中青旅一如既往的高品质服务游客.";
                    }
                    else if (classid == (int)SysConfig.NewsClass.旅游攻略)
                    {
                        webMeta.Title       = "重庆旅行社旅游攻略_最新旅游攻略" + tmpTitle;
                        webMeta.Description = "重庆旅游攻略,重庆旅游指南,旅游最新攻略";
                        webMeta.Keyword     = "重庆青年旅行社旅游攻略大致包含旅游的吃、住、行、游、购、娱方面的介绍以及方式方法,重庆青旅更新的旅游攻略内容板块将更加方便您的出游.";
                    }
                }
                else
                {
                    webMeta.Title       = "旅游攻略网_旅游景点网_最新旅游指南_重庆中国青年旅行社";
                    webMeta.Keyword     = "旅游攻略网,旅游景点网,最新旅游指南";
                    webMeta.Description = "重庆中国青年旅行社旅游攻略网旅游景点网提供各种旅游攻略,旅游景点排行,最新旅游资讯,旅游景点推荐,详情请咨询中青旅400-017-5761";
                }
            }
            else if (url.IndexOf("apparticledetail.aspx") > -1)
            {
                int id = Convert.ToInt32(Function.GetQueryString("id"));
                ClassLibrary.BLL.News   newsBll = new ClassLibrary.BLL.News();
                ClassLibrary.Model.News rModel  = newsBll.GetModel(id);
                webMeta.Title   = rModel.Title + tmpTitle;
                webMeta.Keyword = rModel.Keywords;
                if (webMeta.Keyword == "")
                {
                    webMeta.Keyword = rModel.Title;
                }

                webMeta.Description = rModel.Description;
                if (webMeta.Description == "")
                {
                    webMeta.Description = Function.Clip(Function.ClearHtml(rModel.Description).Replace(" ", "").Replace("	", ""), 80, false);
                }
            }
            else if (url.IndexOf("appnav.aspx") > -1)
            {
                webMeta.Title       = "旅游目的地导航" + tmpTitle;
                webMeta.Keyword     = "";
                webMeta.Description = "";
            }
            else if (url.IndexOf("apporder.aspx") > -1)
            {
                webMeta.Title       = "订单提交信息" + tmpTitle;
                webMeta.Keyword     = "";
                webMeta.Description = "";
            }
            else if (url.IndexOf("appshopcart.aspx") > -1)
            {
                webMeta.Title       = "旅游订单信息" + tmpTitle;
                webMeta.Keyword     = "";
                webMeta.Description = "";
            }
            else if (url.IndexOf("appsaleslist.aspx") > -1)
            {
                webMeta.Title       = "特价旅游专区_最划算的旅游" + tmpTitle;
                webMeta.Keyword     = "青旅特价旅游,特价旅游旅行社,重庆旅行社特价团";
                webMeta.Description = "重庆中国青年旅行社特价旅游专区产品为限时限量旅游线路,由于游客临时退位置或者旅行社原因,导致紧急处理的旅游产品,在整个旅游行业可以说是性价比最高,超级划算的特价旅游产品.";
            }
        }
Exemplo n.º 8
0
        //线路信息
        private void BindInfo()
        {
            route = bll.GetModel(routeID);
            if (route.routesClassID == "")
            {
                Response.StatusCode = 404;
                Response.End();
            }
            gList = rcBLL.GetModelList(String.Empty);
            if (route.ThemeID != "")
            {
                ClassLibrary.Model.RouteType classmodel = rtBll.GetModel(Convert.ToInt32(route.ThemeID.Split(',')[0]));
                if (classmodel != null)
                {
                    themeName = string.Format("<div class='info_zhuti'><a href='{0}/{1}/' target='_blank'>{2}</a></div>", SysConfig.webSite, classmodel.classNamePY, classmodel.ClassName);
                }
            }
            routeClassId = route.LocationID;
            traffic      = route.TrafficModel;
            if (traffic.IndexOf("自理") > -1)
            {
                traffic = traffic.Replace("自理去", "").Replace("自理回", "").Trim();
            }

            ClassLibrary.Model.RouteClass curClass = gList.Find(delegate(ClassLibrary.Model.RouteClass rc) { return(rc.ID == routeClassId); });

            pingYin = curClass.ClassNamePY;
            if (curClass.ClassLevel == 4)
            {
                parentId    = curClass.ParentID;
                displayName = curClass.ClassName;
                displayPy   = curClass.ClassNamePY;
            }
            else if (curClass.ID == (int)SysConfig.RouteClass.峡旅游 || curClass.ParentID == (int)SysConfig.RouteClass.峡旅游 || curClass.ParentID == (int)SysConfig.RouteClass.豪华船)
            {
                parentId    = (int)SysConfig.RouteClass.峡旅游;
                displayName = "三峡";
                displayPy   = "sanxia";
            }
            else
            {
                parentId    = curClass.ID;
                displayName = curClass.ClassName;
                displayPy   = curClass.ClassNamePY;
            }

            if (pingYin != comePY)
            {
                Response.StatusCode = 404;
                Response.End();
            }

            //购买事件
            buyEventStr = string.Format("buy2('{0}','{1}','{2}','{3}')",
                                        route.ID,
                                        Function.Clip(route.Title, 18, true),
                                        route.RouteTime,
                                        pingYin);

            dateType         = route.DateType;
            price            = Convert.ToInt32(route.Price);
            childPrice       = Convert.ToInt32(route.ChildPrice);
            routeFeature     = route.RouteFeature;
            descriptionPrice = route.DescriptionPrice;
            routeNotice      = route.RouteNotice;
            detailType       = route.DetailType;

            if (price == 0)
            {
                strPrice = "电询";
            }
            else
            {
                strPrice = "&yen;<em>" + price + "</em>起";
            }

            datePrice = "";

            if (route.DatePrice != "")
            {
                string[] tmpDatePrice = route.DatePrice.Split('|');
                string   cDate        = DateTime.Now.ToShortDateString().ToString();
                for (int k = 0; k < tmpDatePrice.Length; k++)
                {
                    string tmpPrices = tmpDatePrice[k];
                    if (tmpPrices == "")
                    {
                        continue;
                    }
                    string[] tmpPrice = tmpPrices.Split(',');
                    TimeSpan ts       = DateTime.Parse(tmpPrice[0]) - DateTime.Now;
                    if (ts.TotalDays > 0)
                    {
                        datePrice += tmpPrices + "|";
                    }
                }
            }

            StringBuilder sb = new StringBuilder();

            string[] imgs = route.Image.Split(',');
            if (imgs.Length <= 3)
            {
                inactive = "inactive";
            }
            int imgIndex = 0;

            foreach (string img in imgs)
            {
                imgIndex++;
                if (imgIndex == 1)
                {
                    firstImg = ClassLibrary.Common.SysConfig.UploadFilePathRoutesImg + img;
                }
                sb.AppendFormat("<li class='{1}'><i></i><img src='{0}' alt='' width='100' height='63' /></li>", ClassLibrary.Common.SysConfig.UploadFilePathRoutesImg + img, imgIndex == 1 ? "on" : "");
            }
            smallImageList = sb.ToString();
        }
Exemplo n.º 9
0
        private void EditRoute()
        {
            decimal price      = 0;
            int     routeOrder = 0;

            ClassLibrary.Model.Routes routeModel = new ClassLibrary.Model.Routes();

            routeModel.ID = routeId;

            routeModel.routesPrentClassID = "";
            routeModel.Title = Request.Form["Title"];

            if (Decimal.TryParse(Request.Form["Price"], out price))
            {
                routeModel.Price = price;
            }
            else
            {
                Response.Write("<script>alert('成人价格错误!');history.back(-1);</script>");
                return;
            }
            if (Request.Form["ChildPrice"] == "")
            {
                routeModel.ChildPrice = 0;
            }
            else if (Decimal.TryParse(Request.Form["ChildPrice"], out price))
            {
                routeModel.ChildPrice = price;
            }
            else
            {
                Response.Write("<script>alert('小孩价格错误!');history.back(-1);</script>");
                return;
            }
            if (Request.Form["routeOrder"] == "")
            {
                routeModel.Order = 9999;
            }
            else if (int.TryParse(Request.Form["routeOrder"], out routeOrder))
            {
                routeModel.Order = routeOrder;
            }
            else
            {
                Response.Write("<script>alert('线路排序错误!');history.back(-1);</script>");
                return;
            }
            int advanceDay = 0;

            if (int.TryParse(Request.Form["AdvanceDays"], out advanceDay))
            {
                routeModel.AdvanceDays = advanceDay;
            }


            routeModel.ThemeID = Request.Form["ThemeID"];
            if (routeModel.ThemeID == null)
            {
                routeModel.ThemeID = "";
            }
            //routeModel.routesPrentClassID = ParentClassIDList(routeModel.routesClassID);
            routeModel.StartPosition = Request.Form["StartPosition"];
            routeModel.RouteTime     = Request.Form["RouteTime"];
            routeModel.TrafficModel  = Request.Form["TrafficModel1"] + "去 " + Request.Form["TrafficModel2"] + "回";
            //routeModel.DescriptionRoute = Request.Form["DescriptionRoute"];
            routeModel.DescriptionPrice = ClassLibrary.BLL.WebClass.addInternelLink(Request.Form["DescriptionPrice"], 1, null);
            routeModel.RecommendHot     = Convert.ToBoolean(Request.Form["RecommendHot"]);
            routeModel.SeoKeywords      = Request.Form["SeoKeywords"];
            routeModel.SeoDescription   = Request.Form["SeoDescription"];
            //routeModel.RouteFeature = Request.Form["RouteFeature"];
            routeModel.RouteNotice = ClassLibrary.BLL.WebClass.addInternelLink(Request.Form["RouteNotice"], 1, null);
            routeModel.Display     = Convert.ToBoolean(Request.Form["Isdisplay"]);
            routeModel.ViewCount   = Convert.ToInt32(Request.Form["ViewCount"]);
            routeModel.Destination = Request.Form["Destination"];
            routeModel.Supplier    = Request.Form["SupplierName"];
            routeModel.SupplierTel = Request.Form["SupplierTel"];
            routeModel.DateType    = Convert.ToBoolean(Request.Form["DateType"]);
            routeModel.SeoTitle    = Request.Form["SeoTitle"];
            routeModel.Bright      = Request.Form["RouteBright"];
            routeModel.BoatName    = Request.Form["BoatName"];
            routeModel.LocationID  = Convert.ToInt32(Request.Form["locationid"]);
            if (routeModel.LocationID == 0)
            {
                Response.Write("<script>alert('请正确选择线路地址!');history.back(-1);</script>");
                return;
            }
            if (routeModel.DateType)
            {
                routeModel.DatePrice = Request.Form["DatePrice"];
            }

            routeModel.DetailType = Convert.ToBoolean(Request.Form["DetailType"]);
            if (routeModel.DetailType)
            {
                routeModel.RouteTime = Request.Form["xing_day"];

                /*for (int j = 1; j <= Int32.Parse(routeModel.RouteTime); j++)
                 * {
                 *  if (Request.Form["route_" + j + "_0"] == null)
                 *  {
                 *      Response.Write("<script>alert('请输入第 " + j + " 天标题');history.back(-1);</script>");
                 *      return;
                 *  }
                 *  if (Request.Form["route_" + j + "_1"] == null)
                 *  {
                 *      Response.Write("<script>alert('请输入第 " + j + " 天行程');history.back(-1);</script>");
                 *      return;
                 *  }
                 * }*/
                routeModel.DescriptionRoute = Request.Form["route_1_1"];
            }

            string province = Request.Form["ProvinceCheckBox"];

            if (province == null || province == "")
            {
                Response.Write("<script>alert('请选择线路目的地省市!');history.back(-1);</script>");
                return;
            }
            routeModel.routesPrentClassID = ParentClassIDList(province) + ",";

            string scenic = Request.Form["ScenicCheckBox"];

            if (scenic == null)
            {
                scenic = "";
            }

            string[] temScenics = scenic.Split(',');
            foreach (string temScenic in temScenics)
            {
                if (!routeModel.routesPrentClassID.Contains(temScenic))
                {
                    routeModel.routesPrentClassID += temScenic + ",";
                }
            }
            routeModel.routesPrentClassID = routeModel.routesPrentClassID.Substring(0, routeModel.routesPrentClassID.Length - 1);

            int routeParentID = Convert.ToInt32(Request.Form["routeParentID"]);

            if (scenic != "")
            {
                string[] scenicIds = scenic.Split(',');
                routeModel.routesClassID = routeParentID + "," + scenicIds[0];
            }
            else
            {
                string[] scenicIds = province.Split(',');
                routeModel.routesClassID = routeParentID + "," + scenicIds[0];
            }

            //string[] subRCIds = province.Split(',');

            routeModel.RouteFeature = ClassLibrary.BLL.WebClass.addInternelLink(Request.Form["RouteFeature"], 1, null);
            if (!routeModel.DetailType)
            {
                routeModel.DescriptionRoute = ClassLibrary.BLL.WebClass.addInternelLink(Request.Form["DescriptionRoute"], 1, null);
            }

            //图片
            HttpFileCollection files = Request.Files;

            int    size         = 0;
            string fileFullPath = Server.MapPath(SysConfig.UploadFilePathRoutesImg);

            Function.CreatedDirectory(fileFullPath);
            string oldAppImage = Request.Form["appImage_Hidden"];

            routeModel.AppImg = oldAppImage;

            if (files.Count > 0)
            {
                string[] oldImages = Request.Form["Image_Hidden"].Split(',');

                for (int i = 0; i < files.Count; i++)
                {
                    HttpPostedFile file = files[i];
                    size = file.ContentLength;

                    if (size > 0)
                    {
                        string ext      = Path.GetExtension(file.FileName);
                        string fileName = DateTime.Now.ToString("yyMMddHHmmssffff") + ext;

                        file.SaveAs(fileFullPath + fileName);
                        if (i == 0)
                        {
                            //缩图
                            Bitmap tmp  = new Bitmap(fileFullPath + fileName);
                            Bitmap bmp0 = Function.MakeThumNail(tmp, 100, 64);
                            tmp.Dispose();
                            string appfileName = DateTime.Now.ToString("yyMMddHHmmssffff") + ext;
                            Function.SaveBitmapImg(bmp0, fileFullPath + appfileName, ((long)90));
                            //bmp0.Save(fileFullPath + fileName);
                            bmp0.Dispose();
                            routeModel.AppImg = appfileName;

                            if (oldAppImage != "")
                            {
                                Function.DeleteFile(fileFullPath + oldAppImage);
                            }
                        }
                        routeModel.Image += fileName + ",";

                        if (oldImages.Length > i)
                        {
                            Function.DeleteFile(fileFullPath + oldImages[i]);
                        }
                    }
                    else //没有新图片时使用对应的旧图
                    {
                        if (oldImages.Length > i)
                        {
                            routeModel.Image += oldImages[i] + ",";
                        }
                    }
                }

                if (!string.IsNullOrEmpty(routeModel.Image))
                {
                    routeModel.Image = routeModel.Image.Substring(0, routeModel.Image.Length - 1);
                }
            }
            else
            {
                routeModel.Image = Request.Form["Image_Hidden"];
            }
            if (routeModel.AppImg == "")
            {
                string fileName = routeModel.Image.Split(',')[0];
                //缩图
                Bitmap tmp  = new Bitmap(fileFullPath + fileName);
                Bitmap bmp0 = Function.MakeThumNail(tmp, 100, 64);
                tmp.Dispose();
                string ext         = Path.GetExtension(fileName);
                string appfileName = Function.GetRandomTime() + ext;
                Function.SaveBitmapImg(bmp0, fileFullPath + appfileName, ((long)90));
                bmp0.Dispose();

                routeModel.AppImg = appfileName;
            }

            //end

            if (routeBLL.Update(routeModel) > 0)
            {
                bool oldDetailType = Convert.ToBoolean(Request.Form["DetailType_Hidden"]);
                if (oldDetailType)
                {
                    //delete
                    ClassLibrary.BLL.RouteDetails routeDetailBll = new ClassLibrary.BLL.RouteDetails();

                    routeDetailBll.DeleteByRouteId(routeId);
                }
                if (routeModel.DetailType)
                {
                    //update
                    ClassLibrary.Model.RouteDetails routeDetailModel;
                    ClassLibrary.BLL.RouteDetails   routeDetailBll = new ClassLibrary.BLL.RouteDetails();

                    for (int j = 1; j <= Int32.Parse(routeModel.RouteTime); j++)
                    {
                        routeDetailModel          = new ClassLibrary.Model.RouteDetails();
                        routeDetailModel.RouteID  = routeModel.ID;
                        routeDetailModel.DayOrder = j;
                        routeDetailModel.DayTitle = Request.Form["route_" + j + "_0"];
                        if (Convert.ToBoolean(Request.Form["rdo_title_" + j]))
                        {
                            routeDetailModel.DayTitle = Request.Form["route_" + j + "_0_0"];
                            int snum = Convert.ToInt32(Request.Form["jd_title_sc" + j]);
                            for (int k = 1; k < snum; k++)
                            {
                                routeDetailModel.DayTitle += "<em class='tfc" + Request.Form["s_route_" + j + "_0_" + (k - 1)] + "'></em>";
                                routeDetailModel.DayTitle += Request.Form["route_" + j + "_0_" + k];
                            }
                            routeDetailModel.Titletype = true;
                            routeDetailModel.Scenicnum = snum;
                        }
                        routeDetailModel.DayDetail     = ClassLibrary.BLL.WebClass.addInternelLink(Request.Form["route_" + j + "_1"], 1, null);
                        routeDetailModel.Breakfastdesc = Request.Form["route_" + j + "_6"];
                        routeDetailModel.Lunchdesc     = Request.Form["route_" + j + "_7"];
                        routeDetailModel.Dinnerdesc    = Request.Form["route_" + j + "_8"];
                        if (Request.Form["route_" + j + "_2"] != null)
                        {
                            routeDetailModel.BreakFast = true;
                        }
                        if (Request.Form["route_" + j + "_3"] != null)
                        {
                            routeDetailModel.Lunch = true;
                        }
                        if (Request.Form["route_" + j + "_4"] != null)
                        {
                            routeDetailModel.Dinner = true;
                        }
                        routeDetailModel.Hotel = Request.Form["route_" + j + "_5"];

                        routeDetailBll.Add(routeDetailModel);
                    }
                }
                Function.goMessagePage("修改路线", "操作成功", "Routes/RouteList.aspx");
            }
            else
            {
                Function.goMessagePage("修改路线", "操作失败,请稍后再试", "Routes/RouteList.aspx");
            }
        }
Exemplo n.º 10
0
        private void BindData()
        {
            myModel = routeBLL.GetModel(routeId);

            if (myModel != null)
            {
                themeID          = myModel.ThemeID;
                routeClassId     = Int32.Parse(myModel.routesClassID.Split(',')[1]);
                routeParentId    = Int32.Parse(myModel.routesClassID.Split(',')[0]);
                trafficModel1    = myModel.TrafficModel.Substring(0, 2);
                trafficModel2    = myModel.TrafficModel.Substring(4, 2);
                title            = myModel.Title;
                price            = Convert.ToInt32(myModel.Price);
                routeOrder       = myModel.Order;
                startPosition    = myModel.StartPosition;
                routeTime        = myModel.RouteTime;
                descriptionRoute = myModel.DescriptionRoute;
                descriptionPrice = myModel.DescriptionPrice;
                recommendHot     = myModel.RecommendHot;
                destination      = myModel.Destination;
                supplierName     = myModel.Supplier;
                supplierTel      = myModel.SupplierTel;
                seoTitle         = myModel.SeoTitle;
                bright           = myModel.Bright;
                boatName         = myModel.BoatName;
                image            = myModel.Image;
                appImage         = myModel.AppImg;

                string[]      images = myModel.Image.Split(',');
                StringBuilder sbri   = new StringBuilder();
                for (int i = 0; i < images.Length; i++)
                {
                    sbri.AppendLine("<div>");
                    sbri.AppendLine("<input type='file' name='Image' onchange='CheckImgFile(this)' />");
                    sbri.AppendFormat("<img src='{0}' width='70' height='50' />", ClassLibrary.Common.SysConfig.UploadFilePathRoutesImg + images[i]);
                    sbri.AppendLine("</div>");
                }
                routeImage     = sbri.ToString();
                seoKeywords    = myModel.SeoKeywords;
                seoDescription = myModel.SeoDescription;
                viewCount      = myModel.ViewCount;
                detailType     = myModel.DetailType;
                dateType       = myModel.DateType;
                datePrice      = "";

                if (myModel.DatePrice != "")
                {
                    string[] tmpDatePrice = myModel.DatePrice.Split('|');
                    string   cDate        = DateTime.Now.ToShortDateString().ToString();
                    for (int k = 0; k < tmpDatePrice.Length; k++)
                    {
                        string tmpPrices = tmpDatePrice[k];
                        if (tmpPrices == "")
                        {
                            continue;
                        }
                        string[] tmpPrice = tmpPrices.Split(',');
                        TimeSpan ts       = DateTime.Parse(tmpPrice[0]) - DateTime.Now;
                        if (ts.TotalDays > 0)
                        {
                            datePrice += tmpPrices + "|";
                        }
                    }
                }
                childPrice          = Convert.ToInt32(myModel.ChildPrice);
                advanceDays         = myModel.AdvanceDays;
                routeFeature        = myModel.RouteFeature;
                routeNotice         = myModel.RouteNotice;
                isdisplay           = myModel.Display;
                routeParentClassIds = myModel.routesPrentClassID;
                if (detailType)
                {
                    routeList = routeDetailBll.GetModelList("RouteID = '" + routeId + "' order by dayOrder");
                    StringBuilder sb = new StringBuilder();
                    for (int i = 1; i <= routeList.Count; i++)
                    {
                        ClassLibrary.Model.RouteDetails detail = routeList[i - 1];
                        sb.AppendFormat("<div class='fieldset xingcheng-by-day' id='day_{0}'>", i);
                        //sb.AppendFormat("<dl><dd><b>第{0}天:<input class='text' id='route_{0}_0' name='route_{0}_0'  style='width:300px;' value='{1}'/></b>{2}</dd></dl>", i, detail.DayTitle, (i != 1) ? ("&nbsp;<a id='remove_day" + i + "' href='#' onclick='xingcheng_remove_day();return false;' style='display:" + ((i == routeList.Count) ? "" : "none") + "'>删除第" + i + "天行程</a>") : "");

                        sb.AppendFormat("<dl><dd><b>第{0}天:<input type='radio' name='rdo_title_{0}' value='False' {1} onclick='checkTitle(this,{0})' />按标题<input class='text' id='route_{0}_0' name='route_{0}_0' value='{3}'  style='width:300px;{2}' />",
                                        i, detail.Titletype ? "" : "checked='checked'", detail.Titletype ? "display:none;" : "", detail.Titletype ? "" : detail.DayTitle);
                        sb.AppendFormat("<input type='radio' name='rdo_title_{0}' value='True' {1} onclick='checkTitle(this,{0})' />按景点</b>{2}</dd></dl>",
                                        i, detail.Titletype ? "checked='checked'" : "", (i != 1) ? ("&nbsp;<a id='remove_day" + i + "' href='#' onclick='xingcheng_remove_day();return false;' style='display:" + ((i == routeList.Count) ? "" : "none") + "'>删除第" + i + "天行程</a>") : "");

                        if (detail.Titletype)
                        {
                            string[] dtitle = new string[detail.Scenicnum];
                            string[] dslt   = new string[detail.Scenicnum - 1];
                            string   tle    = detail.DayTitle;
                            dtitle[0] = tle.Substring(0, tle.IndexOf("<em"));
                            for (int m = 1; m < detail.Scenicnum; m++)
                            {
                                tle         = tle.Substring(tle.IndexOf("tfc") + 3);
                                dslt[m - 1] = tle.Substring(0, tle.IndexOf("'"));
                                tle         = tle.Substring(tle.IndexOf("</em>") + 5);
                                if (m == detail.Scenicnum - 1)
                                {
                                    dtitle[m] = tle;
                                }
                                else
                                {
                                    dtitle[m] = tle.Substring(0, tle.IndexOf("<em"));
                                }
                            }
                            //555<em class='tfc2'></em>444<em class='tfc3'></em>333<em class='tfc1'></em>222<em class='tfc2'></em>111<em class='tfc3'></em>900

                            sb.AppendFormat("<dl class='titleByJd' id='jd_title_{0}'><dd><input class='text' id='route_{0}_0_0' name='route_{0}_0_0' size='10' value='{1}' /></dd>", i, dtitle[0]);
                            for (int n = 1; n < detail.Scenicnum; n++)
                            {
                                sb.AppendFormat("<dd><select name='s_route_{0}_0_{1}'><option value='1' {2}>=飞机=</option><option value='2' {3}>=汽车=</option><option value='3' {4}>=轮船=</option><option value='4' {5}>=火车=</option></select>",
                                                i, n - 1, dslt[n - 1] == "1" ? "selected" : "", dslt[n - 1] == "2" ? "selected" : "", dslt[n - 1] == "3" ? "selected" : "", dslt[n - 1] == "4" ? "selected" : "");
                                sb.AppendFormat("<input class='text' id='route_{0}_0_{1}' name='route_{0}_0_{1}' size='10' value='{2}' /></dd>", i, n, dtitle[n]);
                            }
                            sb.AppendFormat("<a href='#?' onclick='xingcheng_add_jd({0});'>+添加</a><a href='#?' onclick='xingcheng_remove_jd({0});'>-减少</a>", i);
                            sb.AppendFormat("<input type='hidden' id='jd_title_sc{0}' name='jd_title_sc{0}' value='{1}' /></dl>", i, detail.Scenicnum);
                        }

                        sb.AppendFormat("<dl><dt>行程安排:</dt>");
                        sb.AppendFormat("<dd><div class='add_del_box'>");
                        sb.AppendFormat("<textarea id='route_{0}_1' name='route_{0}_1' style='width:700px;' rows='15'>{1}</textarea>", i, detail.DayDetail);
                        sb.AppendFormat("</div></dd></dl>");
                        sb.AppendFormat("<dl class='hotel'><dd>");
                        sb.AppendFormat("<div class='floatL'>早餐:<input id='route_{0}_2' name='route_{0}_2' type='checkbox' {2} /><input class='text text160' id='route_{0}_6' name='route_{0}_6' type='text' size='20' value='{1}' /></div>", i, detail.Breakfastdesc, detail.BreakFast ? "checked" : "");
                        sb.AppendFormat("<div class='floatL'>中餐:<input id='route_{0}_3' name='route_{0}_3' type='checkbox' {2} /><input class='text text160' id='route_{0}_7' name='route_{0}_7' type='text' size='20' value='{1}' /></div>", i, detail.Lunchdesc, detail.Lunch ? "checked" : "");
                        sb.AppendFormat("<div class='floatL'>晚餐:<input id='route_{0}_4' name='route_{0}_4' type='checkbox' {2} /><input class='text text160' id='route_{0}_8' name='route_{0}_8' type='text' size='20' value='{1}' /></div>", i, detail.Dinnerdesc, detail.Dinner ? "checked" : "");
                        sb.AppendFormat("</dd></dl>");
                        sb.AppendFormat("<dl><dt>住宿:<input type='text' class='text text160' id='route_{0}_5' name='route_{0}_5' value='{1}'/></dt></dl></div>", i, detail.Hotel);
                    }
                    routeDetails = sb.ToString();
                }
                else
                {
                    StringBuilder sb = new StringBuilder();

                    sb.AppendFormat("<div class='fieldset xingcheng-by-day' id='day_1'>");
                    //sb.AppendFormat("<dl><dd><b>第1天:<input class='text' id='route_1_0' name='route_1_0'  style='width:300px;' /></b></dd></dl>");

                    sb.AppendFormat("<dl><dd><b>第1天:<input type='radio' name='rdo_title_1' value='False' checked='checked' onclick='checkTitle(this,1)' />按标题<input class='text' id='route_1_0' name='route_1_0'  style='width:300px;' />");
                    sb.AppendFormat("<input type='radio' name='rdo_title_1' value='True' onclick='checkTitle(this,1)' />按景点</b></dd></dl>");

                    sb.AppendFormat("<dl><dt>行程安排:</dt>");
                    sb.AppendFormat("<dd><div class='add_del_box'>");
                    sb.AppendFormat("<textarea id='route_1_1' name='route_1_1' style='width:700px;' rows='15'></textarea>");
                    sb.AppendFormat("</div></dd></dl>");
                    sb.AppendFormat("<dl class='hotel'><dd>");
                    sb.AppendFormat("<div class='floatL'>早餐:<input id='route_1_2' name='route_1_2' type='checkbox' /><input class='text text160' id='route_1_6' name='route_1_6' type='text' size='20' /></div>");
                    sb.AppendFormat("<div class='floatL'>中餐:<input id='route_1_3' name='route_1_3' type='checkbox' /><input class='text text160' id='route_1_7' name='route_1_7' type='text' size='20' /></div>");
                    sb.AppendFormat("<div class='floatL'>晚餐:<input id='route_1_4' name='route_1_4' type='checkbox' /><input class='text text160' id='route_1_8' name='route_1_8' type='text' size='20' /></div>");
                    sb.AppendFormat("</dd></dl>");
                    sb.AppendFormat("<dl><dt>住宿:<input type='text' class='text text160' id='route_1_5' name='route_1_5' /></dt></dl></div>");

                    routeDetails = sb.ToString();
                }
            }
            else
            {
                Function.goMessagePage("修改路线", "操作失败,数据不存在!", "Routes/RouteList.aspx");
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        /// <param name="model">Routes对象</param>
        public int Add(ClassLibrary.Model.Routes model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(string.Format("INSERT INTO {0}(", table));
            strSql.Append("routesClassID,routesPrentClassID,Title,Price,Image,StartPosition,Destination,RouteTime,TrafficModel,DescriptionRoute,DescriptionPrice," +
                          "ViewCount,LastUpdateTimeRoute,LastUpdateTimePrice,RecommendHot,CreatedTime,ThemeID,SeoKeywords,SeoDescription,RouteOrder,IsDisplay,FirstTime," +
                          "DetailType,ChildPrice,DatePrice,DateType,AdvanceDays,RouteFeature,RouteNotice,Supplier,seoTitle,Bright,BoatName,LocationID,SupplierTel,appImg");
            strSql.Append(") VALUES (");
            strSql.Append("@routesClassID,@routesPrentClassID,@Title,@Price,@Image,@StartPosition,@Destination,@RouteTime,@TrafficModel,@DescriptionRoute,@DescriptionPrice," +
                          "@ViewCount,@LastUpdateTimeRoute,@LastUpdateTimePrice,@RecommendHot,@CreatedTime,@ThemeID,@SeoKeywords,@SeoDescription,@RouteOrder,@IsDisplay,@FirstTime," +
                          "@DetailType,@ChildPrice,@DatePrice,@DateType,@AdvanceDays,@RouteFeature,@RouteNotice,@Supplier,@seoTitle,@Bright,@BoatName,@LocationID,@SupplierTel,@appImg)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@routesClassID",       SqlDbType.NVarChar,   20),
                new SqlParameter("@routesPrentClassID",  SqlDbType.NVarChar,  200),
                new SqlParameter("@Title",               SqlDbType.NVarChar,  200),
                new SqlParameter("@Price",               SqlDbType.Decimal,     9),
                new SqlParameter("@Image",               SqlDbType.NVarChar,  400),
                new SqlParameter("@StartPosition",       SqlDbType.NVarChar,   60),
                new SqlParameter("@Destination",         SqlDbType.NVarChar,   60),
                new SqlParameter("@RouteTime",           SqlDbType.NVarChar,   40),
                new SqlParameter("@TrafficModel",        SqlDbType.NVarChar,   40),
                new SqlParameter("@DescriptionRoute",    SqlDbType.NText),
                new SqlParameter("@DescriptionPrice",    SqlDbType.NText),
                new SqlParameter("@ViewCount",           SqlDbType.Int,         4),
                new SqlParameter("@LastUpdateTimeRoute", SqlDbType.DateTime,    8),
                new SqlParameter("@LastUpdateTimePrice", SqlDbType.DateTime,    8),
                new SqlParameter("@RecommendHot",        SqlDbType.Bit,         1),
                new SqlParameter("@CreatedTime",         SqlDbType.DateTime,    8),
                new SqlParameter("@ThemeID",             SqlDbType.NVarChar,   50),
                new SqlParameter("@SeoKeywords",         SqlDbType.NVarChar,  500),
                new SqlParameter("@SeoDescription",      SqlDbType.NVarChar,  500),
                new SqlParameter("@RouteOrder",          SqlDbType.Int,         9),
                new SqlParameter("@IsDisplay",           SqlDbType.Bit,         1),
                new SqlParameter("@FirstTime",           SqlDbType.NVarChar,   10),
                new SqlParameter("@DetailType",          SqlDbType.Bit,         1),
                new SqlParameter("@ChildPrice",          SqlDbType.Decimal,     9),
                new SqlParameter("@DatePrice",           SqlDbType.NVarChar, 2000),
                new SqlParameter("@DateType",            SqlDbType.Bit,         1),
                new SqlParameter("@AdvanceDays",         SqlDbType.Int,         4),
                new SqlParameter("@RouteFeature",        SqlDbType.NText),
                new SqlParameter("@RouteNotice",         SqlDbType.NText),
                new SqlParameter("@Supplier",            SqlDbType.NVarChar,   20),
                new SqlParameter("@seoTitle",            SqlDbType.NVarChar,  100),
                new SqlParameter("@Bright",              SqlDbType.NVarChar,  100),
                new SqlParameter("@BoatName",            SqlDbType.NVarChar,   10),
                new SqlParameter("@LocationID",          SqlDbType.Int,         4),
                new SqlParameter("@SupplierTel",         SqlDbType.NVarChar,   20),
                new SqlParameter("@appImg",              SqlDbType.NVarChar, 50)
            };
            parameters[0].Value  = model.routesClassID;
            parameters[1].Value  = model.routesPrentClassID;
            parameters[2].Value  = model.Title;
            parameters[3].Value  = model.Price;
            parameters[4].Value  = model.Image;
            parameters[5].Value  = model.StartPosition;
            parameters[6].Value  = model.Destination;
            parameters[7].Value  = model.RouteTime;
            parameters[8].Value  = model.TrafficModel;
            parameters[9].Value  = model.DescriptionRoute;
            parameters[10].Value = model.DescriptionPrice;
            parameters[11].Value = model.ViewCount;
            parameters[12].Value = model.LastUpdateTimeRoute;
            parameters[13].Value = model.LastUpdateTimePrice;
            parameters[14].Value = model.RecommendHot;
            parameters[15].Value = model.CreatedTime;
            parameters[16].Value = model.ThemeID;
            parameters[17].Value = model.SeoKeywords;
            parameters[18].Value = model.SeoDescription;
            parameters[19].Value = model.Order;
            parameters[20].Value = model.Display;
            parameters[21].Value = model.FirstTime;
            parameters[22].Value = model.DetailType;
            parameters[23].Value = model.ChildPrice;
            parameters[24].Value = model.DatePrice;
            parameters[25].Value = model.DateType;
            parameters[26].Value = model.AdvanceDays;
            parameters[27].Value = model.RouteFeature;
            parameters[28].Value = model.RouteNotice;
            parameters[29].Value = model.Supplier;
            parameters[30].Value = model.SeoTitle;
            parameters[31].Value = model.Bright;
            parameters[32].Value = model.BoatName;
            parameters[33].Value = model.LocationID;
            parameters[34].Value = model.SupplierTel;
            parameters[35].Value = model.AppImg;

            return(SQLHelper.Execute(strSql.ToString(), parameters));
        }
Exemplo n.º 12
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        /// <param name="ID">主键ID</param>
        /// <returns>Routes对象</returns>
        public ClassLibrary.Model.Routes GetModel(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT *");
            strSql.Append(" FROM ");
            strSql.Append(table);
            strSql.Append(string.Format(" WHERE {0}=@{0}", pk));
            SqlParameter[] parameters =
            {
                new SqlParameter("@" + pk, SqlDbType.Int, 6)
            };
            parameters[0].Value = ID;
            ClassLibrary.Model.Routes model = new ClassLibrary.Model.Routes();
            DataTable dt = SQLHelper.Query(strSql.ToString(), parameters);

            model.ID = ID;
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["routesClassID"] != DBNull.Value)
                {
                    model.routesClassID = Convert.ToString(dt.Rows[0]["routesClassID"]);
                }
                if (dt.Rows[0]["routesPrentClassID"] != DBNull.Value)
                {
                    model.routesPrentClassID = Convert.ToString(dt.Rows[0]["routesPrentClassID"]);
                }
                if (dt.Rows[0]["ThemeID"] != DBNull.Value)
                {
                    model.ThemeID = Convert.ToString(dt.Rows[0]["ThemeID"]);
                }
                if (dt.Rows[0]["Title"] != DBNull.Value)
                {
                    model.Title = Convert.ToString(dt.Rows[0]["Title"]);
                }
                if (dt.Rows[0]["Price"] != DBNull.Value)
                {
                    model.Price = Convert.ToDecimal(dt.Rows[0]["Price"]);
                }
                if (dt.Rows[0]["Image"] != DBNull.Value)
                {
                    model.Image = Convert.ToString(dt.Rows[0]["Image"]);
                }
                if (dt.Rows[0]["StartPosition"] != DBNull.Value)
                {
                    model.StartPosition = Convert.ToString(dt.Rows[0]["StartPosition"]);
                }
                if (dt.Rows[0]["Destination"] != DBNull.Value)
                {
                    model.Destination = Convert.ToString(dt.Rows[0]["Destination"]);
                }
                if (dt.Rows[0]["RouteTime"] != DBNull.Value)
                {
                    model.RouteTime = Convert.ToString(dt.Rows[0]["RouteTime"]);
                }
                if (dt.Rows[0]["TrafficModel"] != DBNull.Value)
                {
                    model.TrafficModel = Convert.ToString(dt.Rows[0]["TrafficModel"]);
                }
                if (dt.Rows[0]["DescriptionRoute"] != DBNull.Value)
                {
                    model.DescriptionRoute = Convert.ToString(dt.Rows[0]["DescriptionRoute"]);
                }
                if (dt.Rows[0]["DescriptionPrice"] != DBNull.Value)
                {
                    model.DescriptionPrice = Convert.ToString(dt.Rows[0]["DescriptionPrice"]);
                }
                if (dt.Rows[0]["ViewCount"] != DBNull.Value)
                {
                    model.ViewCount = Convert.ToInt32(dt.Rows[0]["ViewCount"]);
                }
                if (dt.Rows[0]["LastUpdateTimeRoute"] != DBNull.Value)
                {
                    model.LastUpdateTimeRoute = Convert.ToDateTime(dt.Rows[0]["LastUpdateTimeRoute"]);
                }
                if (dt.Rows[0]["LastUpdateTimePrice"] != DBNull.Value)
                {
                    model.LastUpdateTimePrice = Convert.ToDateTime(dt.Rows[0]["LastUpdateTimePrice"]);
                }
                if (dt.Rows[0]["RecommendHot"] != DBNull.Value)
                {
                    model.RecommendHot = Convert.ToBoolean(dt.Rows[0]["RecommendHot"]);
                }
                if (dt.Rows[0]["CreatedTime"] != DBNull.Value)
                {
                    model.CreatedTime = Convert.ToDateTime(dt.Rows[0]["CreatedTime"]);
                }
                if (dt.Rows[0]["SeoKeywords"] != DBNull.Value)
                {
                    model.SeoKeywords = Convert.ToString(dt.Rows[0]["SeoKeywords"]);
                }
                if (dt.Rows[0]["SeoDescription"] != DBNull.Value)
                {
                    model.SeoDescription = Convert.ToString(dt.Rows[0]["SeoDescription"]);
                }
                if (dt.Rows[0]["IsDisplay"] != DBNull.Value)
                {
                    model.Display = Convert.ToBoolean(dt.Rows[0]["IsDisplay"]);
                }
                model.FirstTime = dt.Rows[0]["FirstTime"].ToString();

                if (dt.Rows[0]["DetailType"] != DBNull.Value)
                {
                    model.DetailType = Convert.ToBoolean(dt.Rows[0]["DetailType"]);
                }
                if (dt.Rows[0]["DateType"] != DBNull.Value)
                {
                    model.DateType = Convert.ToBoolean(dt.Rows[0]["DateType"]);
                }
                if (dt.Rows[0]["DatePrice"] != DBNull.Value)
                {
                    model.DatePrice = Convert.ToString(dt.Rows[0]["DatePrice"]);
                }
                if (dt.Rows[0]["ChildPrice"] != DBNull.Value)
                {
                    model.ChildPrice = Convert.ToDecimal(dt.Rows[0]["ChildPrice"]);
                }
                if (dt.Rows[0]["AdvanceDays"] != DBNull.Value)
                {
                    model.AdvanceDays = Convert.ToInt32(dt.Rows[0]["AdvanceDays"]);
                }
                if (dt.Rows[0]["RouteFeature"] != DBNull.Value)
                {
                    model.RouteFeature = Convert.ToString(dt.Rows[0]["RouteFeature"]);
                }
                if (dt.Rows[0]["RouteNotice"] != DBNull.Value)
                {
                    model.RouteNotice = Convert.ToString(dt.Rows[0]["RouteNotice"]);
                }
                if (dt.Rows[0]["RouteOrder"] != DBNull.Value)
                {
                    model.Order = Convert.ToInt32(dt.Rows[0]["RouteOrder"]);
                }
                if (dt.Rows[0]["Supplier"] != DBNull.Value)
                {
                    model.Supplier = Convert.ToString(dt.Rows[0]["Supplier"]);
                }
                if (dt.Rows[0]["seoTitle"] != DBNull.Value)
                {
                    model.SeoTitle = Convert.ToString(dt.Rows[0]["seoTitle"]);
                }
                if (dt.Rows[0]["Bright"] != DBNull.Value)
                {
                    model.Bright = Convert.ToString(dt.Rows[0]["Bright"]);
                }
                if (dt.Rows[0]["BoatName"] != DBNull.Value)
                {
                    model.BoatName = Convert.ToString(dt.Rows[0]["BoatName"]);
                }
                if (dt.Rows[0]["LocationID"] != DBNull.Value)
                {
                    model.LocationID = Convert.ToInt32(dt.Rows[0]["LocationID"]);
                }
                if (dt.Rows[0]["SupplierTel"] != DBNull.Value)
                {
                    model.SupplierTel = Convert.ToString(dt.Rows[0]["SupplierTel"]);
                }
                if (dt.Rows[0]["appImg"] != DBNull.Value)
                {
                    model.AppImg = Convert.ToString(dt.Rows[0]["appImg"]);
                }
            }
            return(model);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        /// <param name="model">Routes对象</param>
        /// <returns>影响行数</returns>
        public int Update(ClassLibrary.Model.Routes model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(string.Format("UPDATE {0} SET ", table));
            strSql.Append("routesClassID=@routesClassID,");
            strSql.Append("routesPrentClassID=@routesPrentClassID,");
            strSql.Append("Title=@Title,");
            strSql.Append("Price=@Price,");
            strSql.Append("Image=@Image,");
            strSql.Append("StartPosition=@StartPosition,");
            strSql.Append("Destination=@Destination,");
            strSql.Append("RouteTime=@RouteTime,");
            strSql.Append("TrafficModel=@TrafficModel,");
            strSql.Append("DescriptionRoute=@DescriptionRoute,");
            strSql.Append("DescriptionPrice=@DescriptionPrice,");
            strSql.Append("ViewCount=@ViewCount,");
            strSql.Append("LastUpdateTimeRoute=@LastUpdateTimeRoute,");
            strSql.Append("LastUpdateTimePrice=@LastUpdateTimePrice,");
            strSql.Append("RecommendHot=@RecommendHot,");
            strSql.Append("CreatedTime=@CreatedTime,");
            strSql.Append("ThemeID=@ThemeID,");
            strSql.Append("SeoKeywords=@SeoKeywords,");
            strSql.Append("SeoDescription=@SeoDescription,");
            strSql.Append("RouteOrder=@RouteOrder,");
            strSql.Append("IsDisplay=@IsDisplay,");;
            strSql.Append("DetailType=@DetailType,");
            strSql.Append("ChildPrice=@ChildPrice,");
            strSql.Append("DatePrice=@DatePrice,");
            strSql.Append("DateType=@DateType,");
            strSql.Append("AdvanceDays=@AdvanceDays,");
            strSql.Append("RouteFeature=@RouteFeature,");
            strSql.Append("RouteNotice=@RouteNotice,");
            strSql.Append("Supplier=@Supplier,");
            strSql.Append("seoTitle=@seoTitle,");
            strSql.Append("Bright=@Bright,");
            strSql.Append("BoatName=@BoatName,");
            strSql.Append("LocationID=@LocationID,");
            strSql.Append("SupplierTel=@SupplierTel,");
            strSql.Append("appImg=@appImg ");
            strSql.Append(" WHERE ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID",                  SqlDbType.Int,         6),
                new SqlParameter("@routesClassID",       SqlDbType.NVarChar,   20),
                new SqlParameter("@routesPrentClassID",  SqlDbType.NVarChar,  200),
                new SqlParameter("@Title",               SqlDbType.NVarChar,  200),
                new SqlParameter("@Price",               SqlDbType.Decimal,     9),
                new SqlParameter("@Image",               SqlDbType.NVarChar,  400),
                new SqlParameter("@StartPosition",       SqlDbType.NVarChar,   60),
                new SqlParameter("@Destination",         SqlDbType.NVarChar,   60),
                new SqlParameter("@RouteTime",           SqlDbType.NVarChar,   40),
                new SqlParameter("@TrafficModel",        SqlDbType.NVarChar,   40),
                new SqlParameter("@DescriptionRoute",    SqlDbType.NText),
                new SqlParameter("@DescriptionPrice",    SqlDbType.NText),
                new SqlParameter("@ViewCount",           SqlDbType.Int,         6),
                new SqlParameter("@LastUpdateTimeRoute", SqlDbType.DateTime,    8),
                new SqlParameter("@LastUpdateTimePrice", SqlDbType.DateTime,    8),
                new SqlParameter("@RecommendHot",        SqlDbType.Bit,         1),
                new SqlParameter("@CreatedTime",         SqlDbType.DateTime,    8),
                new SqlParameter("@ThemeID",             SqlDbType.NVarChar,   50),
                new SqlParameter("@SeoKeywords",         SqlDbType.NVarChar,  500),
                new SqlParameter("@SeoDescription",      SqlDbType.NVarChar,  500),
                new SqlParameter("@RouteOrder",          SqlDbType.Int,         9),
                new SqlParameter("@IsDisplay",           SqlDbType.Bit,         1),
                new SqlParameter("@DetailType",          SqlDbType.Bit,         1),
                new SqlParameter("@ChildPrice",          SqlDbType.Decimal,     9),
                new SqlParameter("@DatePrice",           SqlDbType.NVarChar, 2000),
                new SqlParameter("@DateType",            SqlDbType.Bit,         1),
                new SqlParameter("@AdvanceDays",         SqlDbType.Int,         4),
                new SqlParameter("@RouteFeature",        SqlDbType.NText),
                new SqlParameter("@RouteNotice",         SqlDbType.NText),
                new SqlParameter("@Supplier",            SqlDbType.NVarChar,   20),
                new SqlParameter("@seoTitle",            SqlDbType.NVarChar,  100),
                new SqlParameter("@Bright",              SqlDbType.NVarChar,  100),
                new SqlParameter("@BoatName",            SqlDbType.NVarChar,   10),
                new SqlParameter("@LocationID",          SqlDbType.Int,         4),
                new SqlParameter("@SupplierTel",         SqlDbType.NVarChar,   20),
                new SqlParameter("@appImg",              SqlDbType.NVarChar, 50)
            };
            parameters[0].Value  = model.ID;
            parameters[1].Value  = model.routesClassID;
            parameters[2].Value  = model.routesPrentClassID;
            parameters[3].Value  = model.Title;
            parameters[4].Value  = model.Price;
            parameters[5].Value  = model.Image;
            parameters[6].Value  = model.StartPosition;
            parameters[7].Value  = model.Destination;
            parameters[8].Value  = model.RouteTime;
            parameters[9].Value  = model.TrafficModel;
            parameters[10].Value = model.DescriptionRoute;
            parameters[11].Value = model.DescriptionPrice;
            parameters[12].Value = model.ViewCount;
            parameters[13].Value = model.LastUpdateTimeRoute;
            parameters[14].Value = model.LastUpdateTimePrice;
            parameters[15].Value = model.RecommendHot;
            parameters[16].Value = model.CreatedTime;
            parameters[17].Value = model.ThemeID;
            parameters[18].Value = model.SeoKeywords;
            parameters[19].Value = model.SeoDescription;
            parameters[20].Value = model.Order;
            parameters[21].Value = model.Display;
            parameters[22].Value = model.DetailType;
            parameters[23].Value = model.ChildPrice;
            parameters[24].Value = model.DatePrice;
            parameters[25].Value = model.DateType;
            parameters[26].Value = model.AdvanceDays;
            parameters[27].Value = model.RouteFeature;
            parameters[28].Value = model.RouteNotice;
            parameters[29].Value = model.Supplier;
            parameters[30].Value = model.SeoTitle;
            parameters[31].Value = model.Bright;
            parameters[32].Value = model.BoatName;
            parameters[33].Value = model.LocationID;
            parameters[34].Value = model.SupplierTel;
            parameters[35].Value = model.AppImg;
            return(SQLHelper.Execute(strSql.ToString(), parameters));
        }