Ejemplo n.º 1
0
        private string GetNonActiveConfigFileName(string template, Durados.Workflow.IDocument controller, bool overrideExistingFile, Durados.View view, string documentFieldName, Dictionary <string, object> values, string pk, Dictionary <string, object> blocksValues, string documentFileNameKey)
        {
            string filename;
            string xmlFileNameExtention = ".xml";

            if (string.IsNullOrEmpty(documentFileNameKey))
            {
                string xmlFileName = GetFileNameWithoutExtention(documentFileNameKey) + xmlFileNameExtention;
                filename = GetFileName(xmlFileName, pk, null);
            }
            else
            {
                filename = controller.GetFileName(pk, template, blocksValues, documentFileNameKey, view, values);
                if (filename == documentFileNameKey)
                {
                    documentFieldName = GetFileNameWithoutExtention(template);
                    string documentFileName = GetFileNameWithoutExtention(documentFileNameKey);
                    filename = GetFileName(documentFieldName + xmlFileNameExtention, pk, documentFileName);
                }
                else
                {
                    filename = controller.GetFileName(view, documentFieldName, filename);
                }
            }


            if (!overrideExistingFile)
            {
                filename = GetNotExistFile(filename);
            }
            return(filename);
        }
Ejemplo n.º 2
0
        protected override string GetFileName(string template, Durados.Workflow.IDocument controller, Dictionary <string, Parameter> parameters, Durados.View view, string documentFieldName, Dictionary <string, object> values, System.Data.DataRow prevRow, string pk, string connectionString, System.Data.IDbCommand command, object data)
        {
            Dictionary <string, object> blocksValues = (Dictionary <string, object>)controller.GetBlocksValues(pk, view);
            string filename            = null;
            string documentFileNameKey = null;

            if (parameters.ContainsKey(DocumentParameters.DocumentFileNameKey.ToString()))
            {
                documentFileNameKey = parameters[DocumentParameters.DocumentFileNameKey.ToString()].Value;
            }
            bool overrideExistingFile = false;

            if (parameters.ContainsKey(DocumentParameters.OverrideExistingFile.ToString()))
            {
                overrideExistingFile = Convert.ToBoolean(parameters[DocumentParameters.OverrideExistingFile.ToString()].Value);
            }

            if (IsActiveConfiguration(view, data))
            {
                string activeConfigFileName = GetActiveConfigFileName(template, pk, documentFileNameKey);
                filename = controller.GetFileName(view, documentFieldName, activeConfigFileName);
                RenamePreviousActiveConfigFileName(template, controller, overrideExistingFile, view, documentFieldName, values, pk, blocksValues, documentFileNameKey, command, filename);
            }
            else
            {
                filename = GetNonActiveConfigFileName(template, controller, overrideExistingFile, view, documentFieldName, values, pk, blocksValues, documentFileNameKey);
            }

            return(filename);
        }