Example #1
0
 public EbayClient()
 {
     m_config = new ClientConfig();
     m_config.ApplicationId = appID;
     m_config.EndPointAddress = findingServerAddress;
     m_client = FindingServiceClientFactory.getServiceClient(m_config);
     m_api = new ApiContext();
     m_api = AppSettingHelper.GetApiContext();
     m_cats = new tblCategory();
     db = new DataClasses1DataContext();
     m_log = new List<string> { };
 }
 partial void DeletetblCategory(tblCategory instance);
 partial void UpdatetblCategory(tblCategory instance);
 partial void InserttblCategory(tblCategory instance);
Example #5
0
        public void EbayTopLevelCategories()
        {
            GetCategoriesCall Categories = new GetCategoriesCall(m_api);
            Categories.LevelLimit = 2;
            Categories.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);

            CategoryTypeCollection cats =Categories.GetCategories();

            foreach (CategoryType category in cats)
            {
                m_cats = new tblCategory();
                m_cats.category_id= category.CategoryID;
                m_cats.category_level = category.CategoryLevel.ToString();
                m_cats.category_name = category.CategoryName;
                m_cats.category_parent = category.CategoryParentID[0].ToString();
                DataClasses1DataContext db = new DataClasses1DataContext();

                try
                {
                    DataClasses1DataContext context = new DataClasses1DataContext();
                  //  context.Connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["EbayFactoryConnectionString"].ConnectionString;
                    context.tblCategories.InsertOnSubmit(m_cats);

                    context.SubmitChanges();
                }
                catch(Exception e)
                {
                    string er = e.Message;
                }

            }
        }