/// <summary> /// init jingdian /// </summary> void InitJingDian() { var searchInfo = new EyouSoft.Model.SupplierStructure.SupplierQuery(); searchInfo.ProvinceId = Utils.GetInt(Utils.GetQueryStringValue("provinceid")); searchInfo.CityId = Utils.GetInt(Utils.GetQueryStringValue("cityid")); searchInfo.UnitName = Utils.GetQueryStringValue("name"); var items = new EyouSoft.BLL.SupplierStructure.SupplierSpot().GetList(pageSize, pageIndex, ref recordCount, Master.CompanyId, searchInfo); if (items != null && items.Count > 0) { rpt.DataSource = items; rpt.DataBind(); divPaging.Visible = true; divEmpty.Visible = false; paging.PageLinkURL = Request.ServerVariables["SCRIPT_NAME"].ToString() + "?"; paging.UrlParams.Add(Request.QueryString); paging.intPageSize = pageSize; paging.CurrencyPage = pageIndex; paging.intRecordCount = recordCount; } else { divPaging.Visible = false; divEmpty.Visible = true; } }
/// <summary> /// 组团景点列表 /// </summary> protected void BindSpotList() { //景点业务逻辑层 EyouSoft.Model.SupplierStructure.SupplierQuery sightSearchInfo = new EyouSoft.Model.SupplierStructure.SupplierQuery(); //省份 sightSearchInfo.ProvinceId = Utils.GetInt(Utils.GetQueryStringValue("ProvinceId")); //城市 sightSearchInfo.CityId = Utils.GetInt(Utils.GetQueryStringValue("Cityid")); //景点名称 sightSearchInfo.UnitName = Utils.GetQueryStringValue("SoptName"); IList <EyouSoft.Model.SupplierStructure.SupplierSpot> spotlist = new EyouSoft.BLL.SupplierStructure.SupplierSpot().GetList(pageSize, pageIndex, ref recordCount, companyId, sightSearchInfo); if (spotlist != null && spotlist.Count > 0) { //显示分页控件 this.ExporPageInfoSelect1.Visible = true; //绑定数据源 this.rptTourList.DataSource = spotlist; this.rptTourList.DataBind(); BindPage(); //隐藏无数据提示控件 this.lblMsg.Visible = false; } else { //隐藏分页控件 this.ExporPageInfoSelect1.Visible = false; this.lblMsg.Text = "未找到相关景点信息!"; //显示无数据提示控件 this.lblMsg.Visible = true; } //初始化查询条件 SearchBind(sightSearchInfo, companyId); }
/// <summary> /// 获取景点图片 /// </summary> /// <param name="id">供应商编号</param> /// <returns>景点第一张图片</returns> protected string GetSinglePic(int id) { EyouSoft.Model.SupplierStructure.SupplierSpot spotmodel = new EyouSoft.BLL.SupplierStructure.SupplierSpot().GetModel(id); IList <EyouSoft.Model.SupplierStructure.SupplierPic> pic = spotmodel.SupplierPic; if (pic != null && pic.Count > 0) { for (int i = 0; i < pic.Count; i++) { if (pic[0].PicPath == "") { StrSinglePic = "暂无图片"; } else { StrSinglePic = "<img src=\"" + pic[0].PicPath + "\" alt=\"\" width=\"60px\" height=\"50px\" border=\"0\" />"; } } } else { StrSinglePic = "暂无图片"; } return(StrSinglePic); }
//导入方法 private void loadXls() { //取得数据源 string data = Utils.GetFormValue("dataxls"); //分割数据 string[] s = data.Split(';'); EyouSoft.BLL.SupplierStructure.SupplierSpot sightBll = new EyouSoft.BLL.SupplierStructure.SupplierSpot(); IList <EyouSoft.Model.SupplierStructure.SupplierSpot> list = new List <EyouSoft.Model.SupplierStructure.SupplierSpot>(); for (int i = 0; i < s.Length; i++) { string[] smodel = s[i].Split(','); if (smodel.Length == 16 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2])) { EyouSoft.Model.SupplierStructure.SupplierSpot sight = new EyouSoft.Model.SupplierStructure.SupplierSpot(); IList <EyouSoft.Model.CompanyStructure.SupplierContact> contacts = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); EyouSoft.Model.CompanyStructure.SupplierContact contact = new EyouSoft.Model.CompanyStructure.SupplierContact(); sight.ProvinceName = HttpUtility.UrlDecode(smodel[0]); sight.CityName = HttpUtility.UrlDecode(smodel[1]); sight.UnitName = HttpUtility.UrlDecode(smodel[2]); sight.Start = (EyouSoft.Model.EnumType.SupplierStructure.ScenicSpotStar)ChangeStar(HttpUtility.UrlDecode(smodel[3])); sight.UnitAddress = HttpUtility.UrlDecode(smodel[4]); sight.TourGuide = HttpUtility.UrlDecode(smodel[5]); contact.ContactName = HttpUtility.UrlDecode(smodel[6]); contact.JobTitle = HttpUtility.UrlDecode(smodel[7]); contact.ContactTel = HttpUtility.UrlDecode(smodel[8]); contact.ContactMobile = HttpUtility.UrlDecode(smodel[9]); contact.QQ = HttpUtility.UrlDecode(smodel[10]); contact.Email = HttpUtility.UrlDecode(smodel[11]); sight.TravelerPrice = Utils.GetDecimal(HttpUtility.UrlDecode(smodel[12])); sight.TeamPrice = Utils.GetDecimal(HttpUtility.UrlDecode(smodel[13])); sight.UnitPolicy = HttpUtility.UrlDecode(smodel[14]); sight.Remark = HttpUtility.UrlDecode(smodel[15]); sight.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.景点; sight.CompanyId = SiteUserInfo.CompanyID; if (contact.ContactMobile != "" && contact.ContactName != "") { contacts.Add(contact); } sight.SupplierContact = contacts; list.Add(sight); } } bool res = false; res = sightBll.Add(list); Response.Clear(); Response.Write(string.Format("{{\"res\":{0}}}", res ? 1 : -1)); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //供应商景点实体类 EyouSoft.Model.SupplierStructure.SupplierSpot Spot = null; //获取供应商id string id = EyouSoft.Common.Utils.GetQueryStringValue("Supplierid"); if (id != "" && !string.IsNullOrEmpty(id)) { //根据供应商编号获取景点实体 Spot = new EyouSoft.BLL.SupplierStructure.SupplierSpot().GetModel(EyouSoft.Common.Utils.GetInt(id)); if (Spot != null) { //景点名称 this.litSpotName.Text = Spot.UnitName; //地址 this.litAddress.Text = Spot.UnitAddress; //所在城市 this.LitProc.Text = Spot.ProvinceName; this.LitCity.Text = Spot.CityName; //景点图片 IList <EyouSoft.Model.SupplierStructure.SupplierPic> piclist = Spot.SupplierPic; if (piclist != null && piclist.Count > 0) { this.RepPicList.DataSource = piclist; this.RepPicList.DataBind(); } else { this.RepPicList.Visible = false; this.litmsg.Text = "暂无景点图片"; } //景点介绍 this.litTourGuide.Text = Spot.TourGuide; //散客价 this.litTravelerPrice.Text = Spot.TravelerPrice.ToString("0.00"); //团队价 this.litTeamprices.Text = Spot.TeamPrice.ToString("0.00"); piclist = null; } Spot = null; } } }
/// <summary> /// init jingdian mingxi /// </summary> void InitMingXi() { int id = Utils.GetInt(Utils.GetQueryStringValue("id")); var info = new EyouSoft.BLL.SupplierStructure.SupplierSpot().GetModel(id); EyouSoft.Model.SysStructure.SystemDomain domain = new EyouSoft.BLL.SysStructure.SystemDomain().GetDomain(Request.Url.Host.ToLower()); if (domain == null || info == null || info.CompanyId != domain.CompanyId) { Response.Clear(); Response.Write("请求异常。"); Response.End(); } if (info != null) { this.litSpotName.Text = info.UnitName; this.litAddress.Text = info.UnitAddress; this.LitProc.Text = info.ProvinceName; this.LitCity.Text = info.CityName; this.litTourGuide.Text = info.TourGuide; this.litTravelerPrice.Text = info.TravelerPrice.ToString("0.00"); this.litTeamprices.Text = info.TeamPrice.ToString("0.00"); if (info.SupplierPic != null && info.SupplierPic.Count > 0) { this.rpt.DataSource = info.SupplierPic; this.rpt.DataBind(); } else { this.rpt.Visible = false; this.litmsg.Text = "暂无景点图片"; } } }