Exemplo n.º 1
0
 private InvLib.ProductInfo MakeChild(int id, string name, float price, int qoh)
 {
   var child = new InvLib.ProductInfo();
   LoadProperty(child, InvLib.ProductInfo.IdProperty, id);
   LoadProperty(child, InvLib.ProductInfo.NameProperty, name);
   LoadProperty(child, InvLib.ProductInfo.PriceProperty, price);
   LoadProperty(child, InvLib.ProductInfo.QohProperty, qoh);
   return child;
 }
Exemplo n.º 2
0
        private InvLib.ProductInfo MakeChild(int id, string name, float price, int qoh)
        {
            var child = new InvLib.ProductInfo();

            LoadProperty(child, InvLib.ProductInfo.IdProperty, id);
            LoadProperty(child, InvLib.ProductInfo.NameProperty, name);
            LoadProperty(child, InvLib.ProductInfo.PriceProperty, price);
            LoadProperty(child, InvLib.ProductInfo.QohProperty, qoh);
            return(child);
        }
Exemplo n.º 3
0
    private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
      // set _selectedItem
      var lb = sender as ListBox;
      if (lb != null && lb.SelectedItem != null)
        _selectedItem = lb.SelectedItem as InvLib.ProductInfo;
      EditButton.IsEnabled = _selectedItem != null;
      DeleteButton.IsEnabled = _selectedItem != null;

      // display product view
      if (_selectedItem != null)
        DisplayProductView();
    }
Exemplo n.º 4
0
 private void DeleteButton_Click(object sender, RoutedEventArgs e)
 {
   MarkBusy(true);
   var dp = new Csla.DataPortal<InvLib.ProductEdit>();
   dp.DeleteCompleted += (o, e1) =>
     {
       MarkBusy(false);
       _selectedItem = null;
       this.ViewEditContent.Content = null;
       ((CslaDataProvider)Resources["ProductList"]).Refresh();
     };
   InvLib.ProductList.ClearCache();
   dp.BeginDelete(new Csla.SingleCriteria<InvLib.ProductEdit, int>(_selectedItem.Id));
 }
Exemplo n.º 5
0
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            MarkBusy(true);
            var dp = new Csla.DataPortal <InvLib.ProductEdit>();

            dp.DeleteCompleted += (o, e1) =>
            {
                MarkBusy(false);
                _selectedItem = null;
                this.ViewEditContent.Content = null;
                ((CslaDataProvider)Resources["ProductList"]).Refresh();
            };
            InvLib.ProductList.ClearCache();
            dp.BeginDelete(new Csla.SingleCriteria <InvLib.ProductEdit, int>(_selectedItem.Id));
        }
Exemplo n.º 6
0
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // set _selectedItem
            var lb = sender as ListBox;

            if (lb != null && lb.SelectedItem != null)
            {
                _selectedItem = lb.SelectedItem as InvLib.ProductInfo;
            }
            EditButton.IsEnabled   = _selectedItem != null;
            DeleteButton.IsEnabled = _selectedItem != null;

            // display product view
            if (_selectedItem != null)
            {
                DisplayProductView();
            }
        }