public HttpResponseMessage Get()
        {
            var nvc                    = HttpUtility.ParseQueryString(Request.RequestUri.Query);
            var tipoasignacion         = nvc["tipoasignacion"];
            var soloinicialescobropago = nvc["soloinicialescobropago"];

            using (var service = new CircuitosTesoreriaCobrosService(ContextService))
            {
                var listsituaciones = appService.GetListSituaciones();
                var result          = new ResultBusquedas <CircuitoTesoreriaCobrosModel>()
                {
                    values  = soloinicialescobropago == "1" ? service.GetCircuitosTesoreria(tipoasignacion, true) : service.GetCircuitosTesoreria(tipoasignacion, false),
                    columns = new[]
                    {
                        new ColumnDefinition()
                        {
                            field = "Id", displayName = "Id", visible = true, filter = new  Filter()
                            {
                                condition = ColumnDefinition.STARTS_WITH
                            }
                        },
                        new ColumnDefinition()
                        {
                            field = "Descripcion", displayName = "Descripcion", visible = true
                        }
                    }
                };

                var response = Request.CreateResponse(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(result), Encoding.UTF8, "application/json");
                return(response);
            }
        }
 // GET: api/Supercuentas/5
 public HttpResponseMessage Get(string id)
 {
     using (var service = new CircuitosTesoreriaCobrosService(ContextService))
     {
         var list     = service.get(id) as CircuitoTesoreriaCobrosModel;
         var response = Request.CreateResponse(HttpStatusCode.OK);
         response.Content = new StringContent(JsonConvert.SerializeObject(list), Encoding.UTF8,
                                              "application/json");
         return(response);
     }
 }
Ejemplo n.º 3
0
        public override ActionResult Create()
        {
            if (TempData["errors"] != null)
            {
                ModelState.AddModelError("", TempData["errors"].ToString());
            }
            var model = TempData["model"] == null?Helper.fModel.GetModel <CircuitoTesoreriaCobrosModel>(ContextService) : TempData["model"] as CircuitoTesoreriaCobrosModel;

            using (var service = new CircuitosTesoreriaCobrosService(ContextService))
            {
                ((IToolbar)model).Toolbar = GenerateToolbar(service, TipoOperacion.Alta, model);
            }

            return(View(model));
        }