Exemplo n.º 1
0
        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);
                    }
                }
            }
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
        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;
        }