コード例 #1
0
        // GET: / Listar todas as campanhas de cupons
        public async Task <ActionResult> ListarCoupons()
        {
            string Valores = string.Empty;
            string result  = await ConsumingAPI.Get(string.Format("http://apilive.cupommarketing.com/api-v1/coupons/{0}", code_id));

            List <ListaCupons> ListValues = new JavaScriptSerializer().Deserialize <List <ListaCupons> >(result);

            //foreach (var item in ListValues)
            //{
            //    item.name_coupon;
            //    item.quantity;
            //    item.discount;
            //    item.id_coupon;
            //}

            return(View());
        }
コード例 #2
0
        // GET: / Exibir um resumo do cupom, não é necessario passar o code_id
        public async Task <ActionResult> ResumoCupom()
        {
            string CodigoCupomDesconto = ""; // Você deve passar o codigo do cupom de desconto;

            string result = await ConsumingAPI.Get(string.Format("http://apilive.cupommarketing.com/api-v1/couponsummary/{0}", CodigoCupomDesconto));

            List <ResumoCupom> ListValues = new JavaScriptSerializer().Deserialize <List <ResumoCupom> >(result);


            //foreach (var item in ListValues)
            //{
            //    item.description;
            //    item.discount;
            //    item.customer_name;
            //}

            return(View());
        }
コード例 #3
0
        // GET: / Listar todas as validações:
        public async Task <ActionResult> ListarValidacoes()
        {
            string Valores = string.Empty;
            string result  = await ConsumingAPI.Get(string.Format("http://apilive.cupommarketing.com/api-v1/validation/{0}", code_id));

            List <ListaValidacoes> ListValues = new JavaScriptSerializer().Deserialize <List <ListaValidacoes> >(result);


            //foreach (var item in ListValues)
            //{
            //    item.name;
            //    item.email;
            //    item.phone;
            //    item.date;
            //    item.name_coupon;
            //    item.code_coupon;
            //    item.ip;
            //}

            return(View());
        }