private void GetChamadaAberta() { ConsumeRest getChamada = new ConsumeRest(); string parametros = string.Format("professorId={0}&sitChamadaId={1}", usuario.Id, (int)SitChamadaEnum.Aberta); getChamada.GetResponse <Retorno>("chamada/ChamadaAberta", parametros).ContinueWith(t => { Device.BeginInvokeOnMainThread(() => { if ((TpRetornoEnum)t.Result.TpRetorno == TpRetornoEnum.Sucesso && t.Result.ObjRetorno != null) { if (t.Result.ObjTypeName == typeof(ChamadaVO).Name) { chamada = Metodos.JsonToCustomObject <ChamadaVO>(t.Result.ObjRetorno); ExibeDadosChamada(); } dadosChamada.BackgroundColor = Color.FromHex("328325"); } else if ((TpRetornoEnum)t.Result.TpRetorno == TpRetornoEnum.Erro) { dadosChamada.BackgroundColor = Color.FromHex("A63030"); } Label lb = GetLabelDefaul(); lb.Text = t.Result.RetornoMensagem + ((!string.IsNullOrWhiteSpace(t.Result.RetornoDescricao)) ? (Environment.NewLine + t.Result.RetornoDescricao) : ""); dadosChamada.IsVisible = true; dadosChamada.Content = lb; }); }); }
private void GetMateriaNovaChamada() { ConsumeRest getMateria = new ConsumeRest(); getMateria.GetResponse <Retorno>("chamada/MateriaNovaChamada", string.Format("professorId={0}", usuario.Id)).ContinueWith(t => { if (t.IsCompleted) { Device.BeginInvokeOnMainThread(() => { if ((TpRetornoEnum)t.Result.TpRetorno == TpRetornoEnum.Sucesso && t.Result.ObjRetorno != null) { if (t.Result.ObjTypeName == typeof(MateriaForChamadaVO).Name) { materia = Metodos.JsonToCustomObject <MateriaForChamadaVO>(t.Result.ObjRetorno); ExibeDadosMateria(); } dadosMateria.BackgroundColor = Color.FromHex("328325"); } else if ((TpRetornoEnum)t.Result.TpRetorno == TpRetornoEnum.Erro) { dadosMateria.BackgroundColor = Color.FromHex("A63030"); } Label lb = GetLabelDefaul(); lb.Text = t.Result.RetornoMensagem + ((!string.IsNullOrWhiteSpace(t.Result.RetornoDescricao)) ? (Environment.NewLine + t.Result.RetornoDescricao) : ""); dadosMateria.IsVisible = true; dadosMateria.Content = lb; }); } }); }
private void GetMateriaChamada() { Label lb = GetLabelDefaul(); ConsumeRest getChamada = new ConsumeRest(); string parametros = string.Format("alunoId={0}", usuario.Id); getChamada.GetResponse <Retorno>("alunoChamada/GetChamadaAberta", parametros).ContinueWith(t => { if (t.IsCompleted) { Device.BeginInvokeOnMainThread(() => { Retorno obj; if (t.Result is Retorno) { obj = (Retorno)t.Result; if ((TpRetornoEnum)obj.TpRetorno == TpRetornoEnum.Sucesso && obj.ObjRetorno != null) { if (obj.ObjTypeName == typeof(ChamadaForPresencaVO).Name) { chamada = Metodos.JsonToCustomObject <ChamadaForPresencaVO>(obj.ObjRetorno); } dadosChamada.BackgroundColor = Color.FromHex("328325"); GetDadosChamada(chamada); } else if ((TpRetornoEnum)obj.TpRetorno == TpRetornoEnum.Erro) { dadosChamada.BackgroundColor = Color.FromHex("A63030"); } lb.Text = obj.RetornoMensagem + ((!string.IsNullOrWhiteSpace(obj.RetornoDescricao)) ? (Environment.NewLine + obj.RetornoDescricao) : ""); dadosChamada.IsVisible = true; dadosChamada.Content = lb; } }); } }); }