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); } }
public List<BasicEmployee> GetWaitersOnDuty(string sessionID) { if (Auth.VerifySession(sessionID, "host")) { List<BasicEmployee> returnList = new List<BasicEmployee>(); CRySTALDataConnections.CRySTALDataSetTableAdapters.EmployeeStatusTableAdapter esa = new CRySTALDataConnections.CRySTALDataSetTableAdapters.EmployeeStatusTableAdapter(); CRySTALDataConnections.CRySTALDataSet.EmployeeStatusDataTable est; est = esa.GetOnDutyWorkers("waiter"); foreach (CRySTALDataConnections.CRySTALDataSet.EmployeeStatusRow worker in est.Rows) { BasicEmployee be = new BasicEmployee(); be.name = worker.Name; be.id = worker.UserID; returnList.Add(be); } return returnList; } 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); } }
void throwSessionExp(string sessionID) { CRySTALerror err = new CRySTALerror(); err.ErrorType = CRySTALerror.ErrorTypes.sessionError; err.sessionID = sessionID; err.errorMessage = "Unable to verify session ID"; throw new FaultException<CRySTALerror>(err); }