public override void RejectAuthorization(IWorkWikiItem item) { try { WorkflowInstance instance = theWorkflowRuntime.GetWorkflow(item.TrackingNumber); instance.Load(); item.Status = WikiStatus.Processing; item.Save(); theServiceProvider.RejectAuthorization(item.TrackingNumber, item.ID); } catch (Exception ex) { throw ex; } }
public override void RequestAuthorization(IWorkWikiItem item) { try { // Fill the parameters collection for this instance of the workflow Dictionary<string, object> parameters = new Dictionary<string, object>(); parameters.Add("WikiID", item.ID); Type type = typeof(AuthorizeEntries); WorkflowInstance instance = theWorkflowRuntime.CreateWorkflow(type, parameters); item.Status = WikiStatus.Processing; item.TrackingNumber = instance.InstanceId; item.IPAddress = HttpContext.Current.Request.UserHostAddress; item.Save(); instance.Start(); } catch (Exception ex) { if (ex.Message.ToUpperInvariant().Contains("PRIMARY KEY")) throw new InvalidConstraintException("InsertWiki failed.", ex); else throw ex; } }