コード例 #1
0
 partial void DeleteSS_Retailer(SS_Retailer instance);
コード例 #2
0
 partial void InsertSS_Retailer(SS_Retailer instance);
コード例 #3
0
 partial void UpdateSS_Retailer(SS_Retailer instance);
コード例 #4
0
        public static void DownloadRetailers()
        {
            ShopStyle api = new ShopStyle("uid8409-24047347-36",ShopStyle.US_API_HOSTNAME);

            var retailerResponse = api.getRetailers();
            using (CatalogDataContext dc = new CatalogDataContext())
            {
                foreach (Retailer retailer in retailerResponse.getRetailers())
                {
                    SS_Retailer obj =  dc.SS_Retailers.SingleOrDefault(r => r.retailer_id == (int)retailer.getId());

                    if (obj == null)
                    {
                        SS_Retailer ssRetailer = new SS_Retailer() { id = System.Guid.NewGuid(), name = retailer.getName(), retailer_id = (int)retailer.getId(), url = retailer.getUrl() };
                        dc.SS_Retailers.InsertOnSubmit(ssRetailer);
                    }

                }

                dc.SubmitChanges();
            }
        }