Ejemplo n.º 1
0
 private void quantityButtonPressed(object parameter)
 {
     if (SelectedItem != null)
     {
         try {
             ProductModel model         = ProductAccess.singleton.getProductUsingProductID(Convert.ToInt32(SelectedItem.ProductID.value));
             QuantityView quantity_view = new QuantityView(this);
             quantity_view.Left     = HomeViewModel.MainView.Left + (HomeViewModel.MainView.ActualWidth / 2) - quantity_view.ActualWidth;
             quantity_view.Top      = HomeViewModel.MainView.Top + 160;
             quantity_view.Quantity = SelectedItem.Qunatity.value.ToString();
             this.SearchedModel     = model;
             quantity_view.Show();
         }
         catch (Exception) { }
     }
 }
Ejemplo n.º 2
0
        private void openQuantityView()
        {
            bool         found         = false;
            QuantityView quantity_view = new QuantityView(this);

            quantity_view.Left = HomeViewModel.MainView.Left + (HomeViewModel.MainView.ActualWidth / 2) - quantity_view.ActualWidth;
            quantity_view.Top  = HomeViewModel.MainView.Top + 160;
            foreach (SaleProductModel sp_modle in SaleProducts)
            {
                if (sp_modle.ProductID.value == SearchedModel.ID.value && sp_modle.Discount.value == 0)
                {
                    quantity_view.Quantity = sp_modle.Qunatity.value.ToString();
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                quantity_view.Quantity = "1";
            }
            quantity_view.Show();
        }