Esempio n. 1
0
 public static SuggestedBid ParseWithCurrency(string bidStringFromUI)
 {
     SuggestedBid bid = new SuggestedBid();
     if (!bidStringFromUI.Contains('-'))
     {
         throw new Exception("There is no suggested bid!");
     }
     bid.Currency = bidStringFromUI.Split(' ').Last();
     string[] suggestedBid = bidStringFromUI.Replace(bid.Currency, string.Empty).Split('-');
     double from, to;
     parse(bidStringFromUI.Replace(bid.Currency, string.Empty), out from, out to);
     bid.SuggestedBidFrom = from;
     bid.SuggestedBidTo = to;
     return bid;
 }
Esempio n. 2
0
 public static SuggestedBid Parse(string bidStringInGrid)
 {
     SuggestedBid bid = new SuggestedBid();
     if (!bidStringInGrid.Contains('-'))
     {
         throw new Exception("There is no suggested bid!");
     }
     if (bidStringInGrid == " - ")
     {
         bid.IsEmpty = true;
         return bid;
     }
     double from, to;
     parse(bidStringInGrid, out from, out to);
     bid.SuggestedBidFrom = from;
     bid.SuggestedBidTo = to;
     bid.IsEmpty = false;
     return bid;
 }