Пример #1
0
        /// <summary>
        /// Retrieves a tariff object with specified id.  Child objects ARE included
        /// </summary>
        /// <param name="tariffId"></param>
        /// <returns>JSON representation of Tariff object, wrapped in EMResponse object.</returns>
        public string getTariff(int tariffId)
        {
            EMResponse response = new EMResponse();
            try
            {
                tariffMgr = new TariffManager();
                response.data = EMConverter.fromObjectToJSON(tariffMgr.getTariff(tariffId));
                response.status = ok;
            }
            catch (Exception e)
            {
                response.status = error;
                response.data = e.Message;
            }

            return EMConverter.fromObjectToJSON(response);
        }