Exemplo n.º 1
0
        /// <summary>
        /// 关联交通
        /// </summary>
        /// <param name="selTrafficId">选择的交通编号</param>
        /// <returns></returns>
        protected string GetSelectTraffic(int selTrafficId)
        {
            EyouSoft.BLL.PlanStruture.PlanTrffic       BLL         = new EyouSoft.BLL.PlanStruture.PlanTrffic();
            EyouSoft.Model.PlanStructure.TrafficSearch searchmodel = new EyouSoft.Model.PlanStructure.TrafficSearch();
            searchmodel.TourId = Utils.GetQueryStringValue("tourId");
            IList <EyouSoft.Model.PlanStructure.TrafficInfo> list = BLL.GetTrafficList(searchmodel, SiteUserInfo.CompanyID);
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("<option value='' data-price='' data-shengyu='0'>请选择</option>");
            if (list != null && list.Count > 0)
            {
                foreach (var item in list)
                {
                    if (item.TrafficId == selTrafficId)
                    {
                        sb.AppendFormat("<option value='{0}' selected='selected' data-price='' data-shengyu='0'>{1}</option>", item.TrafficId, item.TrafficName);
                    }
                    else
                    {
                        sb.AppendFormat("<option value='{0}' data-price='' data-shengyu='0'>{1}</option>", item.TrafficId, item.TrafficName);
                    }
                }
            }
            return(sb.ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取关联交通
        /// </summary>
        /// <returns></returns>
        protected string GetTrafficList(int selected)
        {
            EyouSoft.BLL.PlanStruture.PlanTrffic     BLL         = new EyouSoft.BLL.PlanStruture.PlanTrffic(SiteUserInfo);
            EyouSoft.Model.PlanStructure.TrafficInfo SearchModel = new EyouSoft.Model.PlanStructure.TrafficInfo();
            //SearchModel.IsDelete = false;
            IList <EyouSoft.Model.PlanStructure.TrafficInfo> list = BLL.GetTrafficList(null, SiteUserInfo.CompanyID);
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("<option value='' data-price='' data-shengyu='0'>请选择</option>");
            if (list != null && list.Count > 0)
            {
                foreach (var item in list)
                {
                    if (item.TrafficId == selected)
                    {
                        sb.AppendFormat("<option value='{0}' selected='selected' data-price='' data-shengyu='0'>{1}</option>", item.TrafficId, item.TrafficName);
                    }
                    else
                    {
                        sb.AppendFormat("<option value='{0}' data-price='' data-shengyu='0'>{1}</option>", item.TrafficId, item.TrafficName);
                    }
                }
            }
            return(sb.ToString());
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取关联交通
        /// </summary>
        /// <returns></returns>
        protected string GetTrafficList(IList <int> selectList)
        {
            EyouSoft.BLL.PlanStruture.PlanTrffic     BLL         = new EyouSoft.BLL.PlanStruture.PlanTrffic(SiteUserInfo);
            EyouSoft.Model.PlanStructure.TrafficInfo SearchModel = new EyouSoft.Model.PlanStructure.TrafficInfo();
            //SearchModel.IsDelete = false;
            IList <EyouSoft.Model.PlanStructure.TrafficInfo> list = BLL.GetTrafficList(null, SiteUserInfo.CompanyID);
            StringBuilder sb = new StringBuilder();

            if (list != null && list.Count > 0)
            {
                foreach (var item in list)
                {
                    if (selectList != null && selectList.Count > 0)
                    {
                        if (selectList.Contains(item.TrafficId))
                        {
                            sb.AppendFormat("<li><a href=\"javascript:void(0);\" data-trafficId='{0}' class=\"select\"><span>", item.TrafficId);
                        }
                        else
                        {
                            sb.AppendFormat("<li><a href=\"javascript:void(0);\" data-trafficId='{0}'><span>", item.TrafficId);
                        }
                    }
                    else
                    {
                        sb.AppendFormat("<li><a href=\"javascript:void(0);\" data-trafficId='{0}'><span>", item.TrafficId);
                    }
                    if (item.travelList != null && item.travelList.Count > 0)
                    {
                        for (int i = 0; i < item.travelList.Count; i++)
                        {
                            if (i != item.travelList.Count - 1)
                            {
                                sb.AppendFormat("[{0}、{1}]-", item.travelList[i].LCityName, item.travelList[i].RCityName);
                            }
                            else
                            {
                                sb.AppendFormat("[{0}、{1}]", item.travelList[i].LCityName, item.travelList[i].RCityName);
                            }
                        }
                        sb.Append("<br/>[");
                        for (int i = 0; i < item.travelList.Count; i++)
                        {
                            sb.AppendFormat("{0}", i != item.travelList.Count - 1 ? item.travelList[i].FilghtNum + "/" : item.travelList[i].FilghtNum);
                        }
                        sb.Append("]");
                    }
                    else
                    {
                        sb.AppendFormat("{0}<br/>&nbsp;&nbsp", item.TrafficName);
                    }
                    sb.Append("</span></a></li>");
                }
            }
            return(sb.ToString());
        }