예제 #1
0
 public void SaveVShopSetting(WXshopInfo wxShop)
 {
     if (GetVShopSetting(wxShop.ShopId) == null)
     {
         AddVShopSetting(wxShop);
     }
     else
     {
         UpdateVShopSetting(wxShop);
     }
 }
예제 #2
0
 void AddVShopSetting(WXshopInfo vshopSetting)
 {
     if (string.IsNullOrEmpty(vshopSetting.AppId))
     {
         throw new Mall.Core.MallException("微信AppId不能为空!");
     }
     if (string.IsNullOrEmpty(vshopSetting.AppSecret))
     {
         throw new MallException("微信AppSecret不能为空!");
     }
     DbFactory.Default.Add(vshopSetting);
 }
예제 #3
0
        void UpdateVShopSetting(WXshopInfo vshopSetting)
        {
            var wxShop = GetVShopSetting(vshopSetting.ShopId);

            if (string.IsNullOrEmpty(vshopSetting.AppId))
            {
                throw new Mall.Core.MallException("微信AppId不能为空!");
            }
            if (string.IsNullOrEmpty(vshopSetting.AppSecret))
            {
                throw new MallException("微信AppSecret不能为空!");
            }
            wxShop.ShopId    = vshopSetting.ShopId;
            wxShop.AppId     = vshopSetting.AppId;
            wxShop.AppSecret = vshopSetting.AppSecret;
            wxShop.FollowUrl = vshopSetting.FollowUrl;
            DbFactory.Default.Update(wxShop);
        }