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); } } } }
private void changeGame_Loaded(object sender, RoutedEventArgs e) { int gameCount = AccessHelper.GetGameCount(); for (int i = 0; i < gameCount; i++) { changeGame.Items.Add(AccessHelper.GetGameZhName(i)); } changeGame.Visibility = Visibility.Hidden; changeGameIsLoaded = true; }
private void UpdateWindow() { ZhName.IsEnabled = false; EnName.IsEnabled = false; ZhName.Text = AccessHelper.GetGameZhName(gameIndex); EnName.Text = AccessHelper.GetGameEnName(gameIndex); gameID = AccessHelper.GetGameID(gameIndex); Pic.Source = AccessHelper.GetGameImage(gameID); gameCount = AccessHelper.GetGameCount(); }
private void EditUserRelease(string storageid) { ReleaseEditWindow releaseEditWindow = new ReleaseEditWindow(); releaseEditWindow.Show(); releaseEditWindow.userID = userID; releaseEditWindow.storageID = storageid; string gameid = AccessHelper.GetGameStorageGameID(storageid); releaseEditWindow.gameID = gameid; releaseEditWindow.Pic.Source = AccessHelper.GetGameImage(gameid); releaseEditWindow.ZhName.Content = AccessHelper.GetGameZhName(gameid); releaseEditWindow.EnName.Content = AccessHelper.GetGameEnName(gameid); string storageType = AccessHelper.GetGameStorageType(storageid); if (storageType == "出售") { releaseEditWindow.type.SelectedIndex = 0; releaseEditWindow.changeGame.Visibility = Visibility.Hidden; releaseEditWindow.price.Visibility = Visibility.Visible; releaseEditWindow.unit.Visibility = Visibility.Visible; releaseEditWindow.price.Text = AccessHelper.GetGameStoragePrice(storageid); releaseEditWindow.unit.Content = "元"; } else if (storageType == "出租") { releaseEditWindow.type.SelectedIndex = 1; releaseEditWindow.changeGame.Visibility = Visibility.Hidden; releaseEditWindow.price.Visibility = Visibility.Visible; releaseEditWindow.unit.Visibility = Visibility.Visible; releaseEditWindow.price.Text = AccessHelper.GetGameStoragePrice(storageid); releaseEditWindow.unit.Content = "元/日"; } else if (storageType == "交换") { releaseEditWindow.type.SelectedIndex = 2; releaseEditWindow.changeGame.Visibility = Visibility.Visible; releaseEditWindow.price.Visibility = Visibility.Hidden; releaseEditWindow.unit.Visibility = Visibility.Hidden; releaseEditWindow.changeGame.SelectedItem = AccessHelper.GetGameStorageChangeGame(storageid); } releaseEditWindow.message.Text = AccessHelper.GetGameStorageMessage(storageid); }
private void ReleaseGameStorageInfo(string gameid) { if (userID == "") { MessageBox.Show("未登录!", "message", MessageBoxButton.OK); } else { ReleaseWindow releaseWindow = new ReleaseWindow(); releaseWindow.Show(); releaseWindow.gameID = gameid; releaseWindow.userID = userID; releaseWindow.Pic.Source = AccessHelper.GetGameImage(gameid); releaseWindow.ZhName.Content = AccessHelper.GetGameZhName(gameid); releaseWindow.EnName.Content = AccessHelper.GetGameEnName(gameid); } }
/// <summary> /// 创建“已发布”下对应用户交易信息 /// </summary> /// <param name="grid"></param> /// <param name="index"></param> /// <param name="userid"></param> public static void CreateUserReleaseInfo(Grid grid, int index, string userid) { Canvas canvas = new Canvas(); Canvas.SetTop(canvas, index * 50); Label info = new Label(); Canvas.SetTop(info, index * 50); //Canvas.SetLeft(info, 2+64); info.Width = 500; info.Height = 50; info.FontSize = 16; string storageID = AccessHelper.GetGameStorageIDFromUserID(userid, index); string gameid = AccessHelper.GetGameStorageGameIDFromUserID(userid, index); info.Name = "info" + storageID; if (AccessHelper.GetGameStorageType(storageID) == "交换") { info.Content = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要用《" + AccessHelper.GetGameZhName(gameid) + "》交换《" + AccessHelper.GetGameStorageChangeGame(storageID) + "》"; } else if (AccessHelper.GetGameStorageType(storageID) == "出售") { info.Content = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要以" + AccessHelper.GetGameStoragePrice(storageID) + "元 出售《" + AccessHelper.GetGameZhName(gameid) + "》"; } else if (AccessHelper.GetGameStorageType(storageID) == "出租") { info.Content = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要以" + AccessHelper.GetGameStoragePrice(storageID) + "元/日 出租《" + AccessHelper.GetGameZhName(gameid) + "》"; } canvas.Children.Add(info); Button edit = new Button(); Canvas.SetTop(edit, index * 50 + 5); Canvas.SetLeft(edit, 500); edit.Width = 100; edit.Height = 30; edit.FontSize = 16; edit.Content = "修改信息"; edit.Background = Brushes.White; edit.Click += EditRelease_Click; edit.Name = "edit" + storageID; canvas.Children.Add(edit); Button delete = new Button(); Canvas.SetTop(delete, index * 50 + 5); Canvas.SetLeft(delete, 600 + 5); delete.Width = 100; delete.Height = 30; delete.FontSize = 16; delete.Content = "删除此项"; //delete.Foreground = Brushes.White; delete.Click += DeleteRelease_Click; delete.Name = "delete" + storageID; canvas.Children.Add(delete); canvas.Name = "canvas" + storageID; grid.Children.Add(canvas); grid.Height += 50; }
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 UpdateReleaseList(string storageID) { //Console.WriteLine(list.Children.Count); //Canvas canvas = UIFindHelper.GetChildObject<Canvas>(list, "canvas" + storageID); Label info = UIFindHelper.GetChildObject <Label>(list, "info" + storageID); //label.Content = AccessHelper.GetGameStorage(gameid) + "条交易信息"; string userid = AccessHelper.GetGameStorageUserID(storageID); string gameid = AccessHelper.GetGameStorageGameID(storageID); if (AccessHelper.GetGameStorageType(storageID) == "交换") { info.Content = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要用《" + AccessHelper.GetGameZhName(gameid) + "》交换《" + AccessHelper.GetGameStorageChangeGame(storageID) + "》"; } else if (AccessHelper.GetGameStorageType(storageID) == "出售") { info.Content = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要以" + AccessHelper.GetGameStoragePrice(storageID) + "元 出售《" + AccessHelper.GetGameZhName(gameid) + "》"; } else if (AccessHelper.GetGameStorageType(storageID) == "出租") { info.Content = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要以" + AccessHelper.GetGameStoragePrice(storageID) + "元/日 出租《" + AccessHelper.GetGameZhName(gameid) + "》"; } }
private void ViewStorageMessage(string storageID) { MessageWindow messageWindow = new MessageWindow(); messageWindow.Show(); string gameid = AccessHelper.GetGameStorageGameID(storageID); string userid = AccessHelper.GetGameStorageUserID(storageID); messageWindow.nickname.Content = AccessHelper.GetUserNickName(userid); messageWindow.phone.Content = AccessHelper.GetUserPhone(userid); messageWindow.qq.Content = AccessHelper.GetUserQQ(userid); messageWindow.email.Content = AccessHelper.GetUserEmail(userid); messageWindow.address.Text = AccessHelper.GetUserAddress(userid); if (AccessHelper.GetGameStorageType(storageID) == "交换") { messageWindow.storageInfo.Text = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要用《" + AccessHelper.GetGameZhName(gameid) + "》交换《" + AccessHelper.GetGameStorageChangeGame(storageID) + "》"; } else if (AccessHelper.GetGameStorageType(storageID) == "出售") { messageWindow.storageInfo.Text = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要以" + AccessHelper.GetGameStoragePrice(storageID) + "元 出售《" + AccessHelper.GetGameZhName(gameid) + "》"; } else if (AccessHelper.GetGameStorageType(storageID) == "出租") { messageWindow.storageInfo.Text = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要以" + AccessHelper.GetGameStoragePrice(storageID) + "元/日 出租《" + AccessHelper.GetGameZhName(gameid) + "》"; } messageWindow.Pic.Source = AccessHelper.GetGameImage(gameid); messageWindow.message.Text = AccessHelper.GetGameStorageMessage(storageID); }