private void HomePageForm_AccountUpdate() { if (Broker.Instance.IsSignedIn()) { Broker.Instance.GetAccountInfo((account) => { // Set the account buying power BeginInvoke((Action)(() => { CashLabel.Text = string.Format("{0:c}", account.TotalValue); decimal open = 1; decimal current = account.TotalValue; decimal delta = current - open; ChangeLabel.Text = string.Format("{0}{1:c} ({2:P2})", (delta >= 0) ? "+" : "-", delta, (delta / open)); SummaryTotalLabel.Text = string.Format("Total\n{0:c}", current); SummaryBuyingPowerLabel.Text = string.Format("Buying Power\n{0:c}", account.BuyingPower); })); // Set the list of positions Dictionary <string, decimal> positions = Broker.Instance.GetPositions(); StockListHome.Clear(StockList.POSITIONS); foreach (KeyValuePair <string, decimal> pair in positions) { StockListHome.Add(StockList.POSITIONS, pair.Key, new StockList.PositionChangeSummary(DataAccessor.Subscribe(pair.Key, DataAccessor.SUBSCRIBE_FIVE_SEC))); } }); } }
private void _NewStockViewModel_TabClosed(object sender, EventArgs e) { StockList.Clear(); switch (TransactionObject.TransactionType) { case TransactionType.Purchase: PurchaseOBJ.UpdateCurrentObject(); foreach (var item in PurchaseOBJ.LinkedStock) { StockList.Add(item); } break; case TransactionType.Sale: PurchaseOBJ.UpdateCurrentObject(); foreach (var item in SaleOBJ.StockList) { StockList.Add(item); } break; // case TransactionType.Refund: } }
private void getStockListCallback(IEnumerable <string> stockList) { StockList.Clear(); foreach (string s in stockList) { StockList.Add(s); } }
private async Task Restore() { using (DataBaseHelper dbh = new DataBaseHelper()) { if (this.IsVisible) { var res = await dbh.GetStocks(); StockList.Clear(); foreach (var stock in res) { StockList.Add(stock); } } } }
private void LinkExtraStock() { switch (TransactionObject.TransactionType) { case TransactionType.Purchase: try { Stocky.UI.Enviroment.LoadDialog("StockLingView", TransactionObject, "TRANLEDGEROBJ"); PurchaseOBJ.UpdateCurrentObject(); StockList.Clear(); foreach (var item in PurchaseOBJ.LinkedStock) { StockList.Add(item); } } catch (Exception E) { ExepionLogger.Logger.LogException(E); ExepionLogger.Logger.Show(E); } break; case TransactionType.Sale: try { Stocky.UI.Enviroment.LoadDialog("StockLingView", TransactionObject, "TRANLEDGEROBJ"); SaleOBJ.UpdateCurrentObject(); StockList.Clear(); foreach (var item in SaleOBJ.StockList) { StockList.Add(item); } } catch (Exception E) { ExepionLogger.Logger.LogException(E); ExepionLogger.Logger.Show(E); } break; } }
public void Refresh(bool refr_1 = true, bool refr_2 = true, bool refr_3 = true) { if (refr_1) { GoodsList.Clear(); GoodsList.AddRange(PubMaster.Mod.GoodSql.QueryGoodsList()); } if (refr_2) { StockList.Clear(); StockList.AddRange(PubMaster.Mod.GoodSql.QueryStockList()); } if (refr_3) { StockSumList.Clear(); StockSumList.AddRange(PubMaster.Mod.GoodSql.QueryStockSumList()); } }
// Uses Firestore service for reading stocks available on the market public async Task <bool> ReadStocks() { var stocks = await FirestoreDatabase.RetrieveStock(""); StockList.Clear(); foreach (var s in stocks) { StockList.Add(s); } IsLoading = false; OnPropertyChanged("StockList"); // No stocks on the market if (StockList.Count == 0) { ShowNoStocks = true; OnPropertyChanged("ShowNoStocks"); } return(true); }
/// <summary> /// 조회 함수 /// </summary> void SearchStock() { try { var strStartDate = this.BaseClass.GetCalendarValue(this.searchStart); var strEndDate = this.BaseClass.GetCalendarValue(this.searchEnd); var param = new Dictionary <string, object> { { "P_CENTER_CD", this.BaseClass.CenterCD }, { "P_FROM_DT", strStartDate }, { "P_TO_DT", strEndDate } }; var strOutParam = new[] { "P_EMS_STOCK_LIST" }; //string callProc = "PK_EMS_ESPA002.SP_EMS_STOCK_SEL"; string callProc = "PK_EMS_ESPA002.SP_EMS_STOCK_PERIOD_SEL"; using (BaseDataAccess da = new BaseDataAccess()) { var outData = da.GetSpDataSet( callProc // 호출 프로시저 , param // Input 파라메터 , strOutParam // Output 파라메터 ); if (null != StockList) { StockList.Clear(); StockList = null; } StockList = new ObservableCollection <EmsStock>(); if (outData.Tables[0].Rows.Count > 0) { StockList.ToObservableCollection(outData.Tables[0]); //this.ChangeStatusLabelEvent(HelperClass.GetMessageByCountryCode("CMPT_INQ")); } else { //this.ChangeStatusLabelEvent(HelperClass.GetMessageByCountryCode("NO_INQ_DATA")); } gridMain.ItemsSource = StockList; if (outData.Tables[0].Rows.Count > 0) { if (-1 < focused_handle) { gridMain.View.FocusedRowHandle = focused_handle; gridMain.SelectedItem = (gridMain.ItemsSource as ObservableCollection <EmsStock>)[focused_handle]; } else { gridMain.View.FocusedRowHandle = 0; gridMain.SelectedItem = (gridMain.ItemsSource as ObservableCollection <EmsStock>)[0]; } EmsStock target = gridMain.SelectedItem as EmsStock; if (null != target) { CurrentStock = target; SearchStockDetail(target.STOCK_INSP_DT); } } else { CurrentStock = null; if (null != CurrentStockDetail) { CurrentStockDetail.Clear(); CurrentStockDetail = null; } } this.btnConfirmHigh.IsEnabled = true; this.btnSaveHigh.IsEnabled = true; this.btnAddHigh.IsEnabled = true; this.btnRowDeleteHigh.IsEnabled = true; } } catch (Exception ex) { this.BaseClass.Error(ex); this.BaseClass.MsgError(ex.Message, BaseEnumClass.CodeMessage.MESSAGE); } }