示例#1
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);
        }
示例#2
0
        /// <summary>
        /// 产生对应游戏的所有交易信息
        /// </summary>
        /// <param name="grid"></param>
        /// <param name="index"></param>
        /// <param name="gameid"></param>
        /// <param name="userid"></param>
        public static void CreateStorageInfo(Grid grid, int index, string gameid)
        {
            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    = 350;
            info.Height   = 50;
            info.FontSize = 16;
            string userid = AccessHelper.GetGameStorageUserID(gameid, index);

            if (AccessHelper.GetGameStorageType(gameid, index) == "交换")
            {
                info.Content = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要用此游戏交换《" + AccessHelper.GetGameStorageChangeGame(gameid, index) + "》";
            }
            else if (AccessHelper.GetGameStorageType(gameid, index) == "出售")
            {
                info.Content = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要以" + AccessHelper.GetGameStoragePrice(gameid, index) + "元 出售此游戏";
            }
            else if (AccessHelper.GetGameStorageType(gameid, index) == "出租")
            {
                info.Content = "用户 " + AccessHelper.GetUserNickName(userid) + " 想要以" + AccessHelper.GetGameStoragePrice(gameid, index) + "元/日 出租此游戏";
            }

            canvas.Children.Add(info);

            Button detail = new Button();

            Canvas.SetTop(detail, index * 50 + 5);
            Canvas.SetLeft(detail, 350);
            detail.Width      = 100;
            detail.Height     = 30;
            detail.FontSize   = 16;
            detail.Content    = "查看详情";
            detail.Background = Brushes.White;
            detail.Click     += MessageDetail_Click;
            string storageid = AccessHelper.GetGameStorageID(gameid, index);

            detail.Name = "detail" + storageid;
            canvas.Children.Add(detail);



            grid.Children.Add(canvas);
            grid.Height += 50;
        }
        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) + "》";
            }
        }