Click here to Skip to main content
15,887,338 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to send information from asp.net page to work and how to recieve data from state machine workflow to asp .net page as we are doing it in below sample application?
C#
using(WorkflowRuntime workflowRuntime = new WorkflowRuntime())
            {
                AutoResetEvent waitHandle = new AutoResetEvent(false);
                workflowRuntime.WorkflowCompleted += delegate(object sender, WorkflowCompletedEventArgs e) {waitHandle.Set();};
                workflowRuntime.WorkflowTerminated += delegate(object sender, WorkflowTerminatedEventArgs e)
                {
                    Console.WriteLine(e.Exception.Message);
                    waitHandle.Set();
                };

                ExternalDataExchangeService ExDateExchService = new ExternalDataExchangeService();
                workflowRuntime.AddService(ExDateExchService);

                POService poServiceInstance = new POService();
                ExDateExchService.AddService(poServiceInstance);

                WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(FirstWFStateMachine.POWorkflow));
                instance.Start();

                
                PO newPO = new PO();
                Console.WriteLine("Please Enter Item Code to be sent Purchase Order of");
                string ItemCode = Console.ReadLine();
                Console.WriteLine("Please Enter Due Delivery Date of Purchase Order of");
                DateTime DueDeliveryDate = Convert.ToDateTime(Console.ReadLine());
                newPO.ItemCode = ItemCode;
                newPO.PODueDeliveryDate = DueDeliveryDate;

                poServiceInstance.CreatePO(instance.InstanceId, newPO);
                Console.WriteLine("New PO created for item: " + newPO.ItemCode + " with Due Delivery Date: " + newPO.PODueDeliveryDate.Date);
                
                

                Console.WriteLine("Do you want to approve Purchase Order");
                while ( (Console.ReadLine().ToLower()) != "y")
                {
                    Console.WriteLine("Current status of Purchase Order : Created");
                    Console.WriteLine("Waiting to be Authorised");
                    DumpStateMachine(workflowRuntime, instance.InstanceId);
                    Console.WriteLine("Do you want to approve Purchase Order");
                }
                poServiceInstance.AuthorisePO(instance.InstanceId, newPO);

                Console.WriteLine("Do you want to send Purchase Order");
                while ((Console.ReadLine().ToLower()) != "y")
                {
                    Console.WriteLine("Current status of Purchase Order : Created");
                    Console.WriteLine("Waiting to be Sent");
                    DumpStateMachine(workflowRuntime, instance.InstanceId);
                    Console.WriteLine("Do you want to send Purchase Order");
                }
                poServiceInstance.SendPO(instance.InstanceId, newPO);
                DumpStateMachine(workflowRuntime, instance.InstanceId);

                System.Console.ReadKey();
                waitHandle.WaitOne();

            }
Posted
Updated 10-Jun-12 5:51am
v2
Comments
CodingLover 10-Jun-12 23:36pm    
Do you want to send information from one page to another in ASP? I am not clear with what you are looking for.
Chitla Janardhan Reddy 10-Jun-12 23:45pm    
Actually I am having 2 logins one user is enter the content and another user is approve the content. Now I entered data as user i want to send that data to approver using work flow. This is what I am looking for

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900