Exemplo n.º 1
0
        private void btnCancelAddProduct_Click(object sender, RoutedEventArgs e)
        {
            var opwindow = new ProductsPage();

            opwindow.Show();
            this.Close();
        }
Exemplo n.º 2
0
        private void btnAddProduct_Click(object sender, RoutedEventArgs e)
        {
            var pname     = tbxProductName.Text;
            var ptype     = tbxProductType.Text;
            int pquantity = Convert.ToInt16(tbxQuantity.Text);
            var pcolor    = tbxColor.Text;
            int pbuyp     = Convert.ToInt16(tbxBuyingPrice.Text);
            int psellp    = Convert.ToInt16(tbxSellingPrice.Text);

            ViewModelLocator.ProductViewModel.AddProduct(pname, ptype, pquantity, pcolor, pbuyp, psellp);
            ViewModelLocator.ProductViewModel.CreateProductList();

            var opwindow = new ProductsPage();

            opwindow.Show();
            this.Close();
        }