private void ViewGameStorageInfo(string gameid) { if (userID == "") { MessageBox.Show("未登录!", "message", MessageBoxButton.OK); } else { if (AccessHelper.GetGameStorage(gameid) == "0") { MessageBox.Show("暂无库存!", "message", MessageBoxButton.OK); } else { StorageWindow storageWindow = new StorageWindow(); storageWindow.Show(); storageWindow.ZhName.Content = AccessHelper.GetGameZhName(gameid); storageWindow.EnName.Content = AccessHelper.GetGameEnName(gameid); storageWindow.Pic.Source = AccessHelper.GetGameImage(gameid); //storageWindow.gameId = gameid; for (int i = 0; i < Convert.ToInt32(AccessHelper.GetGameStorage(gameid)); i++) { MenuCenter.CreateStorageInfo(storageWindow.list, i, gameid); } } } }
public static void CreateGameInfo(Grid grid, int row) { Canvas canvas = new Canvas(); Canvas.SetTop(canvas, row * 200); Image img = new Image(); Canvas.SetTop(img, row * 200); string gameID = AccessHelper.GetGameID(row); canvas.Name = "canvas" + gameID; img.Width = 186; img.Height = 186; img.Source = AccessHelper.GetGameImage(gameID); canvas.Children.Add(img); Label zh = new Label(); Canvas.SetTop(zh, row * 200); Canvas.SetLeft(zh, 200); zh.Width = 600; zh.Height = 50; zh.FontSize = 20; zh.Content = AccessHelper.GetGameZhName(row); canvas.Children.Add(zh); Label en = new Label(); Canvas.SetTop(en, row * 200 + 50); Canvas.SetLeft(en, 200); en.Width = 600; en.Height = 50; en.FontSize = 16; en.Content = AccessHelper.GetGameEnName(row); canvas.Children.Add(en); Label storage = new Label(); Canvas.SetTop(storage, row * 200 + 100); Canvas.SetLeft(storage, 200); storage.Width = 600; storage.Height = 50; storage.FontSize = 16; storage.Content = AccessHelper.GetGameStorage(gameID) + "条交易信息"; storage.Name = "storage" + gameID; canvas.Children.Add(storage); Button detail = new Button(); Canvas.SetTop(detail, row * 200 + 150); Canvas.SetLeft(detail, 200); detail.Width = 100; detail.Height = 30; detail.Content = "查看详情"; detail.Click += DetailBtn_Click; detail.Name = "detail" + gameID; detail.Background = Brushes.White; canvas.Children.Add(detail); Button create = new Button(); Canvas.SetTop(create, row * 200 + 150); Canvas.SetLeft(create, 350); create.Width = 100; create.Height = 30; create.Content = "发布二手"; create.Name = "create" + gameID; create.Click += CreateBtn_Click; create.Background = Brushes.White; canvas.Children.Add(create); grid.Children.Add(canvas); grid.Height += 200; }
private void UpdateGameInfo(string gameid) { Label label = UIFindHelper.GetChildObject <Label>(list, "storage" + gameid); label.Content = AccessHelper.GetGameStorage(gameid) + "条交易信息"; }