Esempio n. 1
0
        public void ExportCategories()
        {
            SqlCompactConnection conn = new SqlCompactConnection();

            try
            {
                StripStatus.Text = "Products Sub Categories..";
                ProductSubcategory sub = new ProductSubcategory();
                ProductCategory    cat = new ProductCategory();
                conn.DropProdctSubCategoryTable();
                conn.CreateProdctSubCategoryTable();
                ProductSubcategoryCollection subCol = sub.GetAllProductSubcategoryCollection();
                conn.SynchForm = this;
                conn.AddProductSubCategory(subCol);

                StripStatus.Text = "Products Categories..";
                conn.DropProdctCategoryTable();
                conn.CreateProdctCategoryTable();
                ProductCategoryCollection catCol = cat.GetAllProductCategoryCollection();
                conn.AddProductCategory(catCol);
                sub    = null;
                cat    = null;
                subCol = null;
                catCol = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                conn.CloseDatabase();
                conn = null;
            }
        }