public ActionResult Create()
 {
     return(View("Modify", new ModifyViewModel()
     {
         ModifyInputModel = new TextTemplateModifyInputModel()
         {
             Id = guidGetter.GetGuid().ToString()
         }
     }));
 }
        public string SaveAndReturnId(T instance)
        {
            var idValue = getValueOfIdPropertyForInstance.GetId(instance);

            if (idValue == null)
            {
                idValue = guidGetter.GetGuid().ToString();
                setValueOfIdProperty.SetId(instance, idValue);
            }
            var path = string.Format("{0}{1}.xml", getDataPathForType.GetPathForDataByType(typeof(T)), idValue);

            xmlFileSerializationHelper.SerializeToPath(instance, path);
            return(idValue);
        }
Exemplo n.º 3
0
        public string ProcessBatch(TextTemplateBatch textTemplateBatch)
        {
            var pathToExtractZipTo = getWorkingFolderPath.GetPathToWorkingFolder() +
                                     TextTemplateBatchManagerSettings.TextTemplateBatchProcessTemporaryFolderName +
                                     Path.DirectorySeparatorChar +
                                     guidGetter.GetGuid();

            fileSystem.CreateFolder(pathToExtractZipTo);

            var pathToZip = getWorkingFolderPath.GetPathToWorkingFolder() +
                            TextTemplateBatchManagerSettings.TextTemplateBatchFileUploadFolderName +
                            Path.DirectorySeparatorChar +
                            textTemplateBatch.Id +
                            Path.DirectorySeparatorChar + textTemplateBatch.ZipFilename;

            textTemplateZipProcessor.ProcessZip(pathToZip, pathToExtractZipTo);

            return(pathToExtractZipTo);
        }