Пример #1
0
        public AddProductForm(ProductListPage productListPage)
        {
            _productListPage = productListPage;

            InitializeComponent();

            CenterToScreen();

            getCatalogs();

            errorProvider = new ErrorProvider();
            errorProvider.ContainerControl = this;
        }
Пример #2
0
        public EditProductForm(ProductListPage productListPage)
        {
            _productListPage = productListPage;

            InitializeComponent();

            CenterToScreen();

            getCatalogs();

            errorProvider = new ErrorProvider();
            errorProvider.ContainerControl = this;

            tbProductName.Text         = _productListPage.CurrentEditingProduct.ProductName;
            tbProductPrice.Text        = _productListPage.CurrentEditingProduct.Price + "";
            inStockNumber.Value        = _productListPage.CurrentEditingProduct.InStock;
            panelImage.BackgroundImage = _productListPage.CurrentEditingProduct.ProductImage;

            ImageConverter imgCon = new ImageConverter();

            productImage = (byte[])imgCon.ConvertTo(_productListPage.CurrentEditingProduct.ProductImage, typeof(byte[]));
            string[] splited = _productListPage.CurrentEditingProduct.ImageUrl.Split('/');
            fileName = splited[splited.Length - 1];
        }