Beispiel #1
0
        //Treatment of the order depending on the order Type : Total / Average /Temperature ...

        public int?TreatOutputOrder(OutputOrder newOrder)
        {
            int?final;

            switch (newOrder.Command)
            {
            case "temperature":
            {
                int?temp = machineManager.GetTemperature(newOrder.MachineId);

                final = temp;
                break;
            }

            case "total":
            {
                int?total = machineManager.GetTotal(newOrder.MachineId);
                final = total;

                break;
            }

            case "average":
            {
                int?avg = machineManager.GetAverage(newOrder.MachineId);
                final = avg;
                break;
            }

            default:
            {
                final = null;
                break;
            }
            }
            return(final);
        }