예제 #1
0
        private void PurLineForm_Load(object sender, EventArgs e)
        {
            ProductSubCategoryBindingList subCatBindingList = new ProductSubCategoryBindingList();
            ProductBrandBindingList       brandBindingList  = new ProductBrandBindingList();

            using (Ambient.DbSession.Activate())
            {
                mCategories        = OrderingRepositories.ProductCategory.GetAll();
                mSubCategories     = new List <ProductSubCategory>();
                mSubCategoriesById = new Dictionary <int, ProductSubCategory>();
                subCatBindingList.AddNew();
                foreach (ProductSubCategory subCat in OrderingRepositories.ProductSubCategory.GetAll())
                {
                    mSubCategories.Add(subCat);
                    mSubCategoriesById.Add(subCat.Id.Value, subCat);
                    subCatBindingList.Add(subCat);
                }
                mBrands     = new List <ProductBrand>();
                mBrandsById = new Dictionary <int, ProductBrand>();
                brandBindingList.AddNew();
                foreach (ProductBrand brand in OrderingRepositories.ProductBrand.GetAll())
                {
                    mBrands.Add(brand);
                    mBrandsById.Add(brand.Id.Value, brand);
                    brandBindingList.Add(brand);
                }
            }
            mHelper.Init(mOrder, mSubCategoriesById, mBrandsById);
            mHelper.AddAllColumns(subCatBindingList, brandBindingList);
            (new ToolTip()).SetToolTip(btnSetBrands, "Set brand of all selected rows that are manually entered or imported, to the brand of the first selected row.");
            (new ToolTip()).SetToolTip(btnSetSubcategories, "Set subcategory of all selected rows that are manually entered or imported, to the subcategory of the first selected row.");
            (new ToolTip()).SetToolTip(btnCreateProducts, "Create new vendor products for all rows that are manually entered or imported.");
            ShowLines();
            ShowTotalCost();
        }
예제 #2
0
        private void ProductBrandForm_Load(object sender, EventArgs e)
        {
            ProductBrandBindingList productBrandList = new ProductBrandBindingList();

            using (Ambient.DbSession.Activate())
            {
                productBrandList.Add(OrderingRepositories.ProductBrand.GetAll());
            }
            mHelper.AddAllColumns();
            mHelper.DataSource = productBrandList;
        }
예제 #3
0
 private void LoadBrandList()
 {
     using (Ambient.DbSession.Activate())
     {
         mBrandList = new ProductBrandBindingList();
         mBrandList.AddNew();
         mBrandList.Add(OrderingRepositories.ProductBrand.GetAll());
         cboBrand.DataSource = mBrandList;
         mHelper.SetProductBrands(mBrandList);
     }
 }