예제 #1
0
 public void SaveScheme(string schemaCode, bool canBeInlined, List <string> inlinedSchemes, string scheme)
 {
     using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString))
     {
         var wfScheme = WorkflowScheme.SelectByKey(connection, schemaCode);
         if (wfScheme == null)
         {
             wfScheme = new WorkflowScheme
             {
                 Code           = schemaCode,
                 Scheme         = scheme,
                 CanBeInlined   = canBeInlined,
                 InlinedSchemes = inlinedSchemes.Any() ? JsonConvert.SerializeObject(inlinedSchemes) : null
             };
             wfScheme.Insert(connection);
         }
         else
         {
             wfScheme.Scheme         = scheme;
             wfScheme.CanBeInlined   = canBeInlined;
             wfScheme.InlinedSchemes = inlinedSchemes.Any() ? JsonConvert.SerializeObject(inlinedSchemes) : null;
             wfScheme.Update(connection);
         }
     }
 }
 public void SaveScheme(string schemaCode, string scheme)
 {
     using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString))
     {
         WorkflowScheme wfScheme = WorkflowScheme.SelectByKey(connection, schemaCode);
         if (wfScheme == null)
         {
             wfScheme        = new WorkflowScheme();
             wfScheme.Code   = schemaCode;
             wfScheme.Scheme = scheme;
             wfScheme.Insert(connection);
         }
         else
         {
             wfScheme.Scheme = scheme;
             wfScheme.Update(connection);
         }
     }
 }