Пример #1
0
 private ObservableCollection <OrgElementViewModel> GetChildren()
 {
     children = new ObservableCollection <OrgElementViewModel>();
     //get the list of children from Model
     foreach (Node i in ProductHierarchy.Instance().GetChildren(this.ID))
     {
         children.Add(new OrgElementViewModel(i));
     }
     return(children);
 }
Пример #2
0
        public ProductHierarchy Update(ProductHierarchy productHierarchy)
        {
            var newProductHierarchy = _context.ProductHierarchy.Update(productHierarchy);

            if (newProductHierarchy != null && newProductHierarchy.State == EntityState.Added)
            {
                var affectedRows = _context.SaveChanges();

                if (affectedRows > 0)
                {
                    return(newProductHierarchy.Entity);
                }
            }

            return(null);
        }