Ejemplo n.º 1
0
        void LoginUser(Control sender)
        {
            string username = ((TextBox) this.GetControlByID("theUsername")).text;
            string password = ((TextBox) this.GetControlByID("thePassword")).text;

            myUser u = new myUser();

            if (u.GetUserByUserName(username))
            {
                if (u.Password != password)
                {
                    ((Label) this.GetControlByID("theError")).text = "The password was incorrect";
                    return;
                }
            }
            else
            {
                u.UserName = username;
                u.Password = password;
                u.InsertData();
            }
            setUsername(u);

            myGameRoom g = new myGameRoom();
            if (!g.GetGameRoomByGameRoomName("Home"))
            {
                g.GameRoomName = "Home";
                g.InsertData();
            }
            g.AddUser_(u);
            this.Page.Request.TransferToPage("Chat*GameRoomID="+g.GameRoomID);
        }
Ejemplo n.º 2
0
        private myGameRoom moveGames(string s)
        {
            if (s == "Leave")
                s = "Home";

            myGameRoom g = new myGameRoom();
            g.GetGameRoomByGameRoomName(s);
            g.AddUser_(((myUser)Page.Session["LoggedInUser"]));

            myGameRoom g1 = new myGameRoom(GameID);
            ((myUser)Page.Session["LoggedInUser"]).DeleteGameRoom(g1.GameRoomID);

            if (g1.GameRoomName != "Home")
                g1.DeleteGameRoom();
            return g;
        }