Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameForm"/> class.
 /// </summary>
 /// <param name="newGfcntrl">New GameForm</param>
 public GameForm(GameFormController newGfcntrl)
 {
     this.src1 = string.Empty;
     this.src2 = string.Empty;
     this.text1 = string.Empty;
     this.gfcntrl = newGfcntrl;
     this.InitializeComponent();
 }
Ejemplo n.º 2
0
 public GameForm(GameFormController _gfcntrl)
 {
     src1 = "";
     src2 = "";
     text1 = "";
     gfcntrl =_gfcntrl;
     InitializeComponent();
 }
Ejemplo n.º 3
0
 public GameForm(GameFormController _gfcntrl)
 {
     src1    = "";
     src2    = "";
     text1   = "";
     gfcntrl = _gfcntrl;
     InitializeComponent();
 }
Ejemplo n.º 4
0
        private void Buy(int i)
        {
            GameFormController gfcntrl   = new GameFormController(glibr.Get(i), user, t1[i], t2[i], t3[i]);
            DialogResult       dlgResult = gfcntrl.Run(this);

            if (dlgResult == DialogResult.OK)
            {
                user.Glib.Add(glibr.Get(i));
                libr.Set(user);
                initializeTabPage2();
            }
        }
Ejemplo n.º 5
0
        private void Buy(int i)
        {
            GameFormController gfcntrl   = new GameFormController(glibr.Get(i), user, t1[i], t2[i], t3[i]);
            DialogResult       dlgResult = gfcntrl.Run(this);

            if (dlgResult == DialogResult.OK)
            {
                user.Glib.Add(glibr.Get(i));
                libr.Set(user);
                System.Web.Script.Serialization.JavaScriptSerializer oSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                File.WriteAllText(@"E:\Registration\Registration\Registration\DataBase.json", "");
                for (int j = 0; j < libr.size(); j++)
                {
                    string sJSON = oSerializer.Serialize(libr.getByIndex(j));
                    sJSON += "\n";
                    File.AppendAllText(@"E:\Registration\Registration\Registration\DataBase.json", sJSON);
                }
                initializeTabPage2();
            }
        }
Ejemplo n.º 6
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;
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 8
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;
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Buy game
        /// </summary>
        /// <param name="i">Game index</param>
        private void Buy(int i)
        {
            GameFormController gfcntrl = new GameFormController(this.glibr.Get(i), this.user, this.t1[i], this.t2[i], this.t3[i]);
            DialogResult dlgResult = gfcntrl.Run(this);
            if (dlgResult == DialogResult.OK)
            {
                this.user.Glib.Add(this.glibr.Get(i));
                this.libr.Set(this.user);

                //mysql_query.CommandText = "INSERT INTO bought_games VALUES (" + this.user.Id + ", '" + this.glibr.Get(i).Name + "');";
                Database.Game.buy(this.user.Id, this.glibr.Get(i).Name);

                this.InitializeTabPage2();
            }
        }
Ejemplo n.º 10
0
        private void Buy(int i)
        {
            GameFormController gfcntrl = new GameFormController(glibr.Get(i), user, t1[i], t2[i], t3[i]);
            DialogResult dlgResult = gfcntrl.Run(this);
            if (dlgResult == DialogResult.OK)
            {
                user.Glib.Add(glibr.Get(i));
                libr.Set(user);
                System.Web.Script.Serialization.JavaScriptSerializer oSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                File.WriteAllText(@"E:\Registration\Registration\Registration\DataBase.json", "");
                for (int j = 0; j < libr.size(); j++)
                {
                    string sJSON = oSerializer.Serialize(libr.getByIndex(j));
                    sJSON += "\n";
                    File.AppendAllText(@"E:\Registration\Registration\Registration\DataBase.json", sJSON);

                }
                initializeTabPage2();
            }
        }
Ejemplo n.º 11
0
 private void Buy(int i)
 {
     GameFormController gfcntrl = new GameFormController(glibr.Get(i), user, t1[i], t2[i], t3[i]);
     DialogResult dlgResult = gfcntrl.Run(this);
     if (dlgResult == DialogResult.OK)
     {
         user.Glib.Add(glibr.Get(i));
         libr.Set(user);
         initializeTabPage2();
     }
 }