public GalleryLoadResponse(PagingState paging, IEnumerable<Thumbnail> thumbnails, TagMenuState tags, FilterOrderType filterOrder)
 {
     Paging = paging;
     Thumbnails = thumbnails;
     Tags = tags;
     FilterOrder = filterOrder;
 }
 public IEnumerable<ImageLink> Updates(DateTime time, Tag tag, FilterOrderType order)
 {
     return
         Repository.Specification()
             .Tag(tag)
             .MaxDateTime(time)
             .OrderType(order)
         .Execute();
 }
 public IEnumerableSegment<ImageLink> Content(long pageNumber, Tag tag, FilterOrderType order)
 {
     return
         Repository.Specification()
             .Tag(tag)
             .OrderType(order)
             .Page(pageNumber)
         .Execute();
 }
        void LoadOrders(FilterOrderType typeFilter)
        {
            ordReq = new Schemas.Services.OrderRequest();
            //Asignamos el token que tenemos en memoria
            ordReq.SessionInfo = new Schemas.Services.SessionInfoRequest()
            {
                TokenSession = AppSecurity.securityToken.SessionId
            };

            // Cargamos las ordenes con el Distribuidor ID
            if (typeFilter == FilterOrderType.ByDistributor)
            {
                ordReq.AllOrdersByCID = false;
            }
            else if (typeFilter == FilterOrderType.ByCid)
            {
                // Cargamos las ordenes con el CID
                ordReq.AllOrdersByCID = true;
            }

            var resultService = AppRuntime.MarketData.SearchOrders(ordReq, AppSecurity.securityToken.Token);

            AppSecurity.hasExpired(resultService.SessionInfoResponse, this);

            if (resultService.ServiceResponseStatus.IsSuccess)
            {
                resultOrders = resultService.Orders;

                if (resultOrders.ToList().Count == 0)
                {
                    NoOrdersView.Hidden = false;
                }
                else
                {
                    // *** LiteDB ***
                    // Insertamos las ordenes para que las consultas
                    // Mediante los filtros sean mas ágiles
                    var resultInsert = AppRuntime.MarketliteDB.InsertAllOrders(resultOrders.ToList());

                    if (resultInsert.IsSucess)
                    {
                        //BindOrders();
                        NoOrdersView.Hidden = true;
                    }
                }
            }
        }
        private void ShowSheetAlert(UIBarButtonItem sender)
        {
            var optionMenu = UIAlertController.Create(null, "Elegir Opción", UIAlertControllerStyle.ActionSheet);

            optionMenu.AddAction(UIAlertAction.Create("Solo mis órdenes", UIAlertActionStyle.Default,
                                                      alert =>
            {
                StartAnimation();
                if (TypeFilter != FilterOrderType.ByDistributor)
                {
                    TypeFilter = FilterOrderType.ByDistributor;
                    ClearFilters();

                    LoadOrders(TypeFilter);
                    BindOrders();
                    StopAnimation();
                }
            }
                                                      ));

            optionMenu.AddAction(UIAlertAction.Create("Todas las órdenes", UIAlertActionStyle.Default,
                                                      alert =>
            {
                StartAnimation();
                if (TypeFilter != FilterOrderType.ByCid)
                {
                    TypeFilter = FilterOrderType.ByCid;
                    ClearFilters();

                    LoadOrders(TypeFilter);
                    BindOrders();
                    StopAnimation();
                }
            }
                                                      ));

            optionMenu.AddAction(UIAlertAction.Create("Cancelar", UIAlertActionStyle.Cancel,
                                                      alert =>
            {
                Console.WriteLine("Todas las órdenes");
            }
                                                      ));

            PresentViewController(optionMenu, true, null);
        }
Esempio n. 6
0
 public TableDefaultOrderPropertyAttribute(FilterOrderType orderType)
 {
     this.OrderType = orderType;
 }