Beispiel #1
0
 /// <summary>
 /// 페이지 오픈.
 /// </summary>
 public static async UniTask OpenPage(NavigationViewType navigationViewType,
                                      NavigationTriggerState triggerState = NavigationTriggerState.CloseAndOpen,
                                      object pushValue = null, UnityAction actionOnFirst = null)
 {
     await NavigationManager.Instance.OpenPage(navigationViewType.ToString(), triggerState, pushValue,
                                               actionOnFirst);
 }
        public ActionResult Lands(LandFilterCriteria filter, AnnouncementType type = AnnouncementType.Buy, AnnouncementOrder order = AnnouncementOrder.Address, NavigationViewType viewtype = NavigationViewType.List, int page = 1, bool considerEmpty = true)
        {
            IEnumerable <LandAnnouncement> lands = _announcementRepository.GetListOfLands().ToList().Where(an => an.Type == type && an.Address.HasValue);

            switch (order)
            {
            case AnnouncementOrder.Address: lands = lands.OrderBy(a => a.Address.ToString()); break;

            case AnnouncementOrder.AddressDescending: lands = lands.OrderByDescending(a => a.Address.ToString()); break;

            case AnnouncementOrder.Date: lands = lands.OrderBy(a => a.Created); break;

            case AnnouncementOrder.DateDescending: lands = lands.OrderByDescending(a => a.Created); break;

            default: lands = lands.OrderBy(a => a.Address.ToString()); break;
            }
            if (ModelState.IsValid)
            {
                if (filter != null)
                {
                    if (filter.IsEmpty() && considerEmpty)
                    {
                        LandFilterCriteria newFilter = ObjectToCookie.GetObjectFromCookies <LandFilterCriteria>(Request.Cookies, COOKIE_KEY_LANDFILTER);
                        if (newFilter != null)
                        {
                            filter = newFilter;
                        }
                    }
                    lands = filter.Filter(lands);
                    ObjectToCookie.SetCookieAsObject <LandFilterCriteria>(filter, Response.Cookies, COOKIE_KEY_LANDFILTER);
                }
            }
            else
            {
                filter = new LandFilterCriteria();
            }

            ViewBag.ViewType  = viewtype;
            ViewBag.Type      = type;
            ViewBag.OrderType = order;

            if (viewtype == NavigationViewType.List)
            {
                LandsListViewModel viewModel = new LandsListViewModel();
                viewModel.Page = createPageInfo(page, lands.Count());
                setViewModel(viewModel, announcementsForPage(lands, page));
                viewModel.FilterCriteria = filter;
                return(View("Lands", viewModel));
            }
            else
            {
                LandsViewModel viewModel = new LandsViewModel();
                setViewModel(viewModel, lands);
                viewModel.FilterCriteria = filter;
                return(View("LandsMap", viewModel));
            }
        }
        public ActionResult ClearHouseFilter(AnnouncementType type = AnnouncementType.Buy, NavigationViewType viewtype = NavigationViewType.List, int page = 1)
        {
            if (Request.Cookies[COOKIE_KEY_HOUSEFILTER] != null)
            {
                var c = new HttpCookie(COOKIE_KEY_HOUSEFILTER);
                c.Expires = DateTime.Now.AddDays(-1);
                Response.Cookies.Add(c);
            }

            return(RedirectToAction("Houses", new { type = type, viewtype = viewtype, page = page }));
        }
Beispiel #4
0
 /// <summary>
 /// 팝업 오픈.
 /// </summary>
 public static async UniTask OpenPopup(NavigationViewType navigationViewType, object pushValue = null)
 {
     await NavigationManager.Instance.OpenPopup(navigationViewType.ToString(), pushValue);
 }