Beispiel #1
0
 /// <summary>
 /// Updates the entity with the values contained within the surrogate.
 /// </summary>
 /// <param name="entity">The entity.</param>
 public void BindObjectInstance(Inventory entity)
 {
     if (entity.Row.RowState == DataRowState.Added)
     {
     entity.ProductID = ProductID;
     entity.StockOnHand = StockOnHand;
     }
     else
     {
     if (_productidHasBeenUpdated)
     {
         entity.ProductID = ProductID;
     }
     if (_stockonhandHasBeenUpdated)
     {
         entity.StockOnHand = StockOnHand;
     }
     }
 }
Beispiel #2
0
 /// <summary>Constructor for assembling a surrogate from an entity object.</summary>
 /// <param name="entity">The Entity Object.</param>
 public InventorySurrogate(Inventory entity)
     : base(entity)
 {
     _sb = new StringBuilder();
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InventorySurrogateBase"/> class.
 /// </summary>
 /// <param name="entity">The entity.</param>
 public InventorySurrogateBase(Inventory entity)
 {
     InventoryID = entity.InventoryID;
     ProductID = entity.ProductID;
     StockOnHand = entity.StockOnHand;
 }