示例#1
0
 public ShowProfileForm(ChatChoiceForm chform_ref)
 {
     InitializeComponent();
     userService = new UserServiceClient("BasicHttpBinding_IUserService");
     loadControlValues();
     chref = chform_ref;
 }
示例#2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string username = tbUsername.Text;
            string password = tbPassword.Text;

            User user = userService.Login(username, password);

            // Change the Login State
            if (user.Username != null)
            {
                LoggedInUser.UserId   = user.UserId;
                LoggedInUser.Name     = user.Name;
                LoggedInUser.Email    = user.Email;
                LoggedInUser.Username = user.Username;
                LoggedInUser.Password = user.Password;

                Console.WriteLine(LoggedInUser.Username);
                MessageBox.Show("Successfully LoggedIn !", "Congrats", MessageBoxButtons.OK, MessageBoxIcon.Information);

                ChatChoiceForm choiceForm = new ChatChoiceForm();
                this.Hide();
                choiceForm.Show();
            }

            else
            {
                MessageBox.Show("Please enter Correct Username and Password", "Exit", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public BroadcastChatForm(ChatChoiceForm chref)
        {
            InitializeComponent();

            JoinServer(LoggedInUser.Username);

            this.chref = chref;
        }