Пример #1
0
 /// <summary>
 /// Gets all employees on duty.
 /// </summary>
 /// <param name="sessionID">The sessionID of the current session</param>
 /// <returns></returns>
 public List<BasicEmployee> GetAllEmployeesOnDuty(string sessionID)
 {
     List<BasicEmployee> re = new List<BasicEmployee>();
     EmployeeStatusTableAdapter esa = new EmployeeStatusTableAdapter();
     var rows = esa.GetAllWorkersOnDuty();
     foreach (var row in rows)
     {
         BasicEmployee be = new BasicEmployee();
         be.id = row.UserID;
         be.name = row.Name;
         be.role = row.Role;
         be.username = Auth.getEmployeeUsername(row.UserID);
         re.Add(be);
     }
     return re;
 }
Пример #2
0
        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);
            }
        }