public FORM_ChangePassword(TRS_Domain.USER.Data selectedUser, TRS_Domain.USER.Data client)
 {
     _selectedUser = selectedUser;
     _client       = client;
     InitializeComponent();
     Loaded += FORM_ChangePassword_Loaded;
 }
        private void Btn_CreateGroup_Click(object sender, RoutedEventArgs e)
        {
            FromJoinOrCreateNewGroup joinOrCreateNewGroup = new FromJoinOrCreateNewGroup();

            joinOrCreateNewGroup.ShowDialog();
            if (joinOrCreateNewGroup.DialogResult == true)
            {
                FORM_CreateGroup PopUp = new FORM_CreateGroup(_client);
                PopUp.ShowDialog();
                if (PopUp.DialogResult == true)
                {
                    _client = _clientLogic.LoadClient((_client.UserId));

                    LB_Groups.Items.Clear();
                    foreach (var item in _client.Groups)
                    {
                        LB_Groups.Items.Add((item));
                    }
                }
            }
            else
            {
                Fr_Main.Content = new FORMS.COMPONENTS.MAIN.PageJoinGroup(Fr_Main, _client, this);
            }
        }
Пример #3
0
        public bool CreateGroup(TRS_Domain.USER.Data client, string Name, string Description, object selectedInterest, string picturePath, byte[] bitMap, string region)
        {
            //  Define output:
            bool output = false;

            //  Try-Catch for safety:
            try
            {
                //  ExHanding:
                if (exHandler.NewGroup(Name, Description, selectedInterest, picturePath))
                {
                    if (bitMap != null)
                    {
                        output = groupRepo.AddGroup(client, Name, Description, bitMap, region);
                    }
                    else
                    {
                        output = groupRepo.AddGroup(client, Name, Description, region);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(output);
        }
 public General(int groupId, Frame frame, TRS_Domain.USER.Data client, FORMS.FormMain main)
 {
     this.groupId = groupId;
     InitializeComponent();
     frameimin = frame;
     _client   = client;
     Main      = main;
 }
Пример #5
0
 public PageUserInformation(TRS_Domain.USER.Data client, Frame contentFrame, Frame mainFrame)
 {
     _client       = client;
     _contentFrame = contentFrame;
     _mainContent  = mainFrame;
     Loaded       += PAGE_UserInformation_Loaded;
     InitializeComponent();
 }
Пример #6
0
 public PAGE_CreateUser(TRS_Domain.USER.Data client, TRS_Domain.USER.Data selectedUser, Frame userInfo, Frame contentFrame)
 {
     _client          = client;
     _selectedUser    = selectedUser;
     _clientInfoFrame = userInfo;
     _contentFrame    = contentFrame;
     _contentFrame.NavigationService.RemoveBackEntry();
     InitializeComponent();
     Loaded += PAGE_CreateUser_Loaded;
 }
        public TRS_Domain.USER.Data LoadClient(int clientId)
        {
            //  Define output:
            TRS_Domain.USER.Data output = new TRS_Domain.USER.Data();

            output = _userRepo.GetUser(clientId);
            output.SetGroups(_groupRepo.GetGroups(output.UserId));

            return(output);
        }
 public PAGE_EventOverview(Frame contentFrame, Frame channelFrame, Data selectedEvent, TRS_Domain.USER.Data user, TRS_Domain.GROUP.Data selectedgroup, ClientClass clientClass, FORMS.FormMain main)
 {
     InitializeComponent();
     _channelFrame  = channelFrame;
     _contentFrame  = contentFrame;
     _currentEvent  = selectedEvent;
     _currentUser   = user;
     _selectedGroup = selectedgroup;
     ClientClass    = clientClass;
     _main          = main;
 }
        private void BTN_SaveGroupName_Click(object sender, RoutedEventArgs e)
        {
            GroupControl_Logic.SaveGroupName(groupId, TB_GroupName.Text);
            _client = clientLogic.LoadClient((_client.UserId));

            Main.LB_Groups.Items.Clear();
            foreach (var item in _client.Groups)
            {
                Main.LB_Groups.Items.Add(item);
            }
        }
Пример #10
0
        //  Program:

        public PageEditProfile(TRS_Domain.USER.Data client, TRS_Domain.USER.Data selectedUser, Frame contentFrame, Frame clientInfo)
        {
            _client       = client;
            _selectedUser = selectedUser;
            _contentFrame = contentFrame;
            _clientFrame  = clientInfo;
            _contentFrame.NavigationService.RemoveBackEntry();
            InitializeComponent();

            Loaded += PAGE_EditProfile_Loaded;
        }
 public PAGE_EditEvent(Data currentEvent, Frame contentFrame, Frame panelContentFrame, TRS_Domain.USER.Data client, TRS_Domain.GROUP.Data selectedGroup, ClientClass clientClass, FORMS.FormMain main)
 {
     _currentEvent  = currentEvent;
     _contentFrame  = contentFrame;
     _channelFrame  = panelContentFrame;
     _currentClient = client;
     _selectedGroup = selectedGroup;
     ClientClass    = clientClass;
     InitializeComponent();
     _main = main;
 }
 private void CheckIfUserIsOwner(TRS_Domain.USER.Data user)
 {
     if (user.UserId == _currentEvent.EventOwnerId || user.Type == 1)
     {
         Btn_Edit.IsHitTestVisible = true;
     }
     else
     {
         Btn_Edit.IsHitTestVisible = false;
         Btn_Edit.Opacity          = 0;
     }
 }
Пример #13
0
 public PageChat(Frame contentFrame, Frame channelFrame, TRS_Domain.CHANNEL.CHAT.Chat selectedChat, TRS_Domain.USER.Data _client, ClientClass client)
 {
     _contentFrame = contentFrame;
     _channelFrame = channelFrame;
     _selectedChat = selectedChat;
     this._client  = _client;
     this.client   = client;
     client.GetPersonInfo(_client);
     InitializeComponent();
     Lb_Chat.Items.Clear();
     Loaded += PAGE_CHAT_Loaded;
 }
Пример #14
0
 public PageGroup(Frame contentFrame, TRS_Domain.GROUP.Data selectedGroup, TRS_Domain.USER.Data _client, ClientClass client, Channel selectedChannel, FORMS.FormMain main)
 {
     _contentFrame    = contentFrame;
     _selectedGroup   = selectedGroup;
     this.client      = client;
     this._client     = _client;
     _selectedChannel = selectedChannel;
     Main             = main;
     _contentFrame.NavigationService.RemoveBackEntry();
     InitializeComponent();
     Loaded += PAGE_GROUP_Loaded;
 }
Пример #15
0
        private void Btn_LEAVE_Click(object sender, RoutedEventArgs e)
        {
            _groupLogic.Leavegroup(_client.UserId, _selectedGroup.GroupId);
            _client = clientLogic.LoadClient(_client.UserId);
            Main.LB_Groups.Items.Clear();
            foreach (var item in _client.Groups)
            {
                Main.LB_Groups.Items.Add(item);
            }

            _contentFrame.Content = null;
        }
        public FormMain(int clientId, ClientClass client)
        {
            this.client = client;
            //  Get user information
            _client = _clientLogic.LoadClient(clientId);
            //  Fill groupslist:
            foreach (var item in _client.Groups)
            {
                item.FillChats(_chatLogic.GetAllChats(item.GroupId));
            }

            Loaded += FORM_Main_Loaded;
            InitializeComponent();
        }
Пример #17
0
        public PAGE_AddEvent(TRS_Domain.GROUP.Data group, TRS_Domain.USER.Data user, Frame mainFrame, TRS_Domain.GROUP.Data selectedLbItem, ClientClass client, FORMS.FormMain Main)
        {
            InitializeComponent();
            _selectedGroup  = group;
            _mainFrame      = mainFrame;
            _currentGroupId = group.GroupId;
            _userId         = user.UserId;
            _selectedItem   = selectedLbItem;
            _user           = user;
            _client         = client;

            _main = Main;


            PAGE_AddEvent_Loaded();
        }
 public FORM_CreateInterest(TRS_Domain.USER.Data inputUser)
 {
     InitializeComponent();
     user = inputUser;
 }
 public bool JoinGroup(TRS_Domain.USER.Data client, TRS_Domain.GROUP.Data myGroup)
 {
     return(groupContext.JoinGroup(client, myGroup));
 }
Пример #20
0
        public bool ChangePassword(string oldPass, string newPass1, string newPass2, bool?reset, TRS_Domain.USER.Data user)
        {
            //  Define output:
            bool output = false;

            try
            {
                if (!reset ?? false)
                {
                    //  First input check:
                    if (exHanlder.Login(user.Email, oldPass))
                    {
                        if (_userRepo.Login(user.Email, oldPass) != user.UserId)
                        {
                            throw new PasswordNotFound();
                        }
                    }
                }

                //  Validate new password:
                if (exHanlder.NewPassword(newPass1, newPass2))
                {
                    output = _userRepo.UpdatePassword(newPass1.GetHashCode().ToString(), user);
                }
            }
            catch (PasswordNotFound ex)
            {
                throw ex;
            }
            catch (EmptyField ex)
            {
                throw ex;
            }
            catch (PasswordNotEqual ex)
            {
                throw ex;
            }

            return(output);
        }
 public void GetPersonInfo(TRS_Domain.USER.Data data)
 {
     _client = data;
 }
Пример #22
0
 public bool JoinGroup(TRS_Domain.USER.Data client, TRS_Domain.GROUP.Data Group)
 {
     return(groupRepo.JoinGroup(client, Group));
 }
Пример #23
0
 public TRS_Domain.USER.Data UpdateUserInformation(TRS_Domain.USER.Data selectedUser)
 {
     return(_userRepo.GetUser(selectedUser.UserId));
 }
 public bool AddGroup(TRS_Domain.USER.Data client, string name, string description, string region)
 {
     return(groupContext.AddGroup(client, name, description, region));
 }