예제 #1
0
        private static void DownloadTBCategories()
        {
            TBProductUploadServiceImpl impl = new TBProductUploadServiceImpl();
            List<ItemCat> catList = impl.GetItemCats();

            foreach (var cat in catList)
            {
                using (TaoBaoDataContext tbCon = new TaoBaoDataContext())
                {
                    TB_ItemCat obj = new TB_ItemCat();
                    obj.ID = Guid.NewGuid();
                    obj.Cid = cat.Cid;
                    obj.Name = cat.Name;
                    obj.IsParent = cat.IsParent;

                    if (!string.IsNullOrEmpty(cat.ModifiedTime))
                    {
                        obj.ModifiedTime = DateTime.Parse(cat.ModifiedTime);
                    }
                    obj.ModifiedType = cat.ModifiedType;
                    obj.ParentCid = cat.ParentCid;
                    obj.SortOrder = (int)cat.SortOrder;
                    obj.Status = cat.Status;

                    tbCon.TB_ItemCats.InsertOnSubmit(obj);
                    tbCon.SubmitChanges();
                }

            }
        }
 partial void UpdateTB_ItemCat(TB_ItemCat instance);
 partial void DeleteTB_ItemCat(TB_ItemCat instance);
 partial void InsertTB_ItemCat(TB_ItemCat instance);