private void SavePriceHistory(GameItem game) { PriceHistroy ph = new PriceHistroy(); ph.CheckDateTime = System.DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + "-" + DateTime.Now.Day.ToString("00") + " " + DateTime.Now.Hour.ToString("00") + ":" + DateTime.Now.Minute.ToString("00") + ":" + DateTime.Now.Second.ToString("00"); if (game.OriginalPrice == "") { ph.DiscountPrice = ""; ph.OriginalPrice = game.FinalPrice; } else { ph.DiscountPrice = game.FinalPrice; ph.OriginalPrice = game.OriginalPrice; } ph.PSPlusPrice = game.PSPlusPrice; string gamehistorid = SaveLoadUtils.GetGameNameID(game.Title); string jsongamehistoryFilePath = Path.Combine(_dataDirectory, gamehistorid + "_hist.json"); SaveLoadUtils.SaveGamePriceHistroyToJson(ph, jsongamehistoryFilePath); }
public PriceHistory(string gametitle) { InitializeComponent(); string gamepricehistoryid = SaveLoadUtils.GetGameNameID(gametitle); _viewModel = new PriceHistoryViewModel(gamepricehistoryid); lvPrices.ItemsSource = _viewModel.Prices; txtTitle.Text = gametitle; }
private string GetImagePath(string strTitle) { string imgname = SaveLoadUtils.GetGameNameID(strTitle); StringBuilder sb = new StringBuilder(); sb.Append(_dataDirectory); sb.Append("\\"); sb.Append(imgname); sb.Append(".png"); return(sb.ToString()); }