private void Paied(object sender, ExternalDataEventArgs e)
 {
     CRySTALDataConnections.CRySTALDataSetTableAdapters.CustomerTransactionsTableAdapter cta = new CRySTALDataConnections.CRySTALDataSetTableAdapters.CustomerTransactionsTableAdapter();
     cta.SetStatus(false, false, e.InstanceId);
     CRySTALDataConnections.CRySTALDataSetTableAdapters.TablesTblTableAdapter tta = new CRySTALDataConnections.CRySTALDataSetTableAdapters.TablesTblTableAdapter();
     CRySTALDataConnections.CRySTALDataSet.CustomerTransactionsDataTable ctd;
     ctd = cta.GetDataByWorkflowInstID(e.InstanceId);
     if (ctd.Rows.Count == 0) return;
     tta.SetStatus(2, ctd.First().TableNumber);
 }
Ejemplo n.º 2
0
        public void AssignTableTo(string sessionID, int table, int employeeID)
        {
            if (Auth.VerifySession(sessionID, "host"))
            {
                WorkflowRuntime workflowRuntime = AppDomain.CurrentDomain.GetData("WorkflowRuntime") as WorkflowRuntime;
                ManualWorkflowSchedulerService manualScheduler = AppDomain.CurrentDomain.GetData("ManualScheduler") as ManualWorkflowSchedulerService;
                WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(CRySTALWorkflow.CustomerWorkflow));
                instance.Start();
                CRySTALDataConnections.CRySTALDataSetTableAdapters.CustomerTransactionsTableAdapter cta = new CRySTALDataConnections.CRySTALDataSetTableAdapters.CustomerTransactionsTableAdapter();
                cta.InsertTransaction(instance.InstanceId, employeeID, table, true);
                manualScheduler.RunWorkflow(instance.InstanceId);

                CRySTALDataConnections.CRySTALDataSetTableAdapters.TablesTblTableAdapter tta = new CRySTALDataConnections.CRySTALDataSetTableAdapters.TablesTblTableAdapter();
                tta.SetStatus(1, table);
            }
            else
            {
                CRySTALerror err = new CRySTALerror();
                err.ErrorType = CRySTALerror.ErrorTypes.sessionError;
                err.sessionID = sessionID;
                err.errorMessage = "Unable to verify session ID";
                throw new FaultException<CRySTALerror>(err);
            }
        }