private void initDutyTable() { DataClassesDataContext db = new DataClassesDataContext(); FillTable ft = new FillTable(10, 7); ft.creatDataArray(db.Duty.ToList()); ft.fillDataArrayToTable(DutyTable,NoValueDisplay.NoValueString); }
private void initDutyTable(string id) { DataClassesDataContext db = new DataClassesDataContext(); FillTable ft = new FillTable(10, 7); ft.creatDataArray(db.Duty.Where(dutys=>dutys.assistantID==id).ToList()); ft.fillDataArrayToTable(DutyTable,NoValueDisplay.Nothing); }
public void FillTableConstructorTest() { FillTable fillTable = new FillTable(5, 5); Assert.IsTrue(fillTable.RowNum == 5, "Table's rowNum is wrong!"); Assert.IsTrue(fillTable.ColNum == 5, "Table's colNum is wrong!"); }
private void initDutyTable() { DataClassesDataContext db = new DataClassesDataContext(); FillTable ft = new FillTable(10, 7); ft.creatDataArray(db.Duty.ToList()); ft.fillDataArrayToTable(DutyTable, NoValueDisplay.NoValueString); }
private void initDutyTable(string id) { DataClassesDataContext db = new DataClassesDataContext(); FillTable ft = new FillTable(10, 7); ft.creatDataArray(db.Duty.Where(dutys => dutys.assistantID == id).ToList()); ft.fillDataArrayToTable(DutyTable, NoValueDisplay.Nothing); }
public void fillDataArrayToTableTest() { DataClassesDataContext db = new DataClassesDataContext("Data Source=FIREFLY-PC;Initial Catalog=LASDB;Integrated Security=True"); FillTable ft = new FillTable(10, 7); Table table = new Table(); ft.creatDataArray(db.Duty.ToList()); ft.fillDataArrayToTable(table, NoValueDisplay.NoValueString); Assert.IsNotNull(table); }
public void creatDataArrayTest() { FillTable fillTable = new FillTable(10, 7); DataClassesDataContext db = new DataClassesDataContext("Data Source=FIREFLY-PC;Initial Catalog=LASDB;Integrated Security=True"); List<Duty> dutys = db.Duty.ToList(); fillTable.creatDataArray(db.Duty.ToList()); foreach (Duty duty in dutys) { Assert.IsTrue(fillTable.DataArray[duty.time][duty.day - 1].Any(d=> d==duty.Assistants.name)); } }
public void creatDataArrayTest() { FillTable fillTable = new FillTable(10, 7); DataClassesDataContext db = new DataClassesDataContext("Data Source=FIREFLY-PC;Initial Catalog=LASDB;Integrated Security=True"); List <Duty> dutys = db.Duty.ToList(); fillTable.creatDataArray(db.Duty.ToList()); foreach (Duty duty in dutys) { Assert.IsTrue(fillTable.DataArray[duty.time][duty.day - 1].Any(d => d == duty.Assistants.name)); } }
private void ClientGotOrderFilled(Trade k) { _tradelist.Add(k); System.Windows.Application.Current.Dispatcher.Invoke(() => { // order table int pos = OrderTable.Select(row => row.OrderId).ToList().IndexOf(k.Id); if (pos == -1) { OnDebug("Order id " + k.Id.ToString() + " is not found in order table; possibly new order."); } else { _ordertracker.GotFill(k); if (_ordertracker[k.Id] == 0) { OrderStatus status = OrderStatus.Filled; OrderTable[pos].Status = EnumDescConverter.GetEnumDescription(status); } else { OrderStatus status = OrderStatus.PartiallyFilled; _ordertable[pos].Status = EnumDescConverter.GetEnumDescription(status); } } // position table only handles one account // but it is guarantteed by order id _positiontracker.Adjust(k); pos = PositionTable.Select(row => row.Symbol).ToList().IndexOf(k.FullSymbol); if (pos == -1) { // add new position int count = PositionTable.Count; PositionTable.Add(new PositionEntry(count, k.FullSymbol, _positiontracker[k.FullSymbol].AvgPrice, _positiontracker[k.FullSymbol].Size, _positiontracker[k.FullSymbol].ClosedPL, _positiontracker[k.FullSymbol].OpenPL)); } else { // adjust position PositionTable[pos].AvgPrice = _positiontracker[k.FullSymbol].AvgPrice; PositionTable[pos].Size = _positiontracker[k.FullSymbol].Size; PositionTable[pos].ClosePL = _positiontracker[k.FullSymbol].ClosedPL; PositionTable[pos].OpenPL = _positiontracker[k.FullSymbol].OpenPL; } FillTable.Add(new FillEntry(k.Id, k.TradeTime, k.FullSymbol, k.TradeSize, k.TradePrice)); }); }
public void FillTableConstructorTest() { FillTable fillTable = new FillTable(5,5); Assert.IsTrue(fillTable.RowNum==5,"Table's rowNum is wrong!"); Assert.IsTrue(fillTable.ColNum == 5, "Table's colNum is wrong!"); }