예제 #1
0
        private string tarifa(HttpContext context)
        {
            option = context.Request["opt"].ToString();
            Bodega o = new Bodega();

            switch (option)
            {
            case "clienteMercancia":
                if (context.Request["key"] != null)
                {
                    key = context.Request["key"].ToString();
                }
                response = JsonConvert.SerializeObject(CatalogoCtrl.tarifaClienteMercancia(Convert.ToInt32(key)));
                break;

            case "clienteMercanciaServicio":
                response = JsonConvert.SerializeObject(
                    CatalogoCtrl.tarifaClienteMercanciaServicio(
                        Convert.ToInt32(context.Request["id_cliente"]),
                        Convert.ToInt32(context.Request["id_servicio"])
                        )
                    );
                break;

            case "clienteMercanciaNoServicio":
                response = JsonConvert.SerializeObject(
                    CatalogoCtrl.noTarifaClienteMercanciaServicio(
                        Convert.ToInt32(context.Request["id_cliente"]),
                        Convert.ToInt32(context.Request["id_servicio"])
                        )
                    );
                break;
            }
            return(response);
        }