Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public void Save(){
  2. //validate
  3. if (this.OrderItems.Count == 0)
  4. throw new Exception ("You need at least one order item");
  5.  
  6. //so the user code does not have to do this
  7. this.DateTimeModified = DateTime.Now;
  8.  
  9. saveToDataBase();
  10.  
  11. //after saving to the DB, the order amount is greater than $3000, notify certain people
  12. if (OrderAmount >= 3000)
  13. notifyPersonell();
  14. }
  15.  
  16. order.ValidateOrder();
  17. context.SaveChanges();
  18. order.AfterOrderChanged();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement