Esempio n. 1
0
        public ResponseData <Settings> Index(string id)
        {
            try
            {
                var states     = _stateService.GetAllState();
                var appliances = _applianceService.GetApplianceByAccountId(Convert.ToInt64(id));
                var settings   = new Settings()
                {
                    Appliances = appliances,
                    States     = states
                };

                var response = new ResponseData <Settings>();
                response.Data    = settings;
                response.Message = ResponseMessage.Success;
                response.Status  = ResponseStatus.Success.ToString();
                return(response);
            }
            catch (Exception ex)
            {
                var response = new ResponseData <Settings>();
                response.Message = ex.Message;
                response.Status  = ResponseStatus.Error.ToString();
                return(response);
            }
        }