Exemple #1
0
        private void cancelBtn_Click(object sender, RoutedEventArgs e)
        {
            type.IsEnabled       = false;
            changeGame.IsEnabled = false;
            message.IsEnabled    = false;
            price.IsEnabled      = false;

            editBtn.IsEnabled    = true;
            confirmBtn.IsEnabled = false;
            cancelBtn.IsEnabled  = false;

            string storageType = AccessHelper.GetGameStorageType(storageID);

            if (storageType == "出售")
            {
                type.SelectedIndex = 0;
            }
            else if (storageType == "出租")
            {
                type.SelectedIndex = 1;
            }
            else if (storageType == "交换")
            {
                type.SelectedIndex = 2;
            }

            price.Text = AccessHelper.GetGameStoragePrice(storageID);
            changeGame.SelectedItem = AccessHelper.GetGameStorageChangeGame(storageID);
            message.Text            = AccessHelper.GetGameStorageMessage(storageID);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }