/// <summary> /// перейти на страничку сигнальщика /// </summary> private void LblAccountClick(object sender, EventArgs e) { if (service == null || service.AccountId == null) return; PerformerStat performer; try { performer = TradeSharpAccountStatistics.Instance.proxy.GetPerformerByAccountId(service.AccountId.Value); } catch (Exception ex) { Logger.Error("LblAccountClick.GetPerformerByAccountId(" + service.AccountId.Value + ")", ex); return; } MainForm.Instance.EnsureSubscriptionForm(SubscriptionControl.ActivePage.Subscription); var form = new SubscriberStatisticsForm(performer); form.EnterRoomRequested += SubscriptionForm.EnterRoom; form.Show(this); }
private void GridOpenPosUserHitCell(object sender, MouseEventArgs e, int rowIndex, FastColumn col) { if (rowIndex < 0 || rowIndex >= gridOpenPos.rows.Count) return; var order = gridOpenPos.rows[rowIndex].ValueObject as MarketOrder; if (order == null) return; // показать информацию по сигналу if (e.Button == MouseButtons.Left && col.PropertyName == order.Property(o => o.ExpertComment)) { int signalCatId, orderId; if (!MarketOrder.GetTradeSignalFromDeal(order, out signalCatId, out orderId)) return; // получить счет перформера по кат. сигнала PerformerStat stat; try { stat = TradeSharpAccountStatistics.Instance.proxy.GetPerformerStatBySignalCatId(signalCatId); } catch (Exception ex) { MessageBox.Show(Localizer.GetString("MesssageCanNotGetSubscribersInfo")); Logger.Info("ShowSignallerStat", ex); return; } if (stat == null) return; var form = new SubscriberStatisticsForm(stat); form.Show(this); return; } var selectedCount = gridOpenPos.rows.Count(r => r.Selected); CloseAllBtn.Text = "Закрыть все"; if (selectedCount == 1) { var selRows = gridOpenPos.rows.Where(r => r.Selected).ToList(); var deal = ((MarketOrder)selRows[0].ValueObject); if (deal.State != PositionState.Opened) { EditOrderBtn.Enabled = false; CloseAllBtn.Enabled = true; ClosePositionBtn.Enabled = false; } else { EditOrderBtn.Enabled = true; ClosePositionBtn.Enabled = true; } } if (e.Button == MouseButtons.Right) { if (selectedCount == 0) { EditOrderBtn.Enabled = false; CloseAllBtn.Enabled = true; ClosePositionBtn.Enabled = false; } return; } // редактировать ордер if (e.Clicks == 2) { EditOrderBtnClick(this, e); //return; } }
private void ShowSignallerStat(Contract.Entity.Subscription cat) { // получить счет перформера по кат. сигнала PerformerStat stat = null; try { stat = TradeSharpAccountStatistics.Instance.proxy.GetPerformerStatBySignalCatId(cat.Service); } catch (Exception ex) { MessageBox.Show(Localizer.GetString("MessageCannotGetSubscribersInfo")); Logger.Info("ShowSignallerStat", ex); return; } if (stat == null) return; var form = new SubscriberStatisticsForm(stat); //form.EnterRoomRequested += OnEnterRoomRequested; form.Show(this); }