예제 #1
0
        /// <summary>
        /// Грузим список бумаг по всем аккаунтам
        /// </summary>
        /// <returns></returns>
        public async Task DoLoad_Portfail()
        {
            try
            {
                var acc = await Program.CurrentContext.AccountsAsync();

                foreach (var item in acc)
                {
                    var prtfl = await Program.CurrentContext.PortfolioAsync(item.BrokerAccountId);

                    Bounds lbd = new Bounds(new Account_m(item.BrokerAccountType, item.BrokerAccountId));
                    var    lpl = prtfl.Positions.Where(t => t.InstrumentType == InstrumentType.Bond).ToList();
                    foreach (var itm in lpl)
                    {
                        lbd.BoundsList.Add(new Bound_Conclav(new Bound(itm))); //лист сейчас. Для истории надо грузить через операции..
                    }
                    Portfolios.Add(lbd.Acc, lbd);
                }

                JobsDone?.Invoke(true);
            }
            catch (Exception ex)
            {
                JobsDone?.Invoke(false, ex.Message);
            }
        }
예제 #2
0
        public async Task doLoad()
        {
            try
            {
                JobsStatusSend?.Invoke("Load Account");
                var aa = await Static_info.CurrentContext.AccountsAsync();

                foreach (var item in aa)
                {
                    Portfaills.Add(new Portfaill(item.BrokerAccountId, item.BrokerAccountType));
                }
                Refresh();
                JobsStatusSend?.Invoke("Done");
                JobsDone?.Invoke(true);
            }
            catch (Exception ex)
            {
                JobsDone?.Invoke(false, ex.Message);
            }
        }
예제 #3
0
 protected virtual void OnJobsDone(JobQueueEmptyEventArgs e)
 {
     JobsDone?.Invoke(this, e);
 }