Example #1
0
        public Register(string id, string pass, MyHome home)
        {
            InitializeComponent();
            this.BackColor        = Color.FromArgb(42, 46, 51);
            LOGO.Image            = Properties.Resources.steam_logo;
            txtID.BackColor       = Color.FromArgb(42, 46, 51);
            txtPass.BackColor     = Color.FromArgb(42, 46, 51);
            txtRe.BackColor       = Color.FromArgb(42, 46, 51);
            txtMail.BackColor     = Color.FromArgb(42, 46, 51);
            txtFullname.BackColor = Color.FromArgb(42, 46, 51);
            txtPhone.BackColor    = Color.FromArgb(42, 46, 51);
            this.idCheckChange    = true;
            this.idChange         = id;
            this.myHome           = home;
            this.Text             = "Change Account";
            this.button1.Text     = "UPDATE";
            this.txtPass.Text     = pass;
            this.txtRe.Text       = pass;

            //get account by id
            var resultGet = AccountsControllerShould.GetUserByIdController(this.idChange);

            txtFullname.Text = resultGet.FullName;
            txtID.Text       = resultGet.UserName;
            txtMail.Text     = resultGet.Email;
            txtPhone.Text    = resultGet.PhoneNumber;
            //this.txtPass.Text = ""
        }
Example #2
0
        public Freecode(string id, MyHome home)
        {
            InitializeComponent();

            this.id        = id;
            myHome         = home;
            this.BackColor = Color.FromArgb(21, 53, 77);
        }
Example #3
0
        public PushGame(MyHome input)
        {
            myHome = input;
            InitializeComponent();
            this.BackColor = Color.FromArgb(42, 46, 51);
            PublisherControllerShould publisherController = new PublisherControllerShould();

            getPublisherCallBack += _getPublisherCallBack;
            publisherResponse     = publisherController.GetAllPublishersController(getPublisherCallBack);
            comboBox1.Text        = "Choose Publisher";
        }
Example #4
0
        public Profile(GameStore.DTOs.PayloadBody input, MyHome home)
        {
            user = input;
            InitializeComponent();
            panel1.BackColor   = Color.FromArgb(42, 46, 51);
            avatar.Image       = Properties.Resources.gta5;
            listGame.BackColor = Color.FromArgb(42, 46, 51);

            listGame.SmallImageList = imageList1;
            LoadPurchased();

            currmoney     = AccountsControllerShould.GetUserByIdController(id).Money;
            SoDuText.Text = "Money: VND" + Math.Round(currmoney, 2).ToString();
            this.myHome   = home;
        }
Example #5
0
        public GameSale(MyHome input)
        {
            myHome = input;
            InitializeComponent();
            Responses <GameDTOs> GameResponse = GameControllerShould.GetAllGamesController();
            List <GameDTOs>      gameDTOs     = GameResponse.Payload;

            foreach (GameDTOs a in gameDTOs)
            {
                GameObject temp1 = toGameObject(a);
                lib_game.Add(temp1);
            }
            foreach (GameObject game in lib_game)
            {
                GameCollection.Items.Add(game.Name);
            }
            GameCollection.Text = "Choose a game to sale";
        }
Example #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            int check = 0;

            //txtID: username/email
            if (txtID.Text != "" && txtPass.Text != "")
            {
                //Loading_Bar(check);

                LoginObject loginObject = new LoginObject(txtID.Text, txtPass.Text);
                string      rs          = AuthsControllerShould.LoginController(loginObject);
                if (rs.Equals("user"))
                {
                    check = 1;
                    //Loading_Bar(check);
                    MessageBox.Show("Account does not exist!\nYou should register it!", "Error");
                }
                else if (rs.Equals("pass"))
                {
                    check = 2;
                    //Loading_Bar(check);
                    MessageBox.Show("Password incorrect!", "Error");
                }
                else // login correctly, received token, id
                {
                    string id = rs;
                    MyHome a  = new MyHome(id, txtPass.Text); //pass: //add wishgame

                    check = 3;
                    //Loading_Bar(check);

                    a.Show();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Information is not enough!");
            }
        }
Example #7
0
        private void txtPass_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                //txtID: username/email
                if (txtID.Text != "" && txtPass.Text != "")
                {
                    LoginObject loginObject = new LoginObject(txtID.Text, txtPass.Text);
                    string      rs          = AuthsControllerShould.LoginController(loginObject);
                    //if (rs.Equals("user"))
                    //{
                    //    MessageBox.Show("Account does not exist!\nYou should register it!", "Error");
                    //}
                    //else if (rs.Equals("pass"))
                    //{
                    //    MessageBox.Show("Password incorrect!", "Error");
                    //}
                    //else // login correctly, received token, id
                    //{
                    //    string id = rs;
                    //    MyHome a = new MyHome(id);
                    //    a.Show();
                    //    this.Hide();
                    //}

                    if (!rs.Equals("user") && !rs.Equals("pass"))
                    {
                        string id = rs;
                        MyHome a  = new MyHome(id, txtPass.Text);
                        a.Show();
                        this.Hide();
                    }
                }
                //else MessageBox.Show("Information is not enough!");
            }
        }