示例#1
0
 //, int _id)
 /// <summary>
 /// Initializes a new instance of the <see cref="PersonalAccountForm"/> class.
 /// </summary>
 /// <param name="newUser">User to set</param>
 /// <param name="newParent">Parent form to set</param>
 public PersonalAccountForm(Person newUser, ShopForm newParent)
 {
     this.InitializeComponent();
     this.user = newUser;
     this.parent = newParent;
     //id = _id;
 }
示例#2
0
 public static void read(Person p)
 {
     MySqlDataReader mysql_result = Database.connect("SELECT game FROM bought_games WHERE id_user=" + p.Id);
     while (mysql_result.Read())
     {
         p.Glib.Bracket.Add(new Registration.Game(mysql_result.GetString(0)));
     }
 }
 public GameFormController(Game game,Person _user,string _t1,string _t2,string _t3)
 {
     t1 = _t1;
     t2 = _t2;
     t3 = _t3;
     user = _user;
     gform=new GameForm(game,user,t1,t2,t3);
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameFormController"/> class.
 /// </summary>
 /// <param name="game">New game</param>
 /// <param name="newUser">New user</param>
 /// <param name="newt1">New text 1</param>
 /// <param name="newt2">New text 2</param>
 /// <param name="newt3">New text 3</param>
 public GameFormController(Game game, Person newUser, string newt1, string newt2, string newt3)
 {
     this.t1 = newt1;
     this.t2 = newt2;
     this.t3 = newt3;
     this.user = newUser;
     this.gform = new GameForm(game, this.user, this.t1, this.t2, this.t3);
 }
示例#5
0
 /// <summary>
 /// When EditLabel is clicked
 /// </summary>
 /// <param name="sender"> Event sender</param>
 /// <param name="e"> Event argument</param>
 private void EditLabel_Click(object sender, EventArgs e)
 {
     this.Hide();
     this.Close();
     EditForm edit = new EditForm(this.user);//, this.id);
     edit.ShowDialog();
     this.user = edit.GetUser();
     this.parent.SetUser(this.user);
     this.parent.AccountLabel_Click(sender, e);
 }
示例#6
0
        public DialogResult run(Indie _game,Person _user)
        {
            game = _game;
            label1.Text = game.Name;
            richTextBox1.Text = game.Description;
            pictureBox1.ImageLocation = game.Path;
            user = _user;

            for (int i = 0; i < user.IGlib.Count; i++)
            {
                if (user.IGlib[i].Name == game.Name)
                {
                    label3.Enabled = false;
                    label3.Text = "Play";
                }
            }

                return this.ShowDialog();
        }
示例#7
0
        public GameForm(Game game,Person _user,string t1,string t2,string t3)
        {
            user=_user;
            InitializeComponent();
            button1.ForeColor = Color.DarkGray;
            button2.ForeColor = Color.DarkGray;
            gfcntrl=new GameFormController();
            src1 = t3;
            src2 = t1;
            text1 = t2;

            Image image = Image.FromFile(src2);
            pictureBox1.Image = image;
            image = Image.FromFile(src1);
            pictureBox2.Image = image;
            label1.Text = text1;
            if (user.Glib.find(game.Name))
            {
                button1.Text = "Play";
                button1.Enabled = false;
            }
        }
示例#8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameForm"/> class.
        /// </summary>
        /// <param name="game">Game to set</param>
        /// <param name="newUser">User to set</param>
        /// <param name="t1">string t1</param>
        /// <param name="t2">game text</param>
        /// <param name="t3">string t3</param>
        public GameForm(Game game, Person newUser, string t1, string t2, string t3)
        {
            this.user = newUser;
            this.InitializeComponent();
            this.button1.ForeColor = Color.DarkGray;
            this.button2.ForeColor = Color.DarkGray;
            this.gfcntrl = new GameFormController();
            this.src1 = t3;
            this.src2 = t1;
            this.text1 = t2;

            Image image = Image.FromFile(this.src2);
            this.pictureBox1.Image = image;
            image = Image.FromFile(this.src1);
            this.pictureBox2.Image = image;
            this.label1.Text = this.text1;
            if (this.user.Glib.Find(game.Name))
            {
                this.button1.Text = "Play";
                this.button1.Enabled = false;
            }
        }
示例#9
0
        /// <summary>
        /// Run form
        /// </summary>
        /// <param name="newGame">New game</param>
        /// <param name="newUser">New user</param>
        /// <returns>Dialog Result</returns>
        public DialogResult Run(Indie newGame, Person newUser)
        {
            this.game = newGame;
            this.label1.Text = this.game.Name;
            this.richTextBox1.Text = this.game.Description;
            this.pictureBox1.ImageLocation = this.game.Path;
            this.user = newUser;

            for (int i = 0; i < this.user.IndieGlib.Count; i++)
            {
                if (this.user.IndieGlib[i].Name == this.game.Name)
                {
                    this.label3.Enabled = false;
                    this.label3.Text = "Play";
                }
            }

            return this.ShowDialog();
        }
示例#10
0
        public ShopForm(ShopControl _sControl, Person _user, Library _libr)
        {
            icons       = new List <PictureBox>();
            indies      = new List <Indie>();
            newgameList = new List <Label>();
            glibr       = new GameLibrary();
            glibr.Add(new Game("Team Fortress 2"));
            glibr.Add(new Game("Star Craft 2"));
            glibr.Add(new Game("Half life 2"));
            glibr.Add(new Game("Portal"));
            glibr.Add(new Game("World of Warcraft"));
            glibr.Add(new Game("Heroes 6"));
            glibr.Add(new Game("Dark Sides 2"));
            glibr.Add(new Game("Black Mesa"));
            glibr.Add(new Game("Dota2"));
            glibr.Add(new Game("Witcher"));
            glibr.Add(new Game("Battle Field 3"));
            glibr.Add(new Game("Diablo 3"));
            libr     = _libr;
            user     = _user;
            sControl = _sControl;
            InitializeComponent();
            tabControl1.DrawItem += new DrawItemEventHandler(tabControl1_DrawItem);
            t1           = new List <string>();
            t2           = new List <string>();
            t3           = new List <string>();
            label1.Text  = "Hello,";
            label1.Text += sControl.onLoadShop();
            pblist       = new List <PictureBox>();
            pblist1      = new List <PictureBox>();
            llist        = new List <Label>();
            n            = 0;
            pblist.Add(pictureBox6);
            pblist.Add(pictureBox7);
            pblist.Add(pictureBox8);
            pblist.Add(pictureBox9);
            pblist.Add(pictureBox10);
            pblist.Add(pictureBox11);
            pblist.Add(pictureBox12);
            pblist.Add(pictureBox13);
            pblist.Add(pictureBox14);
            pblist.Add(pictureBox15);
            pblist.Add(pictureBox16);
            pblist.Add(pictureBox17);
            koeficient = (int)(SystemInformation.PrimaryMonitorSize.Height / 1024);
            List <string> text = new List <string>();

            text.Add("Team Fortress 2 - innovating roleplay shooter.\n In game you can choose one of 8 roles. \n medic,heavy,scout,demoman,soldair,engineer,spy, and sniper.\n Each of them has own changeble weapons and history. \n There are lots of different types and game modes,maps and missions.\n You will be defending castles, deathmatching, storming and capturing flags!\n\n\n So if you want to have fun in Team fortress 2 order it now.");
            text.Add("StarCraft 2 - Chalenging RTS, next chapter of SC\n Nowadays SC2 is the most popular eSport game\n Most exciting game tournaments, epic battles and mindgames are here\n\n For people who came to see next chapter of Raynor's story Starcraft2 \n has a lot to see nad play in new campaign. \n There are still 3 different sides in space war: Zergs,Protoss,Terran\n You will be excited by comanding space marines \n or invading worlds with your swarm \n\n\n So if you want to have fun in Starcraft 2 order it now.");
            text.Add("Half-Life 2: Episode Two is a first-person shooter video game \n the second episode in a series of sequels to the 2004 Half-Life 2. \n It was developed by Valve Corporation in tandem with Episode One, \n the first game in the series, and released in 2007 \n via Valve's Steam content distribution platform. \n The episode was released both separately and as a part of a bundled package \n The Orange Box. \n\n\n So if you want to play Half life,order it now.");
            text.Add("Portal is a 2007 single-player first-person puzzle-platform video game \n developed by Valve Corporation. \n The game was released in a bundle package called The Orange Box \n for Microsoft Windows and Xbox 360 on October 9, 2007,\n and for the PlayStation 3 on December 11, 2007. \n The Windows version of the game is available for download \n separately through Valve's content delivery system Steam \n and was released as a standalone retail product on April 9, 2008.\n A standalone version called Portal: Still Alive \n was released on the Xbox Live Arcade service on October 22, 2008;\n this version includes an additional 14 puzzles. \n A Mac OS X version was released as part of the Mac-compatible Steam \n\n\n So if you want to play Portal, order it now!");
            text.Add("World of Warcraft (often abbreviated as WoW)\n is a massively multiplayer online role-playing game \n It is the fourth released game set in the fantasy Warcraft universe,\n which was first introduced by Warcraft:\n Orcs & Humans in 1994.\n World of Warcraft takes place within the Warcraft world of Azeroth,\n approximately four years after the events at the conclusion \n of Blizzard's previous Warcraft release, Warcraft III: The Frozen Throne \n\n\n  So if you want to have fun in WoW order it now.");
            text.Add("Might & Magic Heroes VI is a turn-based strategy video game \n for Microsoft Windows developed by Black Hole Entertainment \n and published by Ubisoft. \n It is the sixth installment in the Heroes of Might and Magic series,\n and was released on October 13, 2011, \n coinciding with the 25th anniversary of the Might and Magic franchise. \n Heroes VI acts as a prequel to Heroes of Might and Magic V,\n occurring almost five centuries earlier, \n and is set in the fictional world of Ashan. \n The story follows the five heirs to the Griffin dynasty \n in their quests to repel a demon invasion and assist  \n or impede Michael, a legendary Archangel general plotting \n to revive an ancient war.\n\n\n So if you want to play Heroes6 , order it now!");
            text.Add("Darksiders II is an action-adventure and action role-playing game \n developed by Vigil Games and published by THQ. \n It is the sequel to Darksiders\n and was released in August 2012 for PlayStation 3,\n Xbox 360, Microsoft Windows, with a Wii U port scheduled \n later in the year.\n\n\nSo if you want to play Darksides2 , order it now!");
            text.Add("Black Mesa (previously known as Black Mesa: Source) \n is a third-party total conversion modification  \n for Valve Corporation's Source engine. \n The stated goal of the project is to recreate Valve's critically acclaimed \n 1998 video game Half-Life using the more advanced capabilities \n of the Source engine. The 40-person volunteer development team says they \n hope to create a more engrossing in-game world with more varied, \n complex environments and more challenging, realistic gameplay. \n\n\n So if you want to play BlackMesa, order it now!");
            text.Add("Dota 2 is an upcoming multiplayer online battle arena video game \n being developed by Valve Corporation and the stand-alone sequel to popular \n Defense of the Ancients mod for Warcraft III: Reign of Chaos \n and its expansion pack, The Frozen Throne. \n Formally announced on October 13, 2010, via Game Informer, \n the game is currently available for early test access purchase \n and is scheduled for a full release in 2012, \n with a free-to-play business model.\n\n\n So if you want to play Dota2 ,order it now!");
            text.Add("The Witcher is an action role-playing video game  \n developed by CD Projekt RED and published by Atari. \n The game is based on the book series by Polish author Andrzej Sapkowski.\n The Witcher takes place in a medieval fantasy world and follows the story of Geralt, \n one of a few remaining witchers – traveling monster hunter for hire,\n gifted with unnatural powers. The game's system of 'moral choices' \n as part of the storyline was noted for its time-delayed \n consequences and lack of black-and-white morality.\n\n\n So if you want ot play Witcher, order it now!");
            text.Add("Battlefield 3 (commonly abbreviated BF3) is a first-person shooter video game \n developed by EA Digital Illusions CE and published by Electronic Arts.\n It is a direct sequel to 2005's Battlefield 2, \n and the twelfth installment in the Battlefield franchise. \n\n\n So if you want to play Battle field 3 - order it now!");
            text.Add("Diablo III is an action role-playing hack and slash video game \n developed and published by Blizzard Entertainment. \n It is the third installment in the Diablo franchise.\n The game, which features elements of the hack and slash genre, \n was released in North America, Latin America, Europe, South Korea, and Taiwan\n  on May 15, 2012, and in Russia on June 7, 2012.\n Before its release, the game broke several presale records \n and became the most pre-ordered PC game to date on Amazon.com.\n Diablo III subsequently set the new all-time record \n for fastest-selling PC game by selling over 3.5 million copies  \n in the first 24 hours of its release. \n\n\n So by it immidiately !!!");
            if (user.Security != "developer")
            {
                this.label18.Hide();
            }

            this.label1.Location      = new System.Drawing.Point((SystemInformation.PrimaryMonitorSize.Width - 200), 100);
            this.label2.Location      = new System.Drawing.Point((SystemInformation.PrimaryMonitorSize.Width - 200), 120);
            this.label16.Location     = new System.Drawing.Point((SystemInformation.PrimaryMonitorSize.Width - 20), 10);
            this.label15.Location     = new System.Drawing.Point((SystemInformation.PrimaryMonitorSize.Width - 40), 10);
            this.tabControl1.Location = new System.Drawing.Point((int)((SystemInformation.PrimaryMonitorSize.Width - (SystemInformation.PrimaryMonitorSize.Height * 1.25 * 0.728)) / 2), (int)(SystemInformation.PrimaryMonitorSize.Height * 0.205));
            this.tabControl1.Size     = new System.Drawing.Size((int)(SystemInformation.PrimaryMonitorSize.Height * 1.25 * 0.728), (int)(SystemInformation.PrimaryMonitorSize.Height * 0.72));
            this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;

            for (int i = 0; i < pblist.Count; i++)
            {
                int k = i;
                int j = 0;
                if (i >= 6)
                {
                    k = i - 6;
                    j = 152 * koeficient;
                }
                string path = "..\\..\\pictures\\";
                pblist[i].BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
                pblist[i].Location    = new System.Drawing.Point(10 + k * 150 * koeficient, 400 * koeficient + j);
                pblist[i].Name        = (i).ToString();
                pblist[i].Size        = new System.Drawing.Size(150, 150);
                pblist[i].SizeMode    = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
                pblist[i].TabIndex    = 10;
                pblist[i].TabStop     = false;
                string src   = path + i.ToString() + ".jpg";
                Image  image = Image.FromFile(src);
                pblist[i].Image       = image;
                pblist[i].MouseEnter += new System.EventHandler(this.pictureBoxi_MouseEnter);
                pblist[i].MouseLeave += new System.EventHandler(this.pictureBoxi_MouseLeave);
                pblist[i].Click      += new System.EventHandler(this.pictureBoxi_Click);
                src = path + i.ToString() + i.ToString() + ".png";
                string src3 = path + i.ToString() + i.ToString() + i.ToString() + ".png";
                t1.Add(src);
                t2.Add(text[i]);
                t3.Add(src3);
                //initializeTabPage2();
            }
            initializeTabPage2();
        }
示例#11
0
 /// <summary>
 /// Set user.
 /// </summary>
 /// <param name="newUser">User to set.</param>
 public void SetUser(Person newUser)
 {
     this.user = newUser;
 }
示例#12
0
 /// <summary>
 /// Account label click.
 /// </summary>
 /// <param name="sender"> Event sender.</param>
 /// <param name="e"> Event argument.</param>
 public void AccountLabel_Click(object sender, EventArgs e)
 {
     this.Hide();
     PersonalAccountForm account = new PersonalAccountForm(this.user, this);//, this.id);
     account.ShowDialog();
     this.libr.Delete(this.user.GetLogin());
     this.user = account.GetUser();
     this.libr.Add(this.user);
     this.Show();
 }
示例#13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ShopForm"/> class.
        /// </summary>
        /// <param name="newControl">Control to set.</param>
        /// <param name="newUser">User to set.</param>
        /// <param name="newLibr">Library to set.</param>
        public ShopForm(ShopControl newControl, Person newUser, Library newLibr)
        {
            this.icons = new List<PictureBox>();
            this.indies = new List<Indie>();
            this.newgameList = new List<Label>();
            this.glibr = new GameLibrary();
            this.glibr.Add(new Game("Team Fortress 2"));
            this.glibr.Add(new Game("Star Craft 2"));
            this.glibr.Add(new Game("Half life 2"));
            this.glibr.Add(new Game("Portal"));
            this.glibr.Add(new Game("World of Warcraft"));
            this.glibr.Add(new Game("Heroes 6"));
            this.glibr.Add(new Game("Dark Sides 2"));
            this.glibr.Add(new Game("Black Mesa"));
            this.glibr.Add(new Game("Dota2"));
            this.glibr.Add(new Game("Witcher"));
            this.glibr.Add(new Game("Battle Field 3"));
            this.glibr.Add(new Game("Diablo 3"));
            this.libr = newLibr;
            this.user = newUser;
            this.control = newControl;
            this.InitializeComponent();
            this.tabControl1.DrawItem += new DrawItemEventHandler(this.TabControl1_DrawItem);
            this.t1 = new List<string>();
            this.t2 = new List<string>();
            this.t3 = new List<string>();
            this.label1.Text = "Hello,";
            this.label1.Text += this.control.OnLoadShop();
            this.pblist = new List<PictureBox>();
            this.pblist1 = new List<PictureBox>();
            this.llist = new List<Label>();
            this.n = 0;
            this.pblist.Add(this.pictureBox6);
            this.pblist.Add(this.pictureBox7);
            this.pblist.Add(this.pictureBox8);
            this.pblist.Add(this.pictureBox9);
            this.pblist.Add(this.pictureBox10);
            this.pblist.Add(this.pictureBox11);
            this.pblist.Add(this.pictureBox12);
            this.pblist.Add(this.pictureBox13);
            this.pblist.Add(this.pictureBox14);
            this.pblist.Add(this.pictureBox15);
            this.pblist.Add(this.pictureBox16);
            this.pblist.Add(this.pictureBox17);
            this.koeficient = (int)(SystemInformation.PrimaryMonitorSize.Height / 1024);
            List<string> text = new List<string>();
            text.Add("Team Fortress 2 - innovating roleplay shooter.\n In game you can choose one of 8 roles. \n medic,heavy,scout,demoman,soldair,engineer,spy, and sniper.\n Each of them has own changeble weapons and history. \n There are lots of different types and game modes,maps and missions.\n You will be defending castles, deathmatching, storming and capturing flags!\n\n\n So if you want to have fun in Team fortress 2 order it now.");
            text.Add("StarCraft 2 - Chalenging RTS, next chapter of SC\n Nowadays SC2 is the most popular eSport game\n Most exciting game tournaments, epic battles and mindgames are here\n\n For people who came to see next chapter of Raynor's story Starcraft2 \n has a lot to see nad play in new campaign. \n There are still 3 different sides in space war: Zergs,Protoss,Terran\n You will be excited by comanding space marines \n or invading worlds with your swarm \n\n\n So if you want to have fun in Starcraft 2 order it now.");
            text.Add("Half-Life 2: Episode Two is a first-person shooter video game \n the second episode in a series of sequels to the 2004 Half-Life 2. \n It was developed by Valve Corporation in tandem with Episode One, \n the first game in the series, and released in 2007 \n via Valve's Steam content distribution platform. \n The episode was released both separately and as a part of a bundled package \n The Orange Box. \n\n\n So if you want to play Half life,order it now.");
            text.Add("Portal is a 2007 single-player first-person puzzle-platform video game \n developed by Valve Corporation. \n The game was released in a bundle package called The Orange Box \n for Microsoft Windows and Xbox 360 on October 9, 2007,\n and for the PlayStation 3 on December 11, 2007. \n The Windows version of the game is available for download \n separately through Valve's content delivery system Steam \n and was released as a standalone retail product on April 9, 2008.\n A standalone version called Portal: Still Alive \n was released on the Xbox Live Arcade service on October 22, 2008;\n this version includes an additional 14 puzzles. \n A Mac OS X version was released as part of the Mac-compatible Steam \n\n\n So if you want to play Portal, order it now!");
            text.Add("World of Warcraft (often abbreviated as WoW)\n is a massively multiplayer online role-playing game \n It is the fourth released game set in the fantasy Warcraft universe,\n which was first introduced by Warcraft:\n Orcs & Humans in 1994.\n World of Warcraft takes place within the Warcraft world of Azeroth,\n approximately four years after the events at the conclusion \n of Blizzard's previous Warcraft release, Warcraft III: The Frozen Throne \n\n\n  So if you want to have fun in WoW order it now.");
            text.Add("Might & Magic Heroes VI is a turn-based strategy video game \n for Microsoft Windows developed by Black Hole Entertainment \n and published by Ubisoft. \n It is the sixth installment in the Heroes of Might and Magic series,\n and was released on October 13, 2011, \n coinciding with the 25th anniversary of the Might and Magic franchise. \n Heroes VI acts as a prequel to Heroes of Might and Magic V,\n occurring almost five centuries earlier, \n and is set in the fictional world of Ashan. \n The story follows the five heirs to the Griffin dynasty \n in their quests to repel a demon invasion and assist  \n or impede Michael, a legendary Archangel general plotting \n to revive an ancient war.\n\n\n So if you want to play Heroes6 , order it now!");
            text.Add("Darksiders II is an action-adventure and action role-playing game \n developed by Vigil Games and published by THQ. \n It is the sequel to Darksiders\n and was released in August 2012 for PlayStation 3,\n Xbox 360, Microsoft Windows, with a Wii U port scheduled \n later in the year.\n\n\nSo if you want to play Darksides2 , order it now!");
            text.Add("Black Mesa (previously known as Black Mesa: Source) \n is a third-party total conversion modification  \n for Valve Corporation's Source engine. \n The stated goal of the project is to recreate Valve's critically acclaimed \n 1998 video game Half-Life using the more advanced capabilities \n of the Source engine. The 40-person volunteer development team says they \n hope to create a more engrossing in-game world with more varied, \n complex environments and more challenging, realistic gameplay. \n\n\n So if you want to play BlackMesa, order it now!");
            text.Add("Dota 2 is an upcoming multiplayer online battle arena video game \n being developed by Valve Corporation and the stand-alone sequel to popular \n Defense of the Ancients mod for Warcraft III: Reign of Chaos \n and its expansion pack, The Frozen Throne. \n Formally announced on October 13, 2010, via Game Informer, \n the game is currently available for early test access purchase \n and is scheduled for a full release in 2012, \n with a free-to-play business model.\n\n\n So if you want to play Dota2 ,order it now!");
            text.Add("The Witcher is an action role-playing video game  \n developed by CD Projekt RED and published by Atari. \n The game is based on the book series by Polish author Andrzej Sapkowski.\n The Witcher takes place in a medieval fantasy world and follows the story of Geralt, \n one of a few remaining witchers – traveling monster hunter for hire,\n gifted with unnatural powers. The game's system of 'moral choices' \n as part of the storyline was noted for its time-delayed \n consequences and lack of black-and-white morality.\n\n\n So if you want ot play Witcher, order it now!");
            text.Add("Battlefield 3 (commonly abbreviated BF3) is a first-person shooter video game \n developed by EA Digital Illusions CE and published by Electronic Arts.\n It is a direct sequel to 2005's Battlefield 2, \n and the twelfth installment in the Battlefield franchise. \n\n\n So if you want to play Battle field 3 - order it now!");
            text.Add("Diablo III is an action role-playing hack and slash video game \n developed and published by Blizzard Entertainment. \n It is the third installment in the Diablo franchise.\n The game, which features elements of the hack and slash genre, \n was released in North America, Latin America, Europe, South Korea, and Taiwan\n  on May 15, 2012, and in Russia on June 7, 2012.\n Before its release, the game broke several presale records \n and became the most pre-ordered PC game to date on Amazon.com.\n Diablo III subsequently set the new all-time record \n for fastest-selling PC game by selling over 3.5 million copies  \n in the first 24 hours of its release. \n\n\n So by it immidiately !!!");
            if (this.user.Security != "developer")
            {
                this.label18.Hide();
            }

            ////this.label1.Location = new System.Drawing.Point((SystemInformation.PrimaryMonitorSize.Width - 200), 100);
            ////this.label2.Location = new System.Drawing.Point((SystemInformation.PrimaryMonitorSize.Width - 200), 120);
            ////this.label16.Location = new System.Drawing.Point((SystemInformation.PrimaryMonitorSize.Width - 20), 10);
            ////this.label15.Location = new System.Drawing.Point((SystemInformation.PrimaryMonitorSize.Width - 40), 10);
            ////this.tabControl1.Location = new System.Drawing.Point((int)((SystemInformation.PrimaryMonitorSize.Width - (SystemInformation.PrimaryMonitorSize.Height * 1.25*0.728)) / 2), (int)(SystemInformation.PrimaryMonitorSize.Height * 0.205));
            this.tabControl1.Location = new System.Drawing.Point((int)((SystemInformation.PrimaryMonitorSize.Width - (1280 * 0.728)) / 2), (int)((SystemInformation.PrimaryMonitorSize.Height - (1024 * 0.72)) / 2 /** 0.205*/));
            this.tabControl1.Size = new System.Drawing.Size((int)(1280 * 0.728), (int)(1024 * 0.72));
            this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;

            for (int i = 0; i < this.pblist.Count; i++)
            {
                int k = i;
                int j = 0;
                if (i >= 6)
                {
                    k = i - 6;
                    j = 152;
                    //// *this.koeficient;
                }

                string path = "..\\..\\pictures\\";
                this.pblist[i].BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
                this.pblist[i].Location = new System.Drawing.Point(10 + (k * 150), 400 + j);
                this.pblist[i].Name = i.ToString();
                this.pblist[i].Size = new System.Drawing.Size(150, 150);
                this.pblist[i].SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
                this.pblist[i].TabIndex = 10;
                this.pblist[i].TabStop = false;
                string src = path + i.ToString() + ".jpg";
                Image image = Image.FromFile(src);
                this.pblist[i].Image = image;
                this.pblist[i].MouseEnter += new System.EventHandler(this.PictureBoxi_MouseEnter);
                this.pblist[i].MouseLeave += new System.EventHandler(this.PictureBoxi_MouseLeave);
                this.pblist[i].Click += new System.EventHandler(this.PictureBoxi_Click);
                src = path + i.ToString() + i.ToString() + ".png";
                string src3 = path + i.ToString() + i.ToString() + i.ToString() + ".png";
                this.t1.Add(src);
                this.t2.Add(text[i]);
                this.t3.Add(src3);
                ////initializeTabPage2();
            }

            this.InitializeTabPage2();
        }
示例#14
0
        /// <summary>
        /// OKLabel is clicked.
        /// </summary>
        /// <param name="sender"> Event sender</param>
        /// <param name="e"> Event argument</param>
        private void OKLabel_Click(object sender, EventArgs e)
        {
            if (this.user.GetPassword() == this.ComputeStringMD5Hash(this.passwordTextBox.Text))
            {
                if (this.newPasswordTextBox.Text == string.Empty)
                {
                    string id = this.user.Id;
                    this.user = new Person(this.emailTextBox.Text, this.ComputeStringMD5Hash(this.passwordTextBox.Text), this.countryComboBox.SelectedItem.ToString(), this.yearComboBox.SelectedItem.ToString(), this.user.IndieGlib, this.user.Glib, this.user.GetTime(), this.user.GetAvatar());
                    this.user.Id = id;

                    string host = "localhost"; // Имя хоста
                    string database = "steame"; // Имя базы данных
                    string user = "******"; // Имя пользователя
                    string password = "******"; // Пароль пользователя

                    string Connect = "Database=" + database + ";Server=" + host + ";Uid=" + user + ";Pwd=" + password;

                    MySqlConnection mysql_connection = new MySqlConnection(Connect);

                    MySqlCommand mysql_query = mysql_connection.CreateCommand();
                    mysql_query.CommandText = "UPDATE users SET pass='******', year='" + this.yearComboBox.SelectedItem.ToString() + "', country='" + this.countryComboBox.SelectedItem.ToString() + "' WHERE id=" + this.user.Id + ';';

                    mysql_connection.Open();

                    MySqlDataReader mysql_result;

                    mysql_result = mysql_query.ExecuteReader();

                    mysql_connection.Close();
                }
                else
                {
                    if (this.newPasswordTextBox.Text == this.repeatPasswordTextBox.Text)
                    {
                        string id = this.user.Id;
                        this.user = new Person(this.emailTextBox.Text, this.ComputeStringMD5Hash(this.newPasswordTextBox.Text), this.countryComboBox.SelectedItem.ToString(), this.yearComboBox.SelectedItem.ToString(), this.user.IndieGlib, this.user.Glib, this.user.GetTime(), this.user.GetAvatar());
                        this.user.Id = id;
                        string host = "localhost"; // Имя хоста
                        string database = "steame"; // Имя базы данных
                        string user = "******"; // Имя пользователя
                        string password = "******"; // Пароль пользователя

                        string Connect = "Database=" + database + ";Server=" + host + ";Uid=" + user + ";Pwd=" + password;

                        MySqlConnection mysql_connection = new MySqlConnection(Connect);

                        MySqlCommand mysql_query = mysql_connection.CreateCommand();
                        mysql_query.CommandText = "UPDATE users SET pass='******', year='" + this.yearComboBox.SelectedItem.ToString() + "', country='" + this.countryComboBox.SelectedItem.ToString() + "' WHERE id=" + this.user.Id + ';';

                        mysql_connection.Open();

                        MySqlDataReader mysql_result;

                        mysql_result = mysql_query.ExecuteReader();

                        mysql_connection.Close();
                    }
                }

                this.Close();
            }
            else
            {
                this.passwordErrorProvider.SetError(this.passwordTextBox, "Incorrect password.");
            }
        }
示例#15
0
 public void Add(Person Person)
 {
     bracket.Add(Person);
 }
示例#16
0
 //, int _id)
 /// <summary>
 /// Shop for person
 /// </summary>
 /// <param name="p">Person in shop</param>
 public void Shop(Person p)
 {
     ShopControl control = new ShopControl(p, this.libr);
     DialogResult dlgResult = control.Run(this.form);//, _id);
     if (dlgResult == DialogResult.OK)
     {
         this.form.ReLogIn();
     }
     else
     {
         this.form.Close();
     }
 }
示例#17
0
 public void Login(string login, string password)
 {
     Person p = new Person();
     try
     {
         p = Database.User.read(login)[0];
     }
     catch (System.Exception ex)
     {
     }
     if (p.Password == this.ComputeStringMD5Hash(password))
     {
         if (p.Security == "admin")
         {
             //loginBox.Text = "";
             //passwordBox.Text = "";
             this.Admin();
         }
         else
         {
             Database.Game.read(p);
             Database.Indie.read(p);
             //this.Hide();
             this.Shop(p);
         }
     }
 }
示例#18
0
 /// <summary>
 /// Create Person
 /// </summary>
 /// <param name="p1">Log in</param>
 /// <param name="p2">User password</param>
 /// <param name="p3">User Country</param>
 /// <param name="p4">User age</param>
 public void CreatePerson(string p1, string p2, string p3, string p4)
 {
     this.newPerson = new Person(p1, p2, p3, p4);
 }
示例#19
0
 ////(string p1, string p2, string p3, string p4)
 /// <summary>
 /// Create Person
 /// </summary>
 /// <param name="pp">Person to create</param>
 public void CreatePerson(Person pp)
 {
     this.newPerson = pp;
     //// new Person(p1, p2, p3, p4);
 }
示例#20
0
 private void UserClick(object sender)
 {
     Label Caller = sender as Label;
     UserIndieGame igame=new UserIndieGame();
     for (int i = 0; i < indies.Count; i++)
     {
         if (Caller.Text == indies[i].Name)
         {
             if (igame.run(indies[i], user) == DialogResult.OK)
             {
                 user = igame.getUser();
             }
         }
     }
 }
示例#21
0
 //, int _id)
 /// <summary>
 /// Initializes a new instance of the <see cref="EditForm"/> class.
 /// </summary>
 /// <param name="newUser">New user</param>
 public EditForm(Person newUser)
 {
     this.InitializeComponent();
     this.user = newUser;
     //id = _id;
 }
示例#22
0
 public static void update(Person p)
 {
     Database.connect("UPDATE users SET email='" + p.Login + "', pass='******', year='" + p.Age + "', country='" + p.Country + "', security='" + p.Security + "', avatar='" + p.Avatar +"' WHERE id=" + p.Id);
 }
 public ShopControl(Person _user,Library _lib)
 {
     lib=_lib;
     user = _user;
     sform = new ShopForm(this,user,lib);
 }
        public void Shop(string t1, string t2)
        {
            Person temp = new Person();
            for (int i = 0; i < libr.size(); i++)
            {
                if ((t1 == libr.getLogin(i)))
                {
                    temp = libr.Get(t1);
                }
            }

            ShopControl sControl = new ShopControl(temp, libr);
            DialogResult dlgResult = sControl.Run(form);
            if (dlgResult == DialogResult.OK)
            {
                form.reLogIn();
            }
            else
            {
                form.Close();
            }
        }
示例#25
0
 public void Set(Person Person)
 {
     for (int i = 0; i < bracket.Count; i++)
     {
         if (bracket[i].Login == Person.Login)
         {
             bracket[i] = Person;
         }
     }
 }
示例#26
0
        /// <summary>
        /// Shop for person
        /// </summary>
        /// <param name="t1">Log in </param>
        /// <param name="t2">user password</param>
        public void Shop(string t1, string t2)
        {
            Person temp = new Person();
            for (int i = 0; i < this.libr.Size(); i++)
            {
                if (t1 == this.libr.GetLogin(i))
                {
                    temp = this.libr.Get(t1);
                }
            }

            ShopControl control = new ShopControl(temp, this.libr);
            DialogResult dlgResult = control.Run(this.form);//, 1);
            /*if (dlgResult == DialogResult.OK)
            {*/
                this.form.ReLogIn();
            /*}
            else
            {
                this.form.Close();
            }*/
        }
示例#27
0
 public static List<Person> read(string email = "")
 {
     List<Person> result = new List<Person>();
     MySqlDataReader mysql_result = null;
     if (email != "") mysql_result = Database.connect("SELECT email, pass, year, country, id, avatar, security FROM users WHERE email='" + email + "'");
     else mysql_result = Database.connect("SELECT email, pass, year, country, id, avatar, security FROM users WHERE 1");
     while (mysql_result.Read())
     {
         Person p = new Person();
         p.Login = mysql_result.GetString(0);
         p.Password = mysql_result.GetString(1);
         p.Security = mysql_result.GetString(6);
         p.Age = mysql_result.GetString(2);
         p.Country = mysql_result.GetString(3);
         p.Avatar = mysql_result.GetString(5);
         p.Id = mysql_result.GetString(4);
         result.Add(p);
     }
     return result;
 }
 public void createPerson(string p1, string p2, string p3, string p4)
 {
     newPerson = new Person(p1, p2, p3, p4);
 }
示例#29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShopControl"/> class.
 /// </summary>
 /// <param name="newUser">New user</param>
 /// <param name="newLib">New library</param>
 public ShopControl(Person newUser, Library newLib)
 {
     this.lib = newLib;
     this.user = newUser;
     this.sform = new ShopForm(this, this.user, this.lib);
 }
示例#30
0
        /// <summary>
        /// User click
        /// </summary>
        /// <param name="sender"> Event sender.</param>
        private void UserClick(object sender)
        {
            Label caller = sender as Label;
            UserIndieGame igame = new UserIndieGame();
            for (int i = 0; i < this.indies.Count; i++)
            {
                if (caller.Text == this.indies[i].Name)
                {
                    if (igame.Run(this.indies[i], this.user) == DialogResult.OK)
                    {

                        Database.Indie.buy(this.user.Id, this.indies[i].Id);
                        this.user = igame.GetUser();
                    }
                }
            }
        }
示例#31
0
 public static void read(Person p)
 {
     MySqlDataReader mysql_result = Database.connect("SELECT * FROM indie WHERE id IN (SELECT id_indie FROM bought_indies WHERE id_user="******");");
     string prefix = "..\\..\\Indie Games\\";
     while (mysql_result.Read())
     {
         Registration.Indie insert = new Registration.Indie();
         insert.Id = Int32.Parse(mysql_result.GetString(0));
         insert.Name = mysql_result.GetString(1);
         insert.Description = mysql_result.GetString(2);
         insert.Path = prefix + mysql_result.GetString(4);
         insert.Icon = prefix + mysql_result.GetString(3);
         p.IndieGlib.Add(insert);
     }
 }