public ActionResult ZonasAlmacen(StZonasAlmacenes model)
        {
            if (string.IsNullOrEmpty(model.Id))
            {
                return(CrearListado(model));
            }

            return(CrearZonaAlmacen(model));
        }
        private ActionResult CrearZonaAlmacen(StZonasAlmacenes model)
        {
            using (var service = FService.Instance.GetService(typeof(AlmacenesModel), ContextService, MarfilEntities.ConnectToSqlServer(ContextService.BaseDatos)) as AlmacenesService)
            {
                var almacen = model.Fkalmacen;
                var list    = service.get(almacen) as AlmacenesModel;
                var intId   = Funciones.Qint(model.Id) ?? 0;

                return(Json(list.Lineas.First(f => f.Id == intId)));
            }
        }
        private ActionResult CrearListado(StZonasAlmacenes model)
        {
            var almacen = model.Fkalmacen;

            using (var service = FService.Instance.GetService(typeof(AlmacenesModel), ContextService, MarfilEntities.ConnectToSqlServer(ContextService.BaseDatos)) as AlmacenesService)
            {
                var almacenModel = service.get(almacen) as AlmacenesModel;

                var list = almacenModel.Lineas;

                var result = new ResultBusquedas <AlmacenesZonasModel>()
                {
                    values  = list,
                    columns = new[]
                    {
                        new ColumnDefinition()
                        {
                            field = "Id", displayName = "Id", visible = true, filter = new  Filter()
                            {
                                condition = ColumnDefinition.STARTS_WITH
                            }
                        },
                        new ColumnDefinition()
                        {
                            field = "Descripcion", displayName = "Descripción", visible = true, filter = new  Filter()
                            {
                                condition = ColumnDefinition.STARTS_WITH
                            }
                        },
                        new ColumnDefinition()
                        {
                            field = "Coordenadas", displayName = "Coordenadas", visible = true, filter = new  Filter()
                            {
                                condition = ColumnDefinition.STARTS_WITH
                            }
                        },
                    }
                };

                return(Json(result));
            }
        }