예제 #1
0
        private void finalizeCodeActivity_ExecuteCode(object sender, EventArgs e)
        {
            DeleteTreeRefresher deleteTreeRefresher = this.CreateDeleteTreeRefresher(this.EntityToken);

            DataEntityToken dataEntityToken = (DataEntityToken)this.EntityToken;

            IUser user = (IUser)dataEntityToken.Data;

            if (DataFacade.WillDeleteSucceed(user))
            {
                UserPerspectiveFacade.DeleteAll(user.Username);

                DataFacade.Delete(user);

                LoggingService.LogVerbose("UserManagement", String.Format("C1 Console user '{0}' deleted by '{1}'.", user.Username, UserValidationFacade.GetUsername()), LoggingService.Category.Audit);

                deleteTreeRefresher.PostRefreshMesseges();
            }
            else
            {
                this.ShowMessage(
                    DialogType.Error,
                    StringResourceSystemFacade.GetString("Composite.Management", "DeleteUserWorkflow.CascadeDeleteErrorTitle"),
                    StringResourceSystemFacade.GetString("Composite.Management", "DeleteUserWorkflow.CascadeDeleteErrorMessage")
                    );
            }
        }
        private void finalizeCodeActivity_ExecuteCode(object sender, EventArgs e)
        {
            var dataEntityToken = (DataEntityToken)this.EntityToken;

            IUser user = (IUser)dataEntityToken.Data;

            if (!DataFacade.WillDeleteSucceed(user))
            {
                this.ShowMessage(
                    DialogType.Error,
                    LocalizationFiles.Composite_Management.DeleteUserWorkflow_CascadeDeleteErrorTitle,
                    LocalizationFiles.Composite_Management.DeleteUserWorkflow_CascadeDeleteErrorMessage);
                return;
            }

            UserPerspectiveFacade.DeleteAll(user.Username);

            DataFacade.Delete(user);

            LoggingService.LogEntry("UserManagement",
                                    $"C1 Console user '{user.Username}' deleted by '{UserValidationFacade.GetUsername()}'.",
                                    LoggingService.Category.Audit,
                                    TraceEventType.Information);

            this.CreateParentTreeRefresher().PostRefreshMessages(dataEntityToken, 2);
        }
예제 #3
0
        private void finalizeCodeActivity_ExecuteCode(object sender, EventArgs e)
        {
            var dataEntityToken = (DataEntityToken)this.EntityToken;

            IUser user = (IUser)dataEntityToken.Data;

            if (!DataFacade.WillDeleteSucceed(user))
            {
                this.ShowMessage(
                    DialogType.Error,
                    StringResourceSystemFacade.GetString("Composite.Management", "DeleteUserWorkflow.CascadeDeleteErrorTitle"),
                    StringResourceSystemFacade.GetString("Composite.Management", "DeleteUserWorkflow.CascadeDeleteErrorMessage"));
                return;
            }

            UserPerspectiveFacade.DeleteAll(user.Username);

            DataFacade.Delete(user);

            LoggingService.LogVerbose("UserManagement",
                                      $"C1 Console user '{user.Username}' deleted by '{UserValidationFacade.GetUsername()}'.",
                                      LoggingService.Category.Audit);

            this.CreateParentTreeRefresher().PostRefreshMessages(dataEntityToken, 2);
        }