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(); }
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; }
private void LoadBrandList() { using (Ambient.DbSession.Activate()) { mBrandList = new ProductBrandBindingList(); mBrandList.AddNew(); mBrandList.Add(OrderingRepositories.ProductBrand.GetAll()); cboBrand.DataSource = mBrandList; mHelper.SetProductBrands(mBrandList); } }
public void AddAllColumns(ProductSubCategoryBindingList subcategoryList, ProductBrandBindingList brandList) { DataGridViewTextBoxColumn col; mSubCatColumn = AddComboBoxColumn("Product_ProductSubCategoryId", "Sub Category", 10, false, subcategoryList, "SubCategoryName", "Id"); mSubCatColumn.Frozen = true; mBrandColumn = AddComboBoxColumn("Product_ProductBrandId", "Brand", 8, false, brandList, "BrandName", "Id"); mBrandColumn.Frozen = true; AddTextBoxColumn("Product_ProductName", "Product Name", 20, false).Frozen = true; AddTextBoxColumn("Product_Size", "Size", 4, false).Frozen = true; AddTextBoxColumn("Product_ManufacturerPartNum", "Model Number", 4, false); AddTextBoxColumn("VendorProduct_VendorPartNum", "Vendor Code", 8, false); mEachCostColumn = AddCurrencyColumn("VendorProduct_EachCost", "Each Cost", 4, false); mCaseCostColumn = AddCurrencyColumn("VendorProduct_CaseCost", "Case Cost", 4, false); mCountInCaseColumn = AddIntegerColumn("VendorProduct_CountInCase", "Case Size", 3, false); mRetailPriceColumn = AddCurrencyColumn("Product_RetailPrice", "Normal Retail", 4, false); col = AddTextBoxColumn("NormalMargin", "Normal Margin", 4, true); col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; col.DefaultCellStyle.Format = VendorProduct.MarginFormat; AddTextBoxColumn("VendorProduct_ShelfOrder", "Shelf Order", 4, false); mRetailPrice2Column = AddCurrencyColumn("Product_RetailPrice2", "Retail Price 2", 4, false); mMultiplierColumn = AddTextBoxColumn("Product_Price2SizeMultiplier", "Size Multiplier", 4, false); AddCurrencyColumn("EachCostFromNominalCaseCost", "Each In Case", 4, true); AddCheckBoxColumn("VendorProduct_WholeCasesOnly", "Whole Cases Only", 4, false); AddCheckBoxColumn("Product_ExceptionalRetailPrice", "Special Price", 4, false); mRetailPriceOverrideColumn = AddCurrencyColumn("VendorProduct_RetailPriceOverride", "Vendor Retail", 4, false); col = AddTextBoxColumn("VendorMargin", "Vendor Margin", 4, true); col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; col.DefaultCellStyle.Format = VendorProduct.MarginFormat; mCostVerifiedDateColumn = AddDateColumn("VendorProduct_CostVerifiedDate", "Cost Verified Date", 5, false); mQtyBusyMinColumn = AddIntegerColumn("Product_QtyBusyMin", "Qty Busy Min", 3, false); mQtyBusyMaxColumn = AddIntegerColumn("Product_QtyBusyMax", "Qty Busy Max", 3, false); mQtySlowMinColumn = AddIntegerColumn("Product_QtySlowMin", "Qty Slow Min", 3, false); mQtySlowMaxColumn = AddIntegerColumn("Product_QtySlowMax", "Qty Slow Max", 3, false); AddCheckBoxColumn("Product_IsActive", "Product Active", 4, false); AddCheckBoxColumn("VendorProduct_IsActive", "V.P. Active", 4, false); AddCheckBoxColumn("Product_IsProductDeleted", "Product Deleted", 4, false); AddCheckBoxColumn("VendorProduct_IsProductDeleted", "V.P. Deleted", 4, false); AddCheckBoxColumn("Product_MultipleVendors", "Multiple Vendors", 4, false); AddCheckBoxColumn("VendorProduct_PreferredSource", "Pref. Source", 4, false); AddTextBoxColumn("Product_ManufacturerBarcode", "Barcode", 8, false); AddCheckBoxColumn("Product_PricingRequiresReview", "Prod. Review Price", 5, false); AddCheckBoxColumn("VendorProduct_PricingRequiresReview", "Vendor Review Price", 5, false); AddCheckBoxColumn("VendorProduct_NumAndCostRequireReview", "Vendor Review Info", 5, false); AddTextBoxColumn("Product_Notes", "Product Notes", 20, false); AddTextBoxColumn("VendorProduct_Notes", "Vendor Product Notes", 20, false); AddTextBoxColumn("VendorProduct_Id", "ID", 5, true); AddTextBoxColumn("VendorProduct_CreateDate", "Created", 10, true); AddTextBoxColumn("VendorProduct_ModifyDate", "Modified", 10, true); }
public void AddAllColumns(ProductSubCategoryBindingList subcategoryList, ProductBrandBindingList brandList) { DataGridViewTextBoxColumn col; mPurLine_QtyOnHandColumn = AddIntegerColumn("PurLine_QtyOnHand", PurLineForm.ColNameOnHand, 3, false); AddComboBoxColumn("PurLine_ProductSubCategoryId", PurLineForm.ColNameSubCategory, 10, false, subcategoryList, "SubCategoryName", "Id").Frozen = true; AddComboBoxColumn("PurLine_ProductBrandId", PurLineForm.ColNameBrand, 8, false, brandList, "BrandName", "Id").Frozen = true; AddTextBoxColumn("PurLine_ProductName", PurLineForm.ColNameProduct, 20, false).Frozen = true; AddTextBoxColumn("PurLine_Size", PurLineForm.ColNameSize, 4, false).Frozen = true;; AddTextBoxColumn("PurLine_ManufacturerPartNum", PurLineForm.ColNameModel, 4, false); AddTextBoxColumn("PurLine_VendorPartNum", PurLineForm.ColNameVendorCode, 8, false); mPurLine_QtyOrderedColumn = AddIntegerColumn("PurLine_QtyOrdered", PurLineForm.ColNameOrdered, 3, false); //mPurLine_QtyOrderedColumn.Frozen = true; mPurLine_OrderedEachesColumn = AddCheckBoxColumn("PurLine_OrderedEaches", PurLineForm.ColNameOrderEaches, 4, false); //mPurLine_OrderedEachesColumn.Frozen = true; AddCurrencyColumn("ExtendedCost", "Extended Cost", 5, true); mPurLine_EachCostColumn = AddCurrencyColumn("PurLine_EachCost", PurLineForm.ColNameEachCost, 4, false); mPurLine_CaseCostColumn = AddCurrencyColumn("PurLine_CaseCost", PurLineForm.ColNameCaseCost, 4, false); mPurLine_CountInCaseColumn = AddIntegerColumn("PurLine_CountInCase", PurLineForm.ColNameCaseSize, 4, false); AddCheckBoxColumn("PurLine_SpecialOrder", "Special Order", 4, false); AddTextBoxColumn("Product_QtyBusyMin", "Qty Busy Min", 3, true); AddTextBoxColumn("Product_QtyBusyMax", "Qty Busy Max", 3, true); AddTextBoxColumn("Product_QtySlowMin", "Qty Slow Min", 3, true); AddTextBoxColumn("Product_QtySlowMax", "Qty Slow Max", 3, true); mPurLine_CaseCostOverrideColumn = AddCurrencyColumn("PurLine_CaseCostOverride", "Special Case Cost", 4, false); AddCurrencyColumn("EachCostFromNominalCaseCost", "Best Each In Case", 4, true); mPurLine_EachCostOverrideColumn = AddCurrencyColumn("PurLine_EachCostOverride", "Special Each Cost", 4, false); AddCurrencyColumn("BestEachCost", "Best Each Cost", 4, true); mPurLine_RetailPriceColumn = AddCurrencyColumn("PurLine_RetailPrice", "Normal Retail", 4, false); mPurLine_RetailPriceOverrideColumn = AddCurrencyColumn("PurLine_RetailPriceOverride", "Vendor Retail", 4, false); col = AddTextBoxColumn("BestNormalMargin", "Best Normal Margin", 5, true); col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; col.DefaultCellStyle.Format = VendorProduct.MarginFormat; col = AddTextBoxColumn("BestVendorMargin", "Best Vendor Margin", 5, true); col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; col.DefaultCellStyle.Format = VendorProduct.MarginFormat; mPurLine_QtyReceivedColumn = AddIntegerColumn("PurLine_QtyReceived", "Received", 5, false); mPurLine_QtyBackorderedColumn = AddIntegerColumn("PurLine_QtyBackordered", "Back Ordered", 5, false); mPurLine_QtyMissingColumn = AddIntegerColumn("PurLine_QtyMissing", "Missing", 5, false); mPurLine_QtyDamagedColumn = AddIntegerColumn("PurLine_QtyDamaged", "Damaged", 5, false); AddTextBoxColumn("PurLine_ManufacturerBarcode", "Barcode", 8, false); AddTextBoxColumn("PurLine_ShelfOrder", "Shelf Order", 4, false); AddTextBoxColumn("PurLine_Notes", "Notes", 30, false); AddTextBoxColumn("PurLine_VendorProductId", "V.P. Id", 5, true); AddTextBoxColumn("PurLine_CreateDate", "Created", 10, true); AddTextBoxColumn("PurLine_ModifyDate", "Modified", 10, true); }
public void SetProductBrands(ProductBrandBindingList brandList) { mBrandColumn.DataSource = brandList; }