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); }
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 static void DeleteRelease_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; string storageid = btn.Name.Replace("delete", ""); //string userid = AccessHelper.GetGameStorageUserID(storageid); string gameid = AccessHelper.GetGameStorageGameID(storageid); MessageBoxResult dr = MessageBox.Show("真的要删除此信息吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question); if (dr == MessageBoxResult.OK) { AccessHelper.DeleteGameStorageInfo(storageid); EventCenter.Broadcast <string>(EventType.DeleteOneUserRelease, storageid); EventCenter.Broadcast <string>(EventType.UpdateGameList, gameid); MessageBox.Show("已删除!", "message", MessageBoxButton.OK); } //throw new NotImplementedException(); }
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) + "》"; } }