Ejemplo n.º 1
0
 public static void SaveHeader(MySql.Data.MySqlClient.MySqlCommand cmd, StockCard sc)
 {
     cmd.CommandText = sc.GetInsertSQL();
     cmd.ExecuteNonQuery();
     cmd.CommandText = StockCard.SelectMaxIDSQL();
     sc.ID           = Convert.ToInt32(cmd.ExecuteScalar());
 }
Ejemplo n.º 2
0
 public static void Save(MySql.Data.MySqlClient.MySqlCommand cmd, StockCard sc)
 {
     cmd.CommandText = sc.GetInsertSQL();
     cmd.ExecuteNonQuery();
     cmd.CommandText = StockCard.SelectMaxIDSQL();
     sc.ID           = Convert.ToInt32(cmd.ExecuteScalar());
     foreach (StockCardEntry sce in sc.STOCK_CARD_ENTRIES)
     {
         cmd.CommandText = sce.GetInsertSQL();
         cmd.ExecuteNonQuery();
         cmd.CommandText = StockCardEntry.SelectMaxIDSQL();
         sce.ID          = Convert.ToInt32(cmd.ExecuteScalar());
     }
 }