コード例 #1
0
        //
        //  Function:   private void Add_User()
        //
        //  Purpose:    Add a new site user after confirmation from a messagebox
        //
        private void Add_User()
        {
            Users        new_user    = new Users();
            List <Users> exist_users = new List <Users>();

            for (int i = 0; i < View_Users.Count; i++)
            {
                exist_users.Add(View_Users[i]);
            }

            var addusers = new UC_User_Selection(exist_users);

            var Add_User_Page = new Popup_Info();

            Add_User_Page.Title   = "Add Users To Site";
            Add_User_Page.Content = addusers;
            Add_User_Page.ShowDialog();

            // New site was saved, so update the tabs
            if (Add_User_Page.DialogResult == true)
            {
                List <Users> chosen_users = new List <Users>();

                chosen_users = addusers.chosen_users;

                for (int q = 0; q < chosen_users.Count; q++)
                {
                    View_Users.Add(chosen_users[q]);
                }

                Changes_Made = true;
            }
        }
コード例 #2
0
        //
        //  Function:   private void Make_User_List(int mode)
        //
        //  Arguments:  int mode = Mode of operation (0 = All Users, 1 = Just this site's users
        //
        //  Purpose:    Display the User List for a new or existing site
        //
        private void Make_User_List(int mode)
        {
            View_Users.Clear();
            DB_Users users = new DB_Users();

            if (mode == 0)
            {
                users.Get_List(0);
            }
            else
            {
                users.Get_List(1, csite.site_info.Site_ID);
            }
            for (int i = 0; i < users.User_Name.Count; i++)
            {
                Users user = new Users();
                user.PropertyChanged += User_PropertyChanged;
                user.Convert_DB_Users(users, i);
                View_Users.Add(user);
                View_Users[i].Changed     = false;
                View_Users[i].Mark_Delete = false;
            }
            Changes_Made = false;
        }