Exemplo n.º 1
0
        /// <summary>
        /// 获取供应商列表交易次数合计
        /// </summary>
        /// <param name="companyId">公司编号(专线)</param>
        /// <param name="type">供应商类型</param>
        /// <param name="searchInfo">查询信息</param>
        /// <returns></returns>
        public int GetTimesGYSSummary(int companyId, EyouSoft.Model.EnumType.CompanyStructure.SupplierType type, EyouSoft.Model.CompanyStructure.MSupplierSearchInfo searchInfo)
        {
            if (companyId < 1)
            {
                return(0);
            }

            return(Dal.GetTimesGYSSummary(companyId, type, searchInfo));
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        protected void DataInit(string djName)
        {
            EyouSoft.Model.EnumType.CompanyStructure.SupplierType sType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.地接;

            if (Utils.GetInt(Utils.GetQueryStringValue("sType"), 0) == 5)
            {
                sType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.票务;
                lbSupplerTypeName.InnerText = "票务名称:";
            }
            if (Utils.GetInt(Utils.GetQueryStringValue("sType"), 0) == 4)
            {
                sType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.保险;
                lbSupplerTypeName.InnerText = "保险名称:";
            }
            if (Utils.GetInt(Utils.GetQueryStringValue("sType"), 0) == 7)
            {
                sType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.购物;
                lbSupplerTypeName.InnerText = "购物名称:";
            }
            if (Utils.GetInt(Utils.GetQueryStringValue("sType"), 0) == 3)
            {
                sType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.景点;
                lbSupplerTypeName.InnerText = "景点名称:";
            }
            if (Utils.GetInt(Utils.GetQueryStringValue("sType"), 0) == 1)
            {
                sType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.酒店;
                lbSupplerTypeName.InnerText = "酒店名称:";
            }
            if (Utils.GetInt(Utils.GetQueryStringValue("sType"), 0) == 9)
            {
                sType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.其他;
                lbSupplerTypeName.InnerText = "其它名称:";
            }

            if (Utils.GetInt(Utils.GetQueryStringValue("sType"), 0) == 8)
            {
                sType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.车队;
                lbSupplerTypeName.InnerText = "车队名称:";
            }
            if (Utils.GetInt(Utils.GetQueryStringValue("sType"), 0) == 2)
            {
                sType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.餐馆;
                lbSupplerTypeName.InnerText = "餐馆名称:";
            }

            //声明操作对象
            EyouSoft.BLL.CompanyStructure.CompanySupplier bll = new EyouSoft.BLL.CompanyStructure.CompanySupplier();
            //查询地接社数据,获得列表list
            IList <EyouSoft.Model.CompanyStructure.CompanySupplier> list = bll.GetList(pageSize, pageIndex, ref recordCount, sType, 0, 0, djName, this.CurrentUserCompanyID);

            if (list != null && list.Count > 0)
            {
                this.rptList.DataSource = list;
                this.rptList.DataBind();
                //设置分页
                BindPage();
            }
            else
            {
                //没有数据时隐藏分页控件 并 提示信息
                this.ExportPageInfo1.Visible = false;
                this.lblMsg.Text             = "没有找到相关信息!";
            }
        }
Exemplo n.º 4
0
 /// <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));
 }
Exemplo n.º 5
0
 /// <summary>
 /// 分页获取供应商列表
 /// </summary>
 /// <param name="pageSize">每页条数</param>
 /// <param name="pageIndex">当前页码</param>
 /// <param name="RecordCount">总数</param>
 /// <param name="supplierType">供应商类型(0-地接 1票务)</param>
 /// <param name="ProvinceName">省份名称(可为空)</param>
 /// <param name="CityName">城市名称(可为空)</param>
 /// <param name="UnitName">单位名称(可为空)</param>
 /// <returns></returns>
 public IList <EyouSoft.Model.SupplierStructure.SupplierOther> GetList(int pageSize, int pageIndex, ref int RecordCount, EyouSoft.Model.EnumType.CompanyStructure.SupplierType supplierType, int ProvinceId, int CityId, string UnitName, int companyId)
 {
     return(Dal.GetOtherList(pageSize, pageIndex, ref RecordCount, supplierType, UnitName, companyId));
 }
Exemplo n.º 6
0
        /// <summary>
        /// 将供应商类型转换为模块
        /// </summary>
        /// <param name="SupplierType">供应商类型</param>
        /// <returns></returns>
        private EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass GetModule(EyouSoft.Model.EnumType.CompanyStructure.SupplierType SupplierType)
        {
            EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass t = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.供应商管理_其它;
            switch (SupplierType)
            {
            case EyouSoft.Model.EnumType.CompanyStructure.SupplierType.保险:
                t = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.供应商管理_保险;
                break;

            case EyouSoft.Model.EnumType.CompanyStructure.SupplierType.餐馆:
                t = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.供应商管理_餐馆;
                break;

            case EyouSoft.Model.EnumType.CompanyStructure.SupplierType.车队:
                t = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.供应商管理_车队;
                break;

            case EyouSoft.Model.EnumType.CompanyStructure.SupplierType.地接:
                t = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.供应商管理_地接;
                break;

            case EyouSoft.Model.EnumType.CompanyStructure.SupplierType.购物:
                t = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.供应商管理_购物;
                break;

            case EyouSoft.Model.EnumType.CompanyStructure.SupplierType.景点:
                t = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.供应商管理_景点;
                break;

            case EyouSoft.Model.EnumType.CompanyStructure.SupplierType.酒店:
                t = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.供应商管理_酒店;
                break;

            case EyouSoft.Model.EnumType.CompanyStructure.SupplierType.票务:
                t = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.供应商管理_票务;
                break;

            case EyouSoft.Model.EnumType.CompanyStructure.SupplierType.其他:
                t = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.供应商管理_其它;
                break;
            }

            return(t);
        }