Esempio n. 1
0
        //* * * TARIFF MANAGER METHODS
        //// GET METHODS
        /// <summary>
        /// Retreives all Period objects in the database
        /// </summary>
        /// <returns>JSON representation of List[Period], wrapped in EMResponse object.</returns>
        public string getPeriods()
        {
            EMResponse response = new EMResponse();
            try
            {
                tariffMgr = new TariffManager();
                response.data = EMConverter.fromObjectToJSON(tariffMgr.getSCPeriods());
                response.status = ok;
            }
            catch (Exception e)
            {
                response.status = error;
                response.data = e.Message;
            }

            return EMConverter.fromObjectToJSON(response);
        }