private void processOrder(Order order) { DataRow_order row = (DataRow_order)DTS.t_my_takingPositions.FindByID(order.transactionid); if (row != null) { DTS.t_my_takingPositions.Remove_Row(row); } DTS.t_my_takingPositions.AcceptChanges(); DTS.t_my_takingPositions.Add_Row(order.seccode, order.buysell, order.price, order.status, order.transactionid); DTS.t_my_takingPositions.AcceptChanges(); }
//-------------------------------------------------------------------------------- public DataRow_order Add_Row(string security_code, string buysell, double price, string status, int transactionId) { DataRow_order row = (DataRow_order)NewRow(); object[] aValues = new object[] { security_code, buysell, price, status, transactionId }; row.ItemArray = aValues; Rows.Add(row); return(row); }
//-------------------------------------------------------------------------------- public void Remove_Row(DataRow_order row) { Rows.Remove(row); }
//-------------------------------------------------------------------------------- public void Add_Row(DataRow_order row) { Rows.Add(row); }