Esempio n. 1
0
        private void OnReleaseUserContextMenuClick(object sender, RoutedEventArgs e)
        {
            var fse = mouseElement.DataContext as FileSystemEntity;

            if (fse == null)
            {
                return;
            }
            var win = new WindowSelectUser();

            win.Closed += (o, ea) =>
            {
                if (win.DialogResult.HasValue && win.DialogResult.Value)
                {
                    foreach (var c in win.SelectedUsers)
                    {
                        var dr = new DocumentRelease
                        {
                            ReleaseType  = DocumentReleaseType.SystemUser,
                            DocumentId   = fse.Type == FileSystemEntityType.Folder ? Guid.Empty : fse.FileId,
                            FolderId     = fse.Type == FileSystemEntityType.Folder ? fse.FolderId : 0,
                            ReviewUserId = c.UserId,
                            ReviewOrgId  = string.Empty,
                            ReleaseTime  = DateTime.Now,
                            ReleasedBy   = AuthenticateStatus.CurrentUser.UserId
                        };
                        docContext.ReleaseDocument(dr);
                    }
                }
            };
            win.Show();
        }
Esempio n. 2
0
        private void OnReleaseUserButtonClick(object sender, RoutedEventArgs e)
        {
            var win = new WindowSelectUser();

            win.Closed += (oo, ee) =>
            {
                if (true == win.DialogResult)
                {
                    foreach (var c in win.SelectedUsers)
                    {
                        if (selectedUser.All(user => user.UserId != c.UserId))
                        {
                            selectedUser.Add(c);
                        }
                    }
                    ShowMessageReleaseInfo();
                }
            };
            win.Show();
        }