Ejemplo n.º 1
0
        public void CreateAnAccount()
        {
            CreateAnAccount reg = new CreateAnAccount();

            reg.Visible = false;
            CreateAnAccountController controller = new CreateAnAccountController(reg);

            controller.LoadViewCreateAnAccount();
            reg.ShowDialog();
            _view.Hide();
        }
Ejemplo n.º 2
0
        private void ReceiveMessages()
        {
            strReader = new StreamReader(tcpClient.GetStream());

            // While we are successfully connected, read incoming lines from the server
            while (isConnectedToServer)
            {
                string   serverResponse = strReader.ReadLine();
                string[] data           = serverResponse.Split(';');


                if (data[0].Equals("WRONG_NICK") || data[0].Equals("NICK_INVALID") || data[0].Equals("PASSWORD_INVALID") || data[0].Equals("EMAIL_INVALID"))
                {
                    Console.WriteLine("zlyNick, mail albo haslo!!!");
                    string message = data[1];


                    _view.ShowInformation("Error", message);

                    _view.Hide();

                    CreateAnAccount reg = new CreateAnAccount();
                    reg.Visible = false;

                    CreateAnAccountController controller = new CreateAnAccountController(reg);
                    controller.LoadViewCreateAnAccount();
                    reg.ShowDialog();
                    _view.Close();
                }
                if (data[0].Equals("ACCOUNT_CREATED_SUCCESFULLY"))
                {
                    ACCOUNT_CREATED_SUCCESFULLY = true;
                    Console.WriteLine("ACCOUNT_CREATED_SUCCESFULLY");
                }
            }
        }