コード例 #1
0
ファイル: CardsController.cs プロジェクト: KorbinWilliams/ATM
 public ActionResult <IEnumerable <Card> > Get()
 {
     try
     {
         // NOTE this should be user specific right?
         // var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         return(Ok(_cs.Get()));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     };
 }
コード例 #2
0
 public object Get(int?id = null, int?id_lista = null, string nome = null)
 {
     try
     {
         return(Request.CreateResponse(HttpStatusCode.OK, SelectedFields(service.Get(id, nome, id_lista), ControllerContext)));
     }
     catch (Exception)
     {
         Dictionary <string, object> erro = new Dictionary <string, object>();
         erro.Add("success", false);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, erro));
     }
 }
コード例 #3
0
ファイル: ListasService.cs プロジェクト: brandaorafael/Trillo
    public List<Dictionary<string, object>> Get(int? id = null, string nome = null, bool card = true)
    {
        Dictionary<string, object> parametros = new Dictionary<string, object>();
        parametros.Add("id", id);
        parametros.Add("nome", nome);

        List<Dictionary<string, object>> listas = DBQuery("Lista_Select", parametros, CommandType.StoredProcedure);

        CardsService cardService = new CardsService();

        if (card)
        {
            foreach (Dictionary<string, object> lista in listas)
            {
                lista.Add("cards", cardService.Get(null, null, (int)lista["id"]));
            }
        }

        return listas;
    }
コード例 #4
0
    public List <Dictionary <string, object> > Get(int?id = null, string nome = null, bool card = true)
    {
        Dictionary <string, object> parametros = new Dictionary <string, object>();

        parametros.Add("id", id);
        parametros.Add("nome", nome);

        List <Dictionary <string, object> > listas = DBQuery("Lista_Select", parametros, CommandType.StoredProcedure);

        CardsService cardService = new CardsService();

        if (card)
        {
            foreach (Dictionary <string, object> lista in listas)
            {
                lista.Add("cards", cardService.Get(null, null, (int)lista["id"]));
            }
        }

        return(listas);
    }