Exemplo n.º 1
0
        public static service make(string Status_code,
                                   string Status_response, 
                                   string Message,
                                   List<Models.structs.response> Response = null,
                                   Boolean validateResponse = true)
        {
            service Service = new service();

            #region REST_Service response

            if (validateResponse)
            {
                if (Response != null && Response.Count == 0)
                {
                    Status_response = Resources.REST_Service_Status_response_AVISO;
                    Message = Resources.REST_Service_NoResultado;
                }
            }

            Service.REST_Service.Status_code = Status_code;
            Service.REST_Service.Status_response = Status_response;
            Service.REST_Service.Message = Message;
            #endregion

            #region response data result
            Service.Response = Response;
            #endregion

            return Service;
        }
Exemplo n.º 2
0
 public static service error(string Message)
 {
     service Service = new service();
     Service.REST_Service.Status_code = Resources.REST_Service_Status_code_ERROR;
     Service.REST_Service.Status_response = Resources.REST_Service_Status_response_ERROR;
     Service.REST_Service.Message = Message;
     return Service;
 }