Ejemplo n.º 1
0
        ///// <summary>
        ///// 门店
        ///// </summary>
        ///// <param name="saleFilialeId"></param>
        ///// <returns></returns>
        //internal static ServiceClient<ShopSystem.Company.Service.Interface.IService> CreateShopWcfClient(Guid saleFilialeId)
        //{
        //    var endPointName = GetEndPointName(saleFilialeId, ServiceType.Shop);
        //    return new ServiceClient<ShopSystem.Company.Service.Interface.IService>(endPointName);
        //}

        /// <summary>
        /// 加盟店
        /// </summary>
        /// <returns></returns>
        internal static ServiceClient <AllianceShop.Contract.IDomainService> CreateShopStoreWcfClient(Guid saleFilialeId)
        {
            var endPointName = GetEndPointName(saleFilialeId, ServiceType.Shop);

            if (endPointName.Length == 0)
            {
                var filialeInfo = MISService.GetAllFiliales().FirstOrDefault(ent => ent.ID == saleFilialeId);
                if (filialeInfo != null && filialeInfo.ParentId != Guid.Empty)
                {
                    endPointName = GetEndPointName(filialeInfo.ParentId, ServiceType.Shop);
                }
                else
                {
                    endPointName = "Shop.Keede";
                }
            }
            return(new ServiceClient <AllianceShop.Contract.IDomainService>(endPointName));
        }