protected void SearchBind(EyouSoft.Model.SupplierStructure.SupplierQuery SearchModel, int Companyid) { if (SearchModel != null) { //省份下拉框 this.ddlPro.SelectedValue = Convert.ToString(SearchModel.ProvinceId); EyouSoft.BLL.CompanyStructure.City cityBll = new EyouSoft.BLL.CompanyStructure.City(); if (ddlPro.SelectedValue != "0") { IList <EyouSoft.Model.CompanyStructure.City> list = cityBll.GetList(companyId, (int?)Convert.ToInt32(SearchModel.ProvinceId), null); if (list != null && list.Count > 0) { for (int i = 0; i < list.Count; i++) { ListItem item = new ListItem(); item.Text = list[i].CityName; item.Value = Convert.ToString(list[i].Id); this.ddlCity.Items.Add(item); } } } //城市下拉框 this.ddlCity.SelectedValue = Convert.ToString(SearchModel.CityId); //景点名称 this.SpotName.Text = SearchModel.UnitName; } }
/// <summary> /// 初使化 /// </summary> private void DataInit() { //初使化条件 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); province = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("province")); city = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("city")); unionName = Utils.GetQueryStringValue("unionName"); IList <EyouSoft.Model.SupplierStructure.SupplierShopping> list = null; //获取查询条件 EyouSoft.Model.SupplierStructure.SupplierQuery queryModel = new EyouSoft.Model.SupplierStructure.SupplierQuery(); queryModel.UnitName = unionName; queryModel.ProvinceId = province; queryModel.CityId = city; list = csBLL.GetList(pageSize, pageIndex, ref recordCount, CurrentUserCompanyID, EyouSoft.Model.EnumType.CompanyStructure.SupplierType.购物, queryModel); if (!(list == null)) { len = list.Count; this.rptList.DataSource = list; this.rptList.DataBind(); list = null; } //设置分页 BindPage(); this.ucProvince1.ProvinceId = province; this.ucCity1.CityId = city; this.ucCity1.ProvinceId = province; }
/// <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); }
protected void DataInit() { EyouSoft.Model.SupplierStructure.SupplierQuery search = new EyouSoft.Model.SupplierStructure.SupplierQuery(); //初使化条件 PageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); TxtUnitsName = Utils.GetQueryStringValue("UnitsName"); //查询单位名称 search.UnitName = TxtUnitsName; IList <EyouSoft.Model.SupplierStructure.SupplierInsurance> list = null; list = Insurancebll.GetList(PageSize, PageIndex, ref RecordCount, SiteUserInfo.CompanyID, search); if (list.Count > 0 && list != null) { //列表统计 len = list.Count; //列表数据绑定 this.replist.DataSource = list; this.replist.DataBind(); //设置分页 BindPage(); } else { this.ExporPageInfoSelect1.Visible = false; } list = null; }
protected void PageInit() { EyouSoft.Model.SupplierStructure.SupplierQuery sightSearchInfo = new EyouSoft.Model.SupplierStructure.SupplierQuery(); IList <EyouSoft.Model.SupplierStructure.SupplierSpot> sights = new List <EyouSoft.Model.SupplierStructure.SupplierSpot>(); #region 控件赋值 string sight_name = Server.UrlDecode(Utils.GetQueryStringValue("sight_name")); int cityId = Utils.GetInt(Utils.GetQueryStringValue("cityId")); int provinceId = Utils.GetInt(Utils.GetQueryStringValue("proid")); this.ucProvince1.ProvinceId = provinceId; this.ucCity1.ProvinceId = provinceId; this.ucCity1.CityId = cityId; this.sight_name.Value = sight_name; #endregion #region 设置景点的查询条件值 sightSearchInfo.CityId = cityId; sightSearchInfo.ProvinceId = provinceId; sightSearchInfo.UnitName = sight_name; #endregion sights = sightBll.GetList(pageSize, pageIndex, ref recordCount, SiteUserInfo.CompanyID, sightSearchInfo); this.rptList.DataSource = sights; this.rptList.DataBind(); BindExportPage(); //绑定分页控件 }
/// <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> /// <param name="TopNum">top条数</param> /// <param name="CompanyId">所属公司编号</param> /// <param name="query">供应商查询实体</param> /// <returns></returns> public IList <EyouSoft.Model.SupplierStructure.SupplierSpot> GetList(int TopNum, int CompanyId , EyouSoft.Model.SupplierStructure.SupplierQuery query) { if (CompanyId <= 0) { return(null); } return(Dal.GetList(TopNum, CompanyId, query)); }
///// <summary> ///// 导出Excel(全字段导出版) ///// </summary> //public void CreateExcel(string FileName) //{ // int province = this.ucProvince1.ProvinceId; // int city = this.ucCity1.CityId; // IList<EyouSoft.Model.SupplierStructure.SupplierSpot> list = null; // EyouSoft.Model.SupplierStructure.SupplierQuery searchInfo = new EyouSoft.Model.SupplierStructure.SupplierQuery(); // searchInfo.UnitName = this.sight_name.Value; // searchInfo.CityId = city; // searchInfo.ProvinceId = province; // list = sightBll.GetList(1, 1, ref recordCount, SiteUserInfo.CompanyID, searchInfo); // if (recordCount > 0) // { // list = sightBll.GetList(recordCount, 1, ref recordCount, SiteUserInfo.CompanyID, searchInfo); // } // Response.Clear(); // Response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName + ".xls"); // Response.ContentEncoding = System.Text.Encoding.Default; // Response.ContentType = "application/ms-excel"; // //取得数据表各列标题,各标题之间以\t分割,最后一个列标题后加回车符 // StringBuilder sb = new StringBuilder(); // sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{11}\t{12}\t{13}\t{14}\t{15}\n", "省份", "城市", "景点名称", "星级", "地址", "导游词", "联系人姓名", "联系人职务", "联系人电话", "联系人手机", "联系人QQ", "联系人-Email", "散客价", "团队价", "政策", "备注"); // foreach (EyouSoft.Model.SupplierStructure.SupplierSpot sight in list) // { // sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{11}\t{12}\t{13}\t{14}\t{15}\n", // sight.ProvinceName, // sight.CityName, // sight.UnitName, // sight.Start, // sight.UnitAddress, // sight.TourGuide, // sight.SupplierContact.Count == 0 ? "" : sight.SupplierContact[0].ContactName, // sight.SupplierContact.Count == 0 ? "" : sight.SupplierContact[0].JobTitle, // sight.SupplierContact.Count == 0 ? "" : sight.SupplierContact[0].ContactTel, // sight.SupplierContact.Count == 0 ? "" : sight.SupplierContact[0].ContactMobile, // sight.SupplierContact.Count == 0 ? "" : sight.SupplierContact[0].QQ, // sight.SupplierContact.Count == 0 ? "" : sight.SupplierContact[0].Email, // sight.SupplierContact.Count == 0 ? "" : sight.SupplierContact[0].ContactFax, // sight.TravelerPrice, // sight.TeamPrice, // sight.UnitPolicy, // sight.Remark); // } // Response.Write(sb.ToString()); // Response.End(); //} /// <summary> /// 导出Excel /// </summary> public void CreateExcel(string FileName) { int province = this.ucProvince1.ProvinceId; int city = this.ucCity1.CityId; IList <EyouSoft.Model.SupplierStructure.SupplierSpot> list = null; EyouSoft.Model.SupplierStructure.SupplierQuery searchInfo = new EyouSoft.Model.SupplierStructure.SupplierQuery(); searchInfo.UnitName = this.sight_name.Value; searchInfo.CityId = city; searchInfo.ProvinceId = province; //用gerList方法取得总记录的条数 list = sightBll.GetList(1, 1, ref recordCount, SiteUserInfo.CompanyID, searchInfo); if (recordCount > 0) { //用上面list取得的记录条数作为每页显示条数的参数来取得相应的数据 list = sightBll.GetList(recordCount, 1, ref recordCount, SiteUserInfo.CompanyID, searchInfo); } Response.Clear(); Response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName + ".xls"); Response.ContentEncoding = System.Text.Encoding.Default; Response.ContentType = "application/ms-excel"; //取得数据表各列标题,各标题之间以\t分割,最后一个列标题后加回车符 StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\n", "所在地", "景点名称", "星级", "散客价", "团队价", "联系人", "手机", "传真", "政策", "交易次数"); foreach (EyouSoft.Model.SupplierStructure.SupplierSpot sight in list) { sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\n", sight.ProvinceName + "_" + sight.CityName, sight.UnitName, sight.Start, sight.TravelerPrice, sight.TeamPrice, sight.SupplierContact.Count == 0 ? "" : sight.SupplierContact[0].ContactName, sight.SupplierContact.Count == 0 ? "" : sight.SupplierContact[0].ContactMobile, sight.SupplierContact.Count == 0 ? "" : sight.SupplierContact[0].ContactFax, sight.UnitPolicy, sight.TradeNum); } Response.Write(sb.ToString()); Response.End(); }
/// <summary> /// 导出Excel /// </summary> public void CreateExcel(string FileName) { TxtUnitsName = Utils.GetQueryStringValue("UnitsName"); //列表数据绑定 Response.Clear(); Response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName + ".xls"); Response.ContentEncoding = System.Text.Encoding.Default; Response.ContentType = "application/ms-excel"; //取得数据表各列标题,各标题之间以\t分割,最后一个列标题后加回车符 System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\n", "所在地", "单位名称", "联系人", "电话", "传真", "交易情况"); //查询实体 EyouSoft.Model.SupplierStructure.SupplierQuery search = new EyouSoft.Model.SupplierStructure.SupplierQuery(); //查询单位名称 search.UnitName = TxtUnitsName; int tmpLen = Utils.GetInt(Utils.GetFormValue("hidLen")); if (tmpLen <= 0) { tmpLen = 100; } //保险集合 IList <EyouSoft.Model.SupplierStructure.SupplierInsurance> list = null; list = Insurancebll.GetList(tmpLen, 1, ref RecordCount, SiteUserInfo.CompanyID, search); foreach (EyouSoft.Model.SupplierStructure.SupplierInsurance sl in list) { sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\n", sl.ProvinceName + "" + sl.CityName, sl.UnitName, sl.SupplierContact == null ? "" : sl.SupplierContact[0].ContactName, sl.SupplierContact == null ? "" : sl.SupplierContact[0].ContactTel, sl.SupplierContact == null ? "" : sl.SupplierContact[0].ContactFax, sl.TradeNum); } Response.Write(sb.ToString()); Response.End(); list = null; }
/// <summary> /// 导出Excel /// </summary> /// <param name="FileName"></param> private void CreateExcel(string FileName) { province = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("province")); city = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("city")); unionName = EyouSoft.Common.Utils.GetQueryStringValue("unionName"); IList <EyouSoft.Model.SupplierStructure.SupplierShopping> list = null; EyouSoft.Model.SupplierStructure.SupplierQuery queryModel = new EyouSoft.Model.SupplierStructure.SupplierQuery(); list = csBLL.GetList(1, 1, ref recordCount, CurrentUserCompanyID, EyouSoft.Model.EnumType.CompanyStructure.SupplierType.购物, queryModel); if (recordCount != 0) { list = csBLL.GetList(recordCount, 1, ref recordCount, CurrentUserCompanyID, EyouSoft.Model.EnumType.CompanyStructure.SupplierType.购物, queryModel); } Response.Clear(); Response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName + ".xls"); Response.ContentEncoding = System.Text.Encoding.Default; Response.ContentType = "application/ms-excel"; //取得数据表各列标题,各标题之间以\t分割,最后一个列标题后加回车符 StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n", "所在地", "单位名称", "销售产品", "联系人", "电话", "传真", "交易情况"); foreach (EyouSoft.Model.SupplierStructure.SupplierShopping ss in list) { sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n", ss.ProvinceName + " " + ss.CityName, ss.UnitName, ss.SaleProduct, ss.SupplierContact == null ? "" : ss.SupplierContact[0].ContactName, ss.SupplierContact == null ? "" : ss.SupplierContact[0].ContactTel, ss.SupplierContact == null ? "" : ss.SupplierContact[0].ContactFax, ss.TradeNum); } Response.Write(sb.ToString()); Response.End(); }
/// <summary> /// 查询供应商基本信息 /// </summary> /// <param name="CompanyId">专线Id</param> /// <param name="SeachModel">供应商查询实体</param> /// <param name="PageSize">每页条数</param> /// <param name="PageIndex">当前页数</param> /// <param name="RecordCount">总记录数</param> /// <returns></returns> public IList <EyouSoft.Model.CompanyStructure.SupplierBasic> GetSupplierBaseList(int CompanyId , EyouSoft.Model.SupplierStructure.SupplierQuery SeachModel, int PageSize, int PageIndex, ref int RecordCount) { return(dal.GetSupplierBaseList(CompanyId, SeachModel, PageSize, PageIndex, ref RecordCount)); }
/// <summary> /// 分页获取供应商景点信息列表 /// </summary> /// <param name="PageSize">每页显示条数</param> /// <param name="PageIndex">当前页码</param> /// <param name="RecordCount">总记录数</param> /// <param name="CompanyId">所属公司编号</param> /// <param name="query">景点查询实体</param> /// <returns>景点信息列表</returns> public IList <EyouSoft.Model.SupplierStructure.SupplierSpot> GetList(int PageSize, int PageIndex, ref int RecordCount, int CompanyId, EyouSoft.Model.SupplierStructure.SupplierQuery query) { IList <EyouSoft.Model.SupplierStructure.SupplierSpot> list = new List <EyouSoft.Model.SupplierStructure.SupplierSpot>(); string tableName = "tbl_CompanySupplier"; StringBuilder fields = new StringBuilder(); fields.Append(" Id,UnitAddress,UnitName,ProvinceName,CityName,TradeNum,UnitPolicy"); fields.Append(" ,(select top 1 ContactName,ContactTel,ContactFax from tbl_SupplierContact a where a.SupplierId = tbl_CompanySupplier.[Id] for xml raw,root('root')) as ContactXML "); fields.AppendFormat(",(select [Star],[TourGuide],[TeamPrice],[TravelerPrice] from [tbl_SupplierSpot] where tbl_SupplierSpot.[SupplierId]=tbl_CompanySupplier.Id for xml raw,root('root')) as SpotInfo"); string primaryKey = "Id"; string orderbyStr = "IssueTime desc"; StringBuilder strWhere = new StringBuilder(" IsDelete='0' "); strWhere.AppendFormat(" and SupplierType={0}", (int)EyouSoft.Model.EnumType.CompanyStructure.SupplierType.景点); strWhere.AppendFormat(" and CompanyId = {0}", CompanyId); if (query != null) { if (query.ProvinceId > 0) { strWhere.AppendFormat(" and ProvinceId={0} ", query.ProvinceId); } if (!string.IsNullOrEmpty(query.ProvinceName)) { strWhere.AppendFormat(" and ProvinceName like'%{0}%' ", query.ProvinceName); } if (query.CityId > 0) { strWhere.AppendFormat(" and CityId={0} ", query.CityId); } if (!string.IsNullOrEmpty(query.CityName)) { strWhere.AppendFormat(" and CityName like'%{0}%' ", query.CityName); } if (!string.IsNullOrEmpty(query.UnitName)) { strWhere.AppendFormat(" and UnitName like'%{0}%' ", query.UnitName); } } using (IDataReader dr = DbHelper.ExecuteReader(this._db, PageSize, PageIndex, ref RecordCount, tableName, primaryKey, fields.ToString(), strWhere.ToString(), orderbyStr)) { while (dr.Read()) { EyouSoft.Model.SupplierStructure.SupplierSpot model = new EyouSoft.Model.SupplierStructure.SupplierSpot(); model.Id = dr.GetInt32(dr.GetOrdinal("Id")); model.UnitAddress = dr.IsDBNull(dr.GetOrdinal("UnitAddress")) ? "" : dr.GetOrdinal("UnitAddress").ToString(); model.UnitName = dr.GetString(dr.GetOrdinal("UnitName")); model.ProvinceName = dr.IsDBNull(dr.GetOrdinal("ProvinceName")) ? "" : dr.GetString(dr.GetOrdinal("ProvinceName")); model.CityName = dr.IsDBNull(dr.GetOrdinal("CityName")) ? "" : dr.GetString(dr.GetOrdinal("CityName")); model.TradeNum = dr.GetInt32(dr.GetOrdinal("TradeNum")); if (!dr.IsDBNull(dr.GetOrdinal("UnitPolicy"))) { model.UnitPolicy = dr.GetString(dr.GetOrdinal("UnitPolicy")); } model.SupplierContact = GetContactList(dr.IsDBNull(dr.GetOrdinal("ContactXML")) ? "" : dr.GetString(dr.GetOrdinal("ContactXML"))); if (!dr.IsDBNull(dr.GetOrdinal("SpotInfo"))) { XElement xRoot = XElement.Parse(dr.GetString(dr.GetOrdinal("SpotInfo"))); if (xRoot != null) { var xRows = Utils.GetXElements(xRoot, "row"); if (xRows != null && xRows.Count() > 0) { foreach (var t in xRows) { model.Start = (EyouSoft.Model.EnumType.SupplierStructure.ScenicSpotStar)Utils.GetInt(Utils.GetXAttributeValue(t, "Star")); model.TourGuide = Utils.GetXAttributeValue(t, "TourGuide"); model.TeamPrice = Utils.GetDecimal(Utils.GetXAttributeValue(t, "TeamPrice")); model.TravelerPrice = Utils.GetDecimal(Utils.GetXAttributeValue(t, "TravelerPrice")); break; } } } } list.Add(model); model = null; } } return(list); }
/// <summary> /// 分页获取供应商购物信息 /// </summary> /// <param name="pageSize">每页数</param> /// <param name="pageIndex">起始页</param> /// <param name="recordCount">总数</param> /// <param name="supplierType">供应商类型</param> /// <param name="queryModel">查询实体</param> public IList <EyouSoft.Model.SupplierStructure.SupplierShopping> GetList(int pageSize, int pageIndex, ref int recordCount, int companyId, EyouSoft.Model.EnumType.CompanyStructure.SupplierType supplierType, EyouSoft.Model.SupplierStructure.SupplierQuery queryModel) { IList <EyouSoft.Model.SupplierStructure.SupplierShopping> ls = new List <EyouSoft.Model.SupplierStructure.SupplierShopping>(); string tableName = "tbl_CompanySupplier"; StringBuilder fields = new StringBuilder(); fields.Append(" Id,UnitAddress,ProvinceName,CityName,"); fields.Append(" (select top 1 ContactName,ContactTel,ContactFax from tbl_SupplierContact a where a.SupplierId = tbl_CompanySupplier.[Id] for xml raw,root('root')) as ContactXML,"); fields.Append(" (select top 1 SaleProduct from tbl_SupplierShopping b where b.Id = tbl_CompanySupplier.[Id] for xml raw,root('root')) as ShoppingXML,"); fields.Append(" UnitName,TradeNum "); string primaryKey = "Id"; string orderbyStr = "IssueTime desc"; StringBuilder strWhere = new StringBuilder(" IsDelete='0' "); strWhere.AppendFormat(" and SupplierType={0}", Convert.ToByte((int)supplierType)); strWhere.AppendFormat(" and CompanyId = {0}", companyId); if (queryModel != null) { if (queryModel.ProvinceId > 0) { strWhere.AppendFormat(" and ProvinceId={0}", queryModel.ProvinceId); } if (queryModel.CityId > 0) { strWhere.AppendFormat(" and CityId={0}", queryModel.CityId); } if (!string.IsNullOrEmpty(queryModel.UnitName)) { strWhere.AppendFormat(" and UnitName like '%{0}%'", queryModel.UnitName); } } using (IDataReader dr = DbHelper.ExecuteReader(this._db, pageSize, pageIndex, ref recordCount, tableName, primaryKey, fields.ToString(), strWhere.ToString(), orderbyStr)) { while (dr.Read()) { EyouSoft.Model.SupplierStructure.SupplierShopping model = new EyouSoft.Model.SupplierStructure.SupplierShopping(); model.Id = dr.GetInt32(dr.GetOrdinal("Id")); model.ProvinceName = dr.IsDBNull(dr.GetOrdinal("ProvinceName")) ? "" : dr.GetString(dr.GetOrdinal("ProvinceName")); model.CityName = dr.IsDBNull(dr.GetOrdinal("CityName")) ? "" : dr.GetString(dr.GetOrdinal("CityName")); model.UnitAddress = dr.IsDBNull(dr.GetOrdinal("UnitAddress")) ? "" : dr.GetOrdinal("UnitAddress").ToString(); model.UnitName = dr.GetString(dr.GetOrdinal("UnitName")); model.TradeNum = dr.GetInt32(dr.GetOrdinal("TradeNum")); model.SupplierContact = GetContactList(dr.IsDBNull(dr.GetOrdinal("ContactXML")) ? "" : dr.GetString(dr.GetOrdinal("ContactXML"))); model.SaleProduct = GetShoppingList(dr.IsDBNull(dr.GetOrdinal("ShoppingXML")) ? "" : dr.GetString(dr.GetOrdinal("ShoppingXML"))); ls.Add(model); model = null; } } return(ls); }
/// <summary> /// 获取供应商景点信息 /// </summary> /// <param name="TopNum">top条数</param> /// <param name="CompanyId">所属公司编号</param> /// <param name="query">供应商查询实体</param> /// <returns></returns> public IList <EyouSoft.Model.SupplierStructure.SupplierSpot> GetList(int TopNum, int CompanyId , EyouSoft.Model.SupplierStructure.SupplierQuery query) { if (CompanyId <= 0) { return(null); } IList <EyouSoft.Model.SupplierStructure.SupplierSpot> list = new List <EyouSoft.Model.SupplierStructure.SupplierSpot>(); StringBuilder strSql = new StringBuilder(" select "); if (TopNum > 0) { strSql.AppendFormat(" top {0} ", TopNum); } strSql.Append(" [Id],[ProvinceId],[ProvinceName],[CityId],[CityName],[UnitName],[SupplierType],[UnitAddress],[Commission],[AgreementFile],[TradeNum],[UnitPolicy],[Remark],[CompanyId],[OperatorId],[IssueTime],[IsDelete],ss.Star,ss.TourGuide,ss.TeamPrice,ss.TravelerPrice,(select Id,SupplierId,PicName,PicPath from tbl_SupplierAccessory where tbl_SupplierAccessory.SupplierId = cs.Id for xml raw,root('root')) as Files from tbl_CompanySupplier as cs left join tbl_SupplierSpot as ss on cs.Id = ss.SupplierId "); strSql.AppendFormat(" where cs.IsDelete = '0' and CompanyId = {0} and SupplierType = {1} ", CompanyId, (int)EyouSoft.Model.EnumType.CompanyStructure.SupplierType.景点); if (query != null) { if (query.ProvinceId > 0) { strSql.AppendFormat(" and cs.ProvinceId={0} ", query.ProvinceId); } if (!string.IsNullOrEmpty(query.ProvinceName)) { strSql.AppendFormat(" and cs.ProvinceName like'%{0}%' ", query.ProvinceName); } if (query.CityId > 0) { strSql.AppendFormat(" and cs.CityId={0} ", query.CityId); } if (!string.IsNullOrEmpty(query.CityName)) { strSql.AppendFormat(" and cs.CityName like'%{0}%' ", query.CityName); } if (!string.IsNullOrEmpty(query.UnitName)) { strSql.AppendFormat(" and cs.UnitName like'%{0}%' ", query.UnitName); } if (query.Start.HasValue) { strSql.AppendFormat(" and ss.Star = {0} ", (int)query.Start.Value); } } strSql.Append(" order by Id desc "); DbCommand dc = this._db.GetSqlStringCommand(strSql.ToString()); using (IDataReader dr = DbHelper.ExecuteReader(dc, this._db)) { while (dr.Read()) { EyouSoft.Model.SupplierStructure.SupplierSpot model = new EyouSoft.Model.SupplierStructure.SupplierSpot(); model.Id = dr.GetInt32(dr.GetOrdinal("Id")); model.UnitAddress = dr.IsDBNull(dr.GetOrdinal("UnitAddress")) ? "" : dr.GetOrdinal("UnitAddress").ToString(); model.UnitName = dr.GetString(dr.GetOrdinal("UnitName")); model.ProvinceName = dr.IsDBNull(dr.GetOrdinal("ProvinceName")) ? "" : dr.GetString(dr.GetOrdinal("ProvinceName")); model.CityName = dr.IsDBNull(dr.GetOrdinal("CityName")) ? "" : dr.GetString(dr.GetOrdinal("CityName")); model.TradeNum = dr.GetInt32(dr.GetOrdinal("TradeNum")); //model.SupplierContact = GetContactList(dr.IsDBNull(dr.GetOrdinal("ContactXML")) ? "" : dr.GetString(dr.GetOrdinal("ContactXML"))); model.TourGuide = dr.IsDBNull(dr.GetOrdinal("TourGuide")) ? "" : dr.GetString(dr.GetOrdinal("TourGuide")); model.TeamPrice = dr.IsDBNull(dr.GetOrdinal("TeamPrice")) ? 0 : dr.GetDecimal(dr.GetOrdinal("TeamPrice")); model.TravelerPrice = dr.IsDBNull(dr.GetOrdinal("TravelerPrice")) ? 0 : dr.GetDecimal(dr.GetOrdinal("TravelerPrice")); if (!dr.IsDBNull(dr.GetOrdinal("Star"))) { model.Start = (EyouSoft.Model.EnumType.SupplierStructure.ScenicSpotStar) int.Parse(dr[dr.GetOrdinal("Star")].ToString()); } if (!dr.IsDBNull(dr.GetOrdinal("Files"))) { model.SupplierPic = this.GetSupplierPic(dr.GetString(dr.GetOrdinal("Files"))); } list.Add(model); model = null; } } return(list); }
/// <summary> /// 获取所属保险供应商信息集合 /// </summary> /// <param name="PageSize"></param> /// <param name="PageIndex"></param> /// <param name="RecordCount"></param> /// <param name="CompanyId">公司编号</param> /// <param name="SearchInfo">搜索实体</param> /// <returns></returns> public IList <EyouSoft.Model.SupplierStructure.SupplierInsurance> GetList(int PageSize, int PageIndex, ref int RecordCount, int CompanyId, EyouSoft.Model.SupplierStructure.SupplierQuery SearchInfo) { return(idal.GetList(PageSize, PageIndex, ref RecordCount, CompanyId, SearchInfo)); }
/// <summary> /// 分页获取供应商景点 /// </summary> /// <param name="PageSize">每页显示条数</param> /// <param name="PageIndex">当前页索引</param> /// <param name="RecordCount">总记录数</param> /// <param name="CompanyId">所属公司编号</param> /// <param name="query">供应商查询实体</param> /// <returns>供应商景点列表</returns> public IList <EyouSoft.Model.SupplierStructure.SupplierSpot> GetList(int PageSize, int PageIndex, ref int RecordCount, int CompanyId, EyouSoft.Model.SupplierStructure.SupplierQuery query) { if (CompanyId <= 0) { return(null); } return(Dal.GetList(PageSize, PageIndex, ref RecordCount, CompanyId, query)); }
/// <summary> /// 获取所属保险供应商信息集合 /// </summary> /// <param name="PageSize"></param> /// <param name="PageIndex"></param> /// <param name="RecordCount"></param> /// <param name="CompanyId">公司编号</param> /// <param name="SearchInfo">搜索实体</param> /// <returns></returns> public IList <EyouSoft.Model.SupplierStructure.SupplierInsurance> GetList(int PageSize, int PageIndex, ref int RecordCount, int CompanyId, EyouSoft.Model.SupplierStructure.SupplierQuery SearchInfo) { IList <EyouSoft.Model.SupplierStructure.SupplierInsurance> ResultList = null; StringBuilder fields = new StringBuilder(); fields.Append(" id,ProvinceId,ProvinceName,CityId,CityName,UnitName,SupplierType,TradeNum,"); fields.Append("UnitAddress,Commission,AgreementFile,Remark,UnitPolicy,CompanyId,OperatorId,"); fields.Append("IssueTime,(SELECT * FROM tbl_SupplierContact WHERE SupplierId=tbl_CompanySupplier.ID "); fields.Append("FOR XML RAW,ROOT('ROOT')) AS SupplierInsuranceXML "); string TableName = "tbl_CompanySupplier"; string orderByString = " [IssueTime] DESC"; string identityColumnName = "id"; StringBuilder Query = new StringBuilder(); Query.AppendFormat(" CompanyId={0} AND IsDelete=0 AND SupplierType=8", CompanyId); if (!string.IsNullOrEmpty(SearchInfo.UnitName)) { Query.AppendFormat(" AND UnitName LIKE '%{0}%'", SearchInfo.UnitName); } using (IDataReader dr = DbHelper.ExecuteReader(this._db, PageSize, PageIndex, ref RecordCount, TableName, identityColumnName, fields.ToString(), Query.ToString(), orderByString)) { ResultList = new List <EyouSoft.Model.SupplierStructure.SupplierInsurance>(); while (dr.Read()) { EyouSoft.Model.SupplierStructure.SupplierInsurance model = new EyouSoft.Model.SupplierStructure.SupplierInsurance() { Id = dr.GetInt32(dr.GetOrdinal("id")), AgreementFile = dr.IsDBNull(dr.GetOrdinal("AgreementFile")) ? "" : dr.GetString(dr.GetOrdinal("AgreementFile")), CityId = dr.IsDBNull(dr.GetOrdinal("CityId")) ? 0 : dr.GetInt32(dr.GetOrdinal("CityId")), CompanyId = dr.IsDBNull(dr.GetOrdinal("CompanyId")) ? 0 : dr.GetInt32(dr.GetOrdinal("CompanyId")), OperatorId = dr.IsDBNull(dr.GetOrdinal("OperatorId")) ? 0 : dr.GetInt32(dr.GetOrdinal("OperatorId")), ProvinceId = dr.IsDBNull(dr.GetOrdinal("ProvinceId")) ? 0 : dr.GetInt32(dr.GetOrdinal("ProvinceId")), TradeNum = dr.IsDBNull(dr.GetOrdinal("TradeNum")) ? 0 : dr.GetInt32(dr.GetOrdinal("TradeNum")), UnitName = dr.IsDBNull(dr.GetOrdinal("UnitName")) ? "" : dr.GetString(dr.GetOrdinal("UnitName")), CityName = dr.IsDBNull(dr.GetOrdinal("CityName")) ? "" : dr.GetString(dr.GetOrdinal("CityName")), ProvinceName = dr.IsDBNull(dr.GetOrdinal("ProvinceName")) ? "" : dr.GetString(dr.GetOrdinal("ProvinceName")), Remark = dr.IsDBNull(dr.GetOrdinal("Remark")) ? "" : dr.GetString(dr.GetOrdinal("Remark")), UnitAddress = dr.IsDBNull(dr.GetOrdinal("UnitAddress")) ? "" : dr.GetString(dr.GetOrdinal("UnitAddress")), IssueTime = dr.GetDateTime(dr.GetOrdinal("IssueTime")), SupplierType = (EyouSoft.Model.EnumType.CompanyStructure.SupplierType)Enum.Parse(typeof(EyouSoft.Model.EnumType.CompanyStructure.SupplierType), dr.GetByte(dr.GetOrdinal("SupplierType")).ToString()) }; if (!dr.IsDBNull(dr.GetOrdinal("SupplierInsuranceXML"))) { model.SupplierContact = this.GetContactInfo(dr.GetString(dr.GetOrdinal("SupplierInsuranceXML"))); } ResultList.Add(model); model = null; } } return(ResultList); }
/// <summary> /// 分页获取供应商购物信息 /// </summary> /// <param name="pageSize">每页显示数</param> /// <param name="pageIndex">起始页码</param> /// <param name="recordCount">总数</param> /// <param name="supplierType">供应商类型</param> /// <param name="cityId">城市ID</param> /// <param name="shopName">商店名称</param> /// <param name="companyId">公司ID</param> /// <returns></returns> public IList <EyouSoft.Model.SupplierStructure.SupplierShopping> GetList(int pageSize, int pageIndex, ref int recordCount, int companyId, EyouSoft.Model.EnumType.CompanyStructure.SupplierType supplierType, EyouSoft.Model.SupplierStructure.SupplierQuery queryModel) { return(Dal.GetList(pageSize, pageIndex, ref recordCount, companyId, supplierType, queryModel)); }