private string GetPlaceOfferResponse(InternalExchangeOfferResponse response, bool isAsk) { string message = string.Empty; if (response.AmountTransferd != decimal.Zero) { string amountTransferd = InternalExchangeManager.RecognizeCurrencyAndReturnString(true, FormatDecimal(response.AmountTransferd)); string valueTransferd = InternalExchangeManager.RecognizeCurrencyAndReturnString(false, FormatDecimal(response.ValueTransferd)); if (isAsk) { message += String.Format(U6012.SOLDSTOCKS, amountTransferd, valueTransferd); } else { message += String.Format(U6012.BOUGHTSTOCKS, amountTransferd, valueTransferd); } message += "<br />"; } if (response.AmountPlaced != decimal.Zero) { string amountPlaced = InternalExchangeManager.RecognizeCurrencyAndReturnString(true, FormatDecimal(response.AmountPlaced)); string valuePlaced = InternalExchangeManager.RecognizeCurrencyAndReturnString(false, FormatDecimal(response.ValuePlaced)); message += String.Format(U6012.NEWEXCHANGEOFFER, amountPlaced, valuePlaced); } return(message); }
protected void TransactionHistoryGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Label TransactionValue = new Label(); TransactionValue.Text = InternalExchangeManager.RecognizeCurrencyAndReturnString(false, (Decimal.Parse(e.Row.Cells[2].Text) * Decimal.Parse(e.Row.Cells[3].Text))); e.Row.Cells[2].Text = InternalExchangeManager.RecognizeCurrencyAndReturnString(true, e.Row.Cells[2].Text); e.Row.Cells[3].Text = InternalExchangeManager.RecognizeCurrencyAndReturnString(false, e.Row.Cells[3].Text); bool isAsk = !e.Row.Cells[6].Text.Equals(Member.CurrentId.ToString()); String SignA = isAsk ? "-" : "+"; String SignB = isAsk ? "+" : "-"; String Color = isAsk ? "red" : "green"; String OfferType = isAsk ? U6009.SELL : L1.BUY; e.Row.Style.Add("color", Color); TransactionValue.Text = String.Format("{0} {1}", SignB, TransactionValue.Text); e.Row.Cells[1].Text = OfferType.ToUpper(); e.Row.Cells[2].Text = String.Format("{0} {1}", SignA, e.Row.Cells[2].Text); e.Row.Cells[4].Controls.Add(TransactionValue); } }
private void UpdateGridViewTitles() { RightTitleBidOffersLabel.Text = String.Format("{0}: <b>{1}</b>", U5001.TOTAL, InternalExchangeManager.RecognizeCurrencyAndReturnString(true, InternalExchangeTransaction.GetSumOfStockForOffers(true))); RightTitleAskOffersLabel.Text = String.Format("{0}: <b>{1}</b>", U5001.TOTAL, InternalExchangeManager.RecognizeCurrencyAndReturnString(false, InternalExchangeTransaction.GetValueOfOffers(false))); }
private void UpdateStatistics() { UpdateStatisticsData(); SetStatisticForLabel(LastStockValue, tmpLastStockValue, tmpCurrentStockValue, String.Format("<b>{0}:</b> {1}", U6012.LAST.ToUpper(), InternalExchangeManager.RecognizeCurrencyAndReturnString(false, tmpLastStockValue))); SetStatisticForLabel(LastAskValue, tmpLastAskValue, tmpCurrentLastAskValue, String.Format("<b>{0} {1}:</b> {2}", U6012.LAST.ToUpper(), U6012.ASK.ToUpper(), InternalExchangeManager.RecognizeCurrencyAndReturnString(false, tmpLastStockValue))); SetStatisticForLabel(LastBidValue, tmpLastBidValue, tmpCurrentLastBidValue, String.Format("<b>{0} {1}:</b> {2}", U6012.LAST.ToUpper(), U6012.BID.ToUpper(), InternalExchangeManager.RecognizeCurrencyAndReturnString(false, tmpLastBidValue))); SetStatisticForLabel(Last24HighValue, tmpLast24HighValue, tmpCurrentLast24HighValue, String.Format("<b>24H {0}:</b> {1}", U6013.HIGH, InternalExchangeManager.RecognizeCurrencyAndReturnString(false, tmpLast24HighValue))); SetStatisticForLabel(Last24LowValue, tmpLast24LowValue, tmpCurrentLast24LowValue, String.Format("<b>24H {0}:</b> {1}", U6013.LOW, InternalExchangeManager.RecognizeCurrencyAndReturnString(false, tmpLast24LowValue))); SetStatisticForLabel(Last24Volume, tmpLast24Volume, tmpCurrentLast24Volume, String.Format("<b>24H</b> {0} %", Math.Round(tmpLast24Volume, 2))); }