本文整理汇总了C#中Price类的典型用法代码示例。如果您正苦于以下问题:C# Price类的具体用法?C# Price怎么用?C# Price使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Price类属于命名空间,在下文中一共展示了Price类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetItemPriceModel
/// <summary>
/// Gets the item price model.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="lowestPrice">The lowest price.</param>
/// <param name="tags">Additional tags for promotion evaluation</param>
/// <returns>price model</returns>
/// <exception cref="System.ArgumentNullException">item</exception>
public PriceModel GetItemPriceModel(Item item, Price lowestPrice, Hashtable tags)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
if (lowestPrice == null)
{
return new PriceModel();
}
var price = lowestPrice.Sale ?? lowestPrice.List;
var discount = _client.GetItemDiscountPrice(item, lowestPrice, tags);
var priceModel = CreatePriceModel(price, price - discount, UserHelper.CustomerSession.Currency);
priceModel.ItemId = item.ItemId;
//If has any variations
/* performance too slow with this method, need to store value on indexing instead
if (CatalogHelper.CatalogClient.GetItemRelations(item.ItemId).Any())
{
priceModel.PriceTitle = "Starting from:".Localize();
}
* */
return priceModel;
}
开发者ID:karpinskiy,项目名称:vc-community,代码行数:33,代码来源:MarketingHelper.cs
示例2: ToViewModel
public static Product ToViewModel(this DataContracts.Product product, Price price)
{
var productViewModel = new Product();
if (product.EditorialReviews != null)
{
var editorialReview = product.EditorialReviews.FirstOrDefault(er => !string.IsNullOrEmpty(er.ReviewType) && er.ReviewType.Equals("quickreview", StringComparison.OrdinalIgnoreCase));
if (editorialReview != null)
{
productViewModel.Description = editorialReview.Content;
}
}
if (product.PrimaryImage != null)
{
productViewModel.FeaturedImage = product.PrimaryImage.ToViewModel();
}
productViewModel.Id = product.Id;
productViewModel.Price = price;
productViewModel.Sku = product.Code;
if (product.Seo != null)
{
var seo = product.Seo.FirstOrDefault(s => !string.IsNullOrEmpty(s.Keyword));
if (seo != null)
{
productViewModel.Slug = seo.Keyword;
}
}
productViewModel.Title = product.Name;
return productViewModel;
}
开发者ID:VirtoCommerce,项目名称:vc-orchard-cms,代码行数:35,代码来源:ProductConverter.cs
示例3: TestAddition
public void TestAddition()
{
var testPrice1 = new Price(100, CurrencyCode.USD);
var testPrice2 = new Price(100, CurrencyCode.RUB);
var testPrice3 = new Price(102.674, CurrencyCode.USD);
Assert.AreEqual(testPrice1 + testPrice2, testPrice3);
}
开发者ID:DmitryKiselyov96,项目名称:INISP-3rd-semester,代码行数:7,代码来源:PriceTest.cs
示例4: AddPrice
public HtmlString AddPrice(List<Price> oldPrices, Price newPrice)
{
List<Price> result = new List<Price>();
DateTime endingDatePrevious = newPrice.StartingDate.AddDays(-1);
if (oldPrices != null)
{
if (oldPrices.All(price => !price.EndingDate.HasValue || newPrice.StartingDate > price.EndingDate.Value))
{
Price currentPrice = oldPrices.FirstOrDefault(price => !price.EndingDate.HasValue);
if (currentPrice != null)
{
currentPrice.EndingDate = endingDatePrevious;
}
}
else
{
Price currentPrice = oldPrices.FirstOrDefault(price => price.EndingDate > newPrice.StartingDate);
DateTime? oldEndingDate = currentPrice.EndingDate;
currentPrice.EndingDate = endingDatePrevious;
if (newPrice.EndingDate.HasValue && oldEndingDate > newPrice.EndingDate.Value)
{
result.Add(new Price() { Article = currentPrice.Article, BasePrice = currentPrice.BasePrice, StartingDate = newPrice.EndingDate.Value.AddDays(1), EndingDate = oldEndingDate });
}
}
result.AddRange(oldPrices);
}
result.Add(newPrice);
return result.ToHtmlJson();
}
开发者ID:Csluikidikilest,项目名称:Bm2sBO,代码行数:33,代码来源:ArticlesController.cs
示例5: OriginQuotation
public OriginQuotation(Instrument instrument, CollectorQuotation cq)
{
this.modifyState = ModifyState.Added;
this.instrument = instrument;
this.timestamp = cq.Timestamp;
this.ask = Price.CreateInstance(cq.Ask, instrument.NumeratorUnit, instrument.Denominator);
this.bid = Price.CreateInstance(cq.Bid, instrument.NumeratorUnit, instrument.Denominator);
this.high = Price.CreateInstance(cq.High, instrument.NumeratorUnit, instrument.Denominator);
this.low = Price.CreateInstance(cq.Low, instrument.NumeratorUnit, instrument.Denominator);
this.volume = cq.Volume;
this.totalVolume = cq.TotalVolume;
this.origin = instrument.CalculateOrigin(this.ask, this.bid, instrument.OriginQReceived != null);
//Special handle, it's not so strict
//NOTE: Has problem for session clear !
if (this.origin == null && instrument.OriginQReceived != null)
{
if (this.ask == null) this.ask = this.instrument.OriginQReceived.ask;
if (this.bid == null) this.bid = this.instrument.OriginQReceived.bid;
this.origin = instrument.CalculateOrigin(this.ask, this.bid, false);
}
this.FilterErrorHighLow(instrument, false);
}
开发者ID:BlueSky007,项目名称:ExchangeManager,代码行数:27,代码来源:OriginQuotation.cs
示例6: CaptureAction
public static CaptureResponse CaptureAction(OffAmazonPaymentsServicePropertyCollection propertiesCollection,
IOffAmazonPaymentsService service, string amazonAuthorizationId, string orderAmount, string orderReferenceId, int indicator, string providerId, string creditAmountString)
{
//initiate the capture request
CaptureRequest captureRequest = new CaptureRequest();
captureRequest.SellerId = propertiesCollection.MerchantID;
captureRequest.AmazonAuthorizationId = amazonAuthorizationId;
Price price = new Price();
price.Amount = orderAmount;
price.CurrencyCode = propertiesCollection.CurrencyCode;
captureRequest.CaptureAmount = price;
captureRequest.CaptureReferenceId = orderReferenceId.Replace('-', 'c') + "captureRef" + indicator.ToString();
if (!String.IsNullOrEmpty(providerId) && !String.IsNullOrEmpty(creditAmountString))
{
ProviderCredit providerCredit = new ProviderCredit();
providerCredit.ProviderId= providerId;
Price creditAmount = new Price();
creditAmount.Amount = creditAmountString;
creditAmount.CurrencyCode = propertiesCollection.CurrencyCode;
providerCredit.CreditAmount= creditAmount;
ProviderCreditList providerCreditList = new ProviderCreditList();
providerCreditList.member = new List<ProviderCredit>();
providerCreditList.member.Add(providerCredit);
captureRequest.ProviderCreditList = providerCreditList;
}
return CaptureSample.InvokeCapture(service, captureRequest);
}
开发者ID:Georotzen,项目名称:login-and-pay-with-amazon-sdk-csharp,代码行数:30,代码来源:CaptureSample.cs
示例7: Decode
public static Price Decode(IByteReader stream)
{
Price decodedPrice = new Price();
decodedPrice.N = Int32.Decode(stream);
decodedPrice.D = Int32.Decode(stream);
return decodedPrice;
}
开发者ID:FihlaTV,项目名称:csharp-stellar-base,代码行数:7,代码来源:Price.cs
示例8: fromApp
public void fromApp(QuickFix.Message message, SessionID sessionID)
{
// receiving messages
Symbol sym = new Symbol();
message.getField(sym);
Tick k = new TickImpl(sym.getValue());
{
// bid
BidPx bp = new BidPx();
BidSize bs = new BidSize();
k.bid = (decimal)bp.getValue();
k.bs = (int)message.getField(bs).getValue();
}
{
// ask
OfferPx op = new OfferPx();
OfferSize os = new OfferSize();
k.ask = (decimal)op.getValue();
k.os = (int)message.getField(os).getValue();
}
{
// last
Price price = new Price();
message.getField(price);
k.trade = (decimal)price.getValue();
}
tl.newTick(k);
//ClOrdID clOrdID = new ClOrdID();
//message.getField(clOrdID);
}
开发者ID:bluejack2000,项目名称:core,代码行数:34,代码来源:ServerQuickFix.cs
示例9: frmNewMember
public frmNewMember()
{
InitializeComponent();
price = new Price();
members = new Member();
cards = new Cards();
cardUsage = new CardUsage();
}
开发者ID:Stocolmo79,项目名称:Heroko-Rima,代码行数:8,代码来源:frmNewMember.cs
示例10: Order
internal Order(
Price price, OrderState state, Uid market, Uid contract, Side side)
{
Price = price;
State = state;
Market = market;
Contract = contract;
Side = side;
}
开发者ID:adamashton,项目名称:IronSmarkets,代码行数:9,代码来源:Order.cs
示例11: GetFristCol
public Stock GetFristCol(string data)
{
List<Price> prices = new List<Price>();
List<DataItem> items = new List<DataItem>();
string firstCol = string.Empty;
List<string> lines = data.Split('\n').ToList<string>();
for (int i = 2; i < lines.Count; i++)
{
string line = lines[i];
List<string> numStrs = line.Split(' ').ToList<string>();
if (numStrs.Count < 5)
continue;
DataItem item = new DataItem();
Price price = new Price();
price.content = new string[4];
for (int numI = 0; numI < numStrs.Count; numI++)
{
if (numI == 0)
item.content = numStrs[numI];
if (numI > 0 && numI < 5)
{
price.content[numI-1] = numStrs[numI];
if (numI == 3)
{
price.content[numI-1] = numStrs[numI+1];
}
if (numI == 4)
{
price.content[numI - 1] = numStrs[numI-1];
}
}
// if (numI > 0 && numI < 4)
//price.content += ",";
}
items.Add(item);
prices.Add(price);
}
Stock stock = new Stock();
stock.price = new Price[prices.Count];
for (int itemI = 0; itemI < items.Count; itemI++)
{
stock.data += items[itemI].content;
if (itemI != items.Count - 1)
stock.data += ",";
}
for (int priceI = 0; priceI < prices.Count; priceI++)
{
stock.price[priceI] = prices[priceI]; // += "[" + prices[priceI].content + "]";
//if (priceI != prices.Count - 2)
// stock.price += ";";
}
// stock.data = "[" + stock.data + "]";
// stock.price = "[" + stock.price + "]";
return stock;
}
开发者ID:heavenlw,项目名称:Ebank,代码行数:57,代码来源:stockController.cs
示例12: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
this.Price = Recruit.GetPrice(TroopType.Nobleman);
int heroCount = this.Village.Heroes.Count + 1;
this.Price = new Price(this.Price.Name, 0, this.Price.Wood * heroCount, this.Price.Clay * heroCount, this.Price.Iron * heroCount, this.Price.Population);
}
开发者ID:DF-thangld,项目名称:web_game,代码行数:10,代码来源:CreateHero.ascx.cs
示例13: NavPosition
public NavPosition(InstrumentSize Size, Price ClosingPriceUsed, Decimal ExchangeRateUsed,
IPriceDetail ClosingPriceRecord, IExRate ExchangeRateRecord)
{
this.Size = Size;
this.ClosingPriceUsed = ClosingPriceUsed;
this.ExchangeRateUsed = ExchangeRateUsed;
this.ClosingPriceRecord = ClosingPriceRecord;
this.ExchangeRateRecord = ExchangeRateRecord;
setCurrentValue();
setCurrentBaseValue();
}
开发者ID:kiquenet,项目名称:B4F,代码行数:11,代码来源:NavPosition.cs
示例14: ToViewModel
public static Price ToViewModel(this DataContracts.Price price)
{
var priceModel = new Price();
priceModel.PricelistId = price.PricelistId;
priceModel.Original = price.List;
priceModel.ProductId = price.ProductId;
priceModel.Sale = price.Sale;
return priceModel;
}
开发者ID:priaonehaha,项目名称:vc-orchard-cms,代码行数:11,代码来源:PriceConverter.cs
示例15: AddPrice
public bool AddPrice(Price price)
{
bool canAddPrice = IsUniquePrice(price);
if (canAddPrice)
{
ticketsDataSet.Price.AddPriceRow(price.Value);
provider.UpdateAllData();
return true;
}
return false;
}
开发者ID:AndreyKis,项目名称:TicketsOrderLinqSQL,代码行数:11,代码来源:AccessToTicketsDB(Price).cs
示例16: QuotePolicyDetail
public QuotePolicyDetail(Instrument instrument, DataRow quotePolicy)
{
this.id = (Guid)quotePolicy["QuotePolicyID"];
this.priceType = (PriceType)(byte)quotePolicy["PriceType"];
this.autoAdjustPoints = (int)quotePolicy["AutoAdjustPoints"];
this.spreadPoints = (int)quotePolicy["SpreadPoints"];
this.isOriginHiLo = (bool)quotePolicy["IsOriginHiLo"];
this.overrideHigh = null;
this.overrideLow = null;
this.SetCrossRef(instrument);
}
开发者ID:BlueSky007,项目名称:ExchangeManager,代码行数:12,代码来源:QuotePolicyDetail.cs
示例17: PriceModel
public PriceModel(Price price)
: this()
{
if (price != null)
{
Price = price;
}
else
{
Price = default(Price);
}
}
开发者ID:smchristenson,项目名称:CommerceStarterKit,代码行数:12,代码来源:PriceModel.cs
示例18: TestPriceGoEqual
public void TestPriceGoEqual()
{
var price = new Price()
{
AskPx = 1,
BidPx = 1
};
price.AskPx = 1;
price.BidPx = 1;
var b = new PriceCellBackgroundConverter().Convert(new[] { (object)price.AskPx, (object)price.AskPxOld }, null, null, null);
Assert.AreEqual("#FFFFFFFF", b.ToString());
}
开发者ID:Kunone,项目名称:Akuna.Price,代码行数:12,代码来源:PriceColorAlgoTest.cs
示例19: InvoiceLine
public InvoiceLine()
{
CreditedQuantity = new InvoicedQuantity();
InvoicedQuantity = new InvoicedQuantity();
DebitedQuantity = new InvoicedQuantity();
LineExtensionAmount = new PayableAmount();
PricingReference = new PricingReference();
AllowanceCharge = new AllowanceCharge();
TaxTotals = new List<TaxTotal>();
Item = new Item();
Price = new Price();
}
开发者ID:charlencalero,项目名称:facturacionelectronicasunat,代码行数:12,代码来源:InvoiceLine.cs
示例20: DeletePrice
public bool DeletePrice(Price price)
{
bool canDeletePrice = IsUsedPrice(price);
if (canDeletePrice)
{
Tr_Tick_DBDataSet.PriceRow row = ticketsDataSet.Price.FindBypprice_id(price.ID);
row.Delete();
//ticketsDataSet.Price.RemovePriceRow(row);
provider.UpdateAllData();
return true;
}
return false;
}
开发者ID:AndreyKis,项目名称:TicketsOrderLinqSQL,代码行数:13,代码来源:AccessToTicketsDB(Price).cs
注:本文中的Price类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论