Пример #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;
        }
Пример #3
0
        private void userCenterBtn_Click(object sender, RoutedEventArgs e)
        {
            UserCenterWindow userCenterWindow = new UserCenterWindow();

            userCenterWindow.Show();
            userCenterWindow.userID = userID;

            userCenterWindow.userPasswd.Text   = AccessHelper.GetUserPasswd(userID);
            userCenterWindow.userNickName.Text = AccessHelper.GetUserNickName(userID);
            userCenterWindow.userPhone.Text    = AccessHelper.GetUserPhone(userID);
            userCenterWindow.userQQ.Text       = AccessHelper.GetUserQQ(userID);
            userCenterWindow.userEmail.Text    = AccessHelper.GetUserEmail(userID);
            userCenterWindow.userAddress.Text  = AccessHelper.GetUserAddress(userID);
        }
Пример #4
0
        private void cancelBtn_Click(object sender, RoutedEventArgs e)
        {
            updateBtn.IsEnabled  = true;
            confirmBtn.IsEnabled = false;
            cancelBtn.IsEnabled  = false;

            userPasswd.IsEnabled   = false;
            userNickName.IsEnabled = false;
            userPhone.IsEnabled    = false;
            userQQ.IsEnabled       = false;
            userEmail.IsEnabled    = false;
            userAddress.IsEnabled  = false;

            userPasswd.Text   = AccessHelper.GetUserPasswd(userID);
            userNickName.Text = AccessHelper.GetUserNickName(userID);
            userPhone.Text    = AccessHelper.GetUserPhone(userID);
            userQQ.Text       = AccessHelper.GetUserQQ(userID);
            userEmail.Text    = AccessHelper.GetUserEmail(userID);
            userAddress.Text  = AccessHelper.GetUserAddress(userID);
        }
Пример #5
0
        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) + "》";
            }
        }
Пример #6
0
        /// <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;
        }