Exemple #1
0
        public override Response Execute()
        {
            var response = new Response()
            {
                Success = true, Message = ""
            };

            try
            {
                var sqlQueryHelper          = new SqlQueryHelper();
                var workspaceArtifactId     = Helper.GetActiveCaseID();
                var workspaceDbContext      = Helper.GetDBContext(workspaceArtifactId);
                var tempTableName           = TempTableNameWithParentArtifactsToDelete;
                var textExtractorProfileJob = new TextExtractorProfileJob(workspaceDbContext, sqlQueryHelper, tempTableName);

                response = textExtractorProfileJob.ExecutePreCascadeDelete();
            }
            catch (Exception ex)
            {
                response.Success   = false;
                response.Exception = new SystemException("Pre Cascade Delete Failure: " + ex.Message);
            }

            return(response);
        }
Exemple #2
0
        public override Response Execute()
        {
            var response = new Response()
            {
                Message = string.Empty, Success = true
            };
            var layoutArtifactIdByGuid = GetArtifactIdByGuid(Constant.Guids.Layout.ExtractorProfile);
            var layoutArtifactId       = ActiveLayout.ArtifactID;
            var validator = new Validator();

            //check if this is the Text Extractor Profile layout
            if (!validator.VerifyIfNotLayout(layoutArtifactIdByGuid, layoutArtifactId))
            {
                //check if this is a new Text Extractor Profile record
                if (!ActiveArtifact.IsNew)
                {
                    var sqlQueryHelper          = new SqlQueryHelper();
                    var workspaceDbContext      = Helper.GetDBContext(-1);
                    var activeArtifactId        = ActiveArtifact.ArtifactID;
                    var textExtractorProfileJob = new TextExtractorProfileJob(workspaceDbContext, sqlQueryHelper, activeArtifactId);

                    response = textExtractorProfileJob.ExecutePreSave();
                }
            }

            return(response);
        }