Esempio n. 1
0
        private void UpdateSharedUserList(bool AllSelected)
        {
            UserListCollection SharedUserList = (UserListCollection)dgSharedUsers.ItemsSource;

            foreach (var item in SharedUserList)
            {
                item.IsSelected = AllSelected;
            }

            dgSharedUsers.ItemsSource = null;
            dgSharedUsers.ItemsSource = SharedUserList;
        }
Esempio n. 2
0
        private void btnSendEmail_Click(object sender, RoutedEventArgs e)
        {
            if (ApplicationViewModel.Instance.DemoMode)
            {
                DemoMode dm = new DemoMode();
                dm.Show();
                return;
            }


            UserListCollection SharedUserList = (UserListCollection)dgSharedUsers.ItemsSource;



            var filteredList = from user in SharedUserList
                               where user.IsSelected == true
                               select new { FirstName = user.FirstName, LastName = user.LastName, UserID = user.UserId };
            List <int> userIds = new List <int>();

            if (filteredList.Count() == 0)
            {
                spMsg.Visibility       = System.Windows.Visibility.Visible;
                tbSaveError.Visibility = System.Windows.Visibility.Visible;
                return;
            }

            foreach (var item in filteredList)
            {
                userIds.Add(item.UserID);
            }
            if (applicationViewModel.CurrentCanvasId > 0)
            {
                applicationViewModel.ResendEmail(applicationViewModel.CurrentCanvasId, userIds);
            }
            waitCursor.Visibility  = System.Windows.Visibility.Visible;
            spMsg.Visibility       = System.Windows.Visibility.Collapsed;
            btnSendEmail.IsEnabled = false;
        }
Esempio n. 3
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (ApplicationViewModel.Instance.DemoMode)
            {
                DemoMode dm = new DemoMode();
                dm.Show();
                return;
            }



            waitCursor.Visibility = System.Windows.Visibility.Visible;
            UserListCollection userList = (UserListCollection)dgUsers.ItemsSource;

            var filteredList = from user in userList
                               where user.IsSelected == true
                               select new { FirstName = user.FirstName, LastName = user.LastName, UserID = user.UserId };
            List <int> userIds = new List <int>();



            foreach (var item in filteredList)
            {
                userIds.Add(item.UserID);
            }
            if (applicationViewModel.CurrentCanvasId > 0)
            {
                applicationViewModel.ShareCanvas(applicationViewModel.CurrentCanvasId, userIds);

                string xx = string.Join <int>(",", userIds);
            }
            else
            {
                MessageBox.Show("Cannot share unsaved canvas.");
            }

            //this.DialogResult = true;
        }