Beispiel #1
0
        public async Task <(UsuariosCE, IntervencionCE)> getUsuarioIntervencionLogin(string username, string intervencion)
        {
            UsuariosCE     oUsuarioCE      = null;
            IntervencionCE oIntervencionCE = null;

            try
            {
                string metodo = "user/getUsuarioIntervencionLoginTabla?user="******"&codigointervencion=" + intervencion;

                string jsonResult = (await SingleHttpCliente.getMethod(metodo)).Replace("[", "").Replace("]", "");
                //string jsonResult = base.callMethod(metodo).Replace("[", "").Replace("]", "");
                JObject jsonObject = JObject.Parse(jsonResult);
                if (jsonObject.Count >= 1)
                {
                    var settings = new JsonSerializerSettings
                    {
                        NullValueHandling     = NullValueHandling.Ignore,
                        MissingMemberHandling = MissingMemberHandling.Ignore
                    };

                    oUsuarioCE      = JsonConvert.DeserializeObject <UsuariosCE>(jsonResult, settings);
                    oIntervencionCE = JsonConvert.DeserializeObject <IntervencionCE>(jsonResult, settings);
                }
                return(oUsuarioCE, oIntervencionCE);
            }
            catch
            {
                throw;
            }
        }
        public async Task <IntervencionCE> actualizarIntervencionEstado(int idIntervencion, int idEstado)
        {
            try
            {
                IntervencionCE oIntervencionCE = null;
                string         jsonResult      = (await SingleHttpCliente.getMethod("intervencion/actualizarEstado?idIntervencion=" + idIntervencion.ToString() + "&idEstado=" + idEstado.ToString())).Replace("[", "").Replace("]", "");
                JObject        jsonObject      = JObject.Parse(jsonResult);
                if (jsonObject.Count >= 1)
                {
                    var settings = new JsonSerializerSettings
                    {
                        NullValueHandling     = NullValueHandling.Ignore,
                        MissingMemberHandling = MissingMemberHandling.Ignore
                    };

                    oIntervencionCE = JsonConvert.DeserializeObject <IntervencionCE>(jsonResult, settings);
                }
                return(oIntervencionCE);
            }
            catch
            {
                throw;
            }
        }