예제 #1
0
        public static async Task DeleteInstance(FormTemplateInstanceEntity instance)
        {
            await StorageHelper.DeleteContainer(instance.RowKey);

            var table = GetTemplateInstancesTable();

            await table.ExecuteAsync(TableOperation.Delete(instance));
        }
예제 #2
0
        private static async Task AddRecords(string userKey, DateTime uploadDate, string templateName, string version, string templateId, string currentInstanceId, string manifestFileName, string templateFileName, string originalFileName)
        {
            var table = GetTemplatesTable();

            await table.CreateIfNotExistsAsync();

            var templateEntity = new FormTemplateEntity(userKey, templateName)
            {
                TemplateId        = templateId,
                CurrentInstanceId = currentInstanceId,
                CurrentVersion    = version
            };

            var tableOperation = TableOperation.InsertOrReplace(templateEntity);

            await table.ExecuteAsync(tableOperation);



            var instancesTable = GetTemplateInstancesTable();

            await instancesTable.CreateIfNotExistsAsync();

            var instanceEntity = new FormTemplateInstanceEntity(templateId, currentInstanceId)
            {
                Version            = version,
                Uploaded           = uploadDate,
                ManifestFileName   = manifestFileName,
                TemplateFileName   = templateFileName,
                XsnOrginalFileName = originalFileName
            };

            var instanceOperation = TableOperation.InsertOrReplace(instanceEntity);

            await instancesTable.ExecuteAsync(instanceOperation);
        }