Example #1
0
        /// <summary>
        /// 获取第三方电商信息
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        public static ThirdECommerceDTO GetThirdECommerce(Guid appId)
        {
            var thirdECommerceId = MallApply.ObjectSet().Where(p => p.EsAppId == CustomConfig.YJAppId &&
                                                               p.AppId == appId && p.ThirdECommerceId.HasValue).Select(p => p.ThirdECommerceId.Value).FirstOrDefault();

            if (thirdECommerceId != Guid.Empty)
            {
                var thirdECommerce = ThirdECommerce.ObjectSet()
                                     .Where(p => p.Id == thirdECommerceId && p.Type == (int)ThirdECommerceTypeEnum.ByBiaoZhunJieKou)
                                     .FirstOrDefault();
                if (thirdECommerce != null)
                {
                    return(thirdECommerce.ToEntityData());
                }
            }
            return(null);
        }
Example #2
0
 /// <summary>
 /// 获取店铺(商家)对应的第三方电商类型
 /// </summary>
 /// <param name="appId"></param>
 /// <returns></returns>
 public static ThirdECommerceTypeEnum GetAppThirdECommerceType(Guid appId)
 {
     if (appId == Guid.Empty)
     {
         return(ThirdECommerceTypeEnum.NotThirdECommerce);
     }
     if (CustomConfig.JdAppIdList.Contains(appId))
     {
         return(ThirdECommerceTypeEnum.JingDongDaKeHu);
     }
     else if (CustomConfig.YxAppIdList.Contains(appId))
     {
         return(ThirdECommerceTypeEnum.WangYiYanXuan);
     }
     else if (CustomConfig.SnAppIdList.Contains(appId))
     {
         return(ThirdECommerceTypeEnum.SuNingYiGou);
     }
     else if (CustomConfig.FZAppIdList.Contains(appId))
     {
         return(ThirdECommerceTypeEnum.FangZheng);
     }
     else if (CustomConfig.YPKAppIdList.Contains(appId))
     {
         return(ThirdECommerceTypeEnum.YiPaiKe);
     }
     else
     {
         var thirdECommerceId = MallApply.ObjectSet().Where(p => p.EsAppId == CustomConfig.YJAppId &&
                                                            p.AppId == appId && p.ThirdECommerceId.HasValue).Select(p => p.ThirdECommerceId.Value).FirstOrDefault();
         if (thirdECommerceId != Guid.Empty)
         {
             if (ThirdECommerce.ObjectSet().Any(p => p.Id == thirdECommerceId && p.Type == (int)ThirdECommerceTypeEnum.ByBiaoZhunJieKou))
             {
                 return(ThirdECommerceTypeEnum.ByBiaoZhunJieKou);
             }
         }
         return(ThirdECommerceTypeEnum.NotThirdECommerce);
     }
 }