Example #1
0
        void Hub_UpdateProduct(object sender, ProductUpdateEventArgs e)
        {
            try
            {
                Product product = _pruduct.FindByID(e.ProductID);

                txtSupplier.Tag  = product.SupplierID;
                txtSupplier.Text = _supplier.GetSingle(new Supplier {
                    SupplierID = product.SupplierID
                }).Name;

                txtCategory.Tag  = product.CategoryID;
                txtCategory.Text = new CategoryService().GetSingle(new Category {
                    CategoryID = product.CategoryID
                }).Name;

                txtBrand.Tag  = product.BrandID;
                txtBrand.Text = new BrandService().GetSingle(new Brand {
                    BrandID = product.BrandID
                }).BrandName;

                txtItemName.Text = product.ProductName;
                txtItemName.Tag  = product.ProductID;

                txtBarCode.Text       = product.Barcode;
                txtCommission.Text    = product.Commission.ToString();
                txtPurchasePrice.Text = product.PurchasePrice.ToString();
                txtSalePrice.Text     = product.SellingPrice.ToString();
                txtReOrderLevel.Text  = product.ReorderLevel.ToString();
                txtDiscount.Text      = product.Discount.ToString();
                //txtProfitMargin.Text=product.

                dtpManufactureDate.Value = product.ManufactureDate.HasValue ? product.ManufactureDate.Value : DateTime.Now;
                dtpExpiryDate.Value      = product.ExpiryDate.HasValue ? product.ExpiryDate.Value : DateTime.Now;

                txtDescription.Text = product.Description;

                chkOnSale.Checked = product.OnSale.HasValue ? product.OnSale.Value : false;

                pictureBoxProduct.Image = product.ProductImage != null?Helper.ByteArrayToImage(product.ProductImage) : null;

                lblProductPicture.Visible = product.ProductImage == null;
                lblRemoveimg.Visible      = product.ProductImage != null;

                cmbMeasurement.SelectedValue = product.MeasurementID;

                //LoadProductLocation(product.ProductID);

                ConfigureForm("Update");
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, OperationStatus.FAILURE, "ucNewProduct", "Hub_UpdateProduct");
                Helper.ShowMessage(OperationStatus.FAILURE + "\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        void m_TTUSAPI_OnProductUpdate(object sender, ProductUpdateEventArgs e)
        {
            // create product limit profile
            // lookup login
            // add product limit profile to gateway login

            m_MarketProductCatalogs = e.Products;

            UpdateStatusBar("Downloaded Products.");
            piProducts = 1;
            if (piInit == 1)
            {
                btnUpdate.Enabled = true;
            }
        }
Example #3
0
 private void Instance_OnProductUpdated(object sender, ProductUpdateEventArgs e)
 {
     RefreshGrid();
 }
Example #4
0
 private void Instance_OnProductCreated(object sender, ProductUpdateEventArgs e)
 {
     AddProduct(e.Product);
 }