示例#1
0
        protected override void Execute(CodeActivityContext context)
        {
            Assignment a = Assignment.Get(context);

            a.Status        = "Completed";
            a.DateCompleted = DateTime.Now;

            PersistAssignment persist = context.GetExtension <PersistAssignment>();

            persist.AddAssignment(context.WorkflowInstanceId, a, "Update");

            // Store the request in the OutArgument
            Assignment.Set(context, a);
        }
        protected override void Execute(CodeActivityContext context)
        {
            // Create an Assignment class and populate its properties
            Assignment a = new Assignment();

            a.WorkflowID   = context.WorkflowInstanceId;
            a.LeadID       = LeadID.Get(context);
            a.DateAssigned = DateTime.Now;
            a.AssignedTo   = AssignedTo.Get(context);
            a.Status       = "Assigned";
            a.DateDue      = DateTime.Now + TimeSpan.FromDays(5);

            PersistAssignment persist = context.GetExtension <PersistAssignment>();

            persist.AddAssignment(context.WorkflowInstanceId, a, "Insert");

            // Store the request in the OutArgument
            Assignment.Set(context, a);
        }