public static void Delete(int number) { DataSet1.TradeDataTable tradeRows = GetTradeRows(); DataRow[] dataRows = tradeRows.Select(); int i; for (i = 0; i < dataRows.Length; i++) { if ((int)dataRows[i][15] == number) { break; } } tradeRows.Rows[i].Delete(); tradeRows.AcceptChanges(); tradeRows.WriteXml(filepath + "trade_data.xml"); }
public static void Modify(int number, DateTime ins, DateTime bill) { DataSet1.TradeDataTable tradeRows = GetTradeRows(); DataRow[] dataRows = tradeRows.Select(); int i; for (i = 0; i < dataRows.Length; i++) { if ((int)dataRows[i][15] == number) { break; } } tradeRows.Rows[i][11] = ins; tradeRows.Rows[i][12] = bill; tradeRows.Rows[i][13] = DateTime.Now; tradeRows.AcceptChanges(); tradeRows.WriteXml(filepath + "trade_data.xml"); }