using System; using System.Collections.Generic; using Laserfiche.Workflow; using Laserfiche.Workflow.Objects; namespace NewNexus.Models.Laserfiche { public class LFDBContext { public LFDBContext(string serverName) { workflowServerName = serverName; workflowApplication = "New Nexus-"; } public string workflowServerName { get; set; } private string workflowApplication { get; set; } public void GetSODocID(string SO,string username) { using (WorkflowConnection connection = WorkflowConnection.CreateConnection(workflowServerName, workflowApplication + "-" + SO)) { string workflowName = "GetSODocumentID"; Database database = connection.Database; PublishedWorkflow workflow = database.GetPublishedWorkflow(workflowName); // Optional parameters to the workflow, they are available as tokens. Dictionary parameters = new Dictionary(); parameters.Add("SalesOrder", SO); parameters.Add("Username", username); try { workflow.StartWorkflow(parameters); } catch (Exception e) { throw e; } } } } }