private void pictureBox1_Click(object sender, EventArgs e)
        {
            LoginHelperService.LogOutUser();
            var result = MessageBox.Show("Do you want to log out?", "Logging out", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                Authorisation auth = new Authorisation();
                this.Hide();
                auth.Show();
            }
        }
Example #2
0
        private void ProfileSec_Load(object sender, EventArgs e)
        {
            //get User
            var user = LoginHelperService.GetCurrentUser();

            // add texts to fields
            //ProfilePic.Load(user.ImageUrl);
            ProfilePic.ImageLocation = user.ImageUrl;
            Nameuser.Text            = $"{user.User.Name} {user.User.Surname}";
            Username.Text            = user.Username;
            Email.Text = user.User.Email;
            Age.Text   = $"{user.User.Age.ToString()} Years Old";
        }
Example #3
0
        private void ProfileSec_Load(object sender, EventArgs e)
        {
            var user = LoginHelperService.GetCurrentUser();

            if (user != null)
            {
                Nameuser.Text = $"{user.Student.Name} {user.Student.Surname}";
                Username.Text = user.Username;
                Email.Text    = user.Student.Email;
                Age.Text      = $"{user.Student.Age.ToString()} Years Old";
                PhoneNum.Text = user.Student.MobilePhone;
                Degree.Text   = user.Student.Degree.ToString();
            }
        }
Example #4
0
        public ContactsSection()
        {
            InitializeComponent();

            _currentUser    = LoginHelperService.GetCurrentUser();
            _contactService = new ContactService()
            {
                AddContactDel               = SocialovateService.Instance.AddUserContact,
                GetAllContactsDel           = SocialovateService.Instance.GetAllUserContacts,
                FilterContactsByUsernameDel = SocialovateService.Instance.SearchUserContactByUsername,
                SearchInAllAcountsDel       = SocialovateService.Instance.SearchForContactInDB
            };

            _userContacts = _contactService.GetUserContacts(_currentUser);
        }