示例#1
0
 public void DoIt(Order o, User u)
 {
     if (!(ValidateUser(u) && ValidateOrder(o)))
     {
         throw new ArgumentException("...");
     }
     Save(u);
     Save(o);
 }
示例#2
0
 public void Save(Order o)
 {
     OpenDatabase();
     string sql;
     if (o.IsNew)
     {
         sql = GetOrderInsertSql();
     } else
     {
         sql = GetOrderUpdateSql();
     }
     Execute(sql, o);
     CloseDatabase();
 }
示例#3
0
 public bool ValidateOrder(Order o)
 {
     return false;
 }