示例#1
0
 public void Add(Product Item, List <SerialNumber> serialnums)
 {
     Item.ProductType = ProductTypeRepo.FindByName(Item.ProductTypeName);
     if (Item.ProductType == null)
     {
         Item.ProductType      = new ProductType();
         Item.ProductType.Type = Item.ProductTypeName;
     }
     Item.Provider      = ProviderRepo.FindByName(Item.ProviderName);
     Item.SerialNumbers = new Collection <SerialNumber>();
     Item.SerialNumbers = serialnums;
     Repo.Save(Item);
     Unit.SaveChanges();
 }