コード例 #1
0
        public EinhausenListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<EinhausenConfig>.Instance);

            this.InitializeComponent();

        }
        public BadMergentheimListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<BadMergentheimConfig>.Instance);

            this.InitializeComponent();

        }
        public GeschichteDerWallfahrtListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<GeschichteDerWallfahrtConfig>.Instance);

            this.InitializeComponent();

        }
        public TaunusprozessionListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<TaunusprozessionConfig>.Instance);

            this.InitializeComponent();

        }
        public GrokrotzenburgListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<GrokrotzenburgConfig>.Instance);

            this.InitializeComponent();

        }
コード例 #6
0
        public UbuntuLinksListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<UbuntuLinksConfig>.Instance);

            this.InitializeComponent();

        }
        public BadSchonbornListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<BadSchonbornConfig>.Instance);

            this.InitializeComponent();

        }
        public RundUmDieBasilikaListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<RundUmDieBasilikaConfig>.Instance);

            this.InitializeComponent();

        }
        public ReisemobilWallfahrtListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<ReisemobilWallfahrtConfig>.Instance);

            this.InitializeComponent();

        }
コード例 #10
0
        public AboutThisApp1ListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<AboutThisApp1Config>.Instance);

            this.InitializeComponent();

        }
コード例 #11
0
        public ChangelogListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<ChangelogConfig>.Instance);

            this.InitializeComponent();

        }
コード例 #12
0
        public BlutaltarListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<BlutaltarConfig>.Instance);

            this.InitializeComponent();

        }
        public RundUmDieWallfahrtWalldurnListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<RundUmDieWallfahrtWalldurnConfig>.Instance);

            this.InitializeComponent();

        }
        public HauptUndThemenwallfahrtListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<HauptUndThemenwallfahrtConfig>.Instance);

            this.InitializeComponent();

        }
        public TagDerKrankenListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<TagDerKrankenConfig>.Instance);

            this.InitializeComponent();

        }
        public GroerBlutfeiertagListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<GroerBlutfeiertagConfig>.Instance);

            this.InitializeComponent();

        }
        public ErstkommunionkinderwallfahrtListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<ErstkommunionkinderwallfahrtConfig>.Instance);

            this.InitializeComponent();

        }
        public AboutNANConfessionsTeamListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<AboutNANConfessionsTeamConfig>.Instance);

            this.InitializeComponent();

        }
        public EntwicklungListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<EntwicklungConfig>.Instance);

            this.InitializeComponent();

        }
        public WallfahrtssontageListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<WallfahrtssontageConfig>.Instance);

            this.InitializeComponent();

        }
        public PilgergruppenListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<PilgergruppenConfig>.Instance);

            this.InitializeComponent();

        }
        public AndachtZumEhrenDesHlBluteListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<AndachtZumEhrenDesHlBluteConfig>.Instance);

            this.InitializeComponent();

        }
        public HeidingsfeldListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<HeidingsfeldConfig>.Instance);

            this.InitializeComponent();

        }
コード例 #24
0
        public ActionResult Index(string startISO, string endISO, int page = 1)
        {
            DateTime startDate;
            DateTime endDate;
            DateTime.TryParse(startISO, out startDate);
            DateTime.TryParse(endISO, out endDate);

            string userId = User.Identity.GetUserId();
            ListViewModel<Event> model = new ListViewModel<Event>()
            {
                List = repository.TakeAllFromTo(userId, startDate, endDate).OrderBy(p => p.DateStart)
                    .Skip((page - 1) * PageSize).Take(PageSize),

                PagingInfo = new PagingInfo()
                {
                    CurrentPage = page,
                    ItemsPerPage = PageSize,
                    TotalItems = repository.TakeAllFromTo(userId, startDate, endDate).Count()
                },
                StartISO = startISO,
                EndISO = endISO,
                ShortStartDateString = startDate.ToShortDateString() + " " + startDate.ToShortTimeString(),
                ShortEndDateString = endDate.ToShortDateString() + " " + endDate.ToShortTimeString()
            };
            return View(model);
        }
        public KolpingwallfahrtListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<KolpingwallfahrtConfig>.Instance);

            this.InitializeComponent();

        }
        public SendYourConfessionsListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<SendYourConfessionsConfig>.Instance);

            this.InitializeComponent();

        }
コード例 #27
0
        public MombrisListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<MombrisConfig>.Instance);

            this.InitializeComponent();

        }
コード例 #28
0
        public OberRodernListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<OberRodernConfig>.Instance);

            this.InitializeComponent();

        }
コード例 #29
0
        public NeubrunnListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<NeubrunnConfig>.Instance);

            this.InitializeComponent();

        }
        public FronleichnamListPage()
        {
			this.ViewModel = ListViewModel.CreateNew(Singleton<FronleichnamConfig>.Instance);

            this.InitializeComponent();

        }
コード例 #31
0
        private void ViewSelectionChanged()
        {
            GridViewModel.IsCommandBarOpen = false;
            ListViewModel.IsCommandBarOpen = false;

            GridViewModel.IsActive = _isGridChecked && !_isListChecked;
            ListViewModel.IsActive = _isListChecked && !_isGridChecked;

            if (GridViewModel.IsActive)
            {
                GridViewModel.UpdateExternalSelection();
            }

            if (ListViewModel.IsActive)
            {
                ListViewModel.UpdateExternalSelection();
            }
        }
コード例 #32
0
 public void LoadSearchResults()
 {
     LoadingViewModel.IsLoading = true;
     DoOnAsynchThread(() =>
     {
         try
         {
             ListViewModel = new ListViewModel(RecordType, RecordService, ApplicationController,
                                               CreateEditDialog == null ? (Action <GridRowViewModel>)null : OnEdit,
                                               CreateEditDialog == null ? (Action)null : OnAdd, CustomFunctions);
             Controller.LoadToUi(ListViewModel);
         }
         finally
         {
             LoadingViewModel.IsLoading = false;
         }
     });
 }
コード例 #33
0
        // ACTIONS
        public IActionResult List(int page = 1)
        {
            int loggedUserId = this.GetClaim <int>(nameof(DataAccess.Entities.User.Id));

            ListViewModel listViewModel = new ListViewModel()
            {
                Notifications = notificationRepository.Get(page: page, amount: ITEM_PER_PAGE_SIZE,
                                                           filter: n => n.Resident.Id == loggedUserId,
                                                           orderBy: q => q.OrderByDescending(n => n.Id)),

                PaginationModel = Pagination.Pagination.GetBuilder
                                  .SetRecordsAmountPerPage(ITEM_PER_PAGE_SIZE)
                                  .SetCurrentPage(page)
                                  .SetTotalRecordsAmount(notificationRepository.Count(n => n.Resident.Id == loggedUserId))
            };

            return(View(listViewModel));
        }
コード例 #34
0
        public IActionResult Index(int?group, int pageNo = 1)
        {
            var militariesFiltered = _militaries.Where(m => !group.HasValue || m.MilitaryGroupId == group.Value);

            // Поместить список групп во ViewData
            ViewData["Groups"] = _militaryGroups;

            // Получить id текущей группы и поместить в TempData
            var currentGroup = group.HasValue ? group.Value : 0;

            ViewData["CurrentGroup"] = currentGroup;

            if (Request.IsAjaxRequest())
            {
                return(PartialView("_ListPartial", ListViewModel <Military> .GetModel(militariesFiltered, pageNo, _pageSize)));
            }
            return(View(ListViewModel <Military> .GetModel(militariesFiltered, pageNo, _pageSize)));
        }
コード例 #35
0
        public async Task <ActionResult> healthBeautyProducts(string q = "", string tags = null, int minPrice = 0, int maxPrice = 50000, bool accessories = false, string condition = null, int?page = null)
        {
            ViewBag.category    = "Fashion";
            ViewBag.subcategory = "Beauty products";
            string city   = Session["City"] == null || Session["City"].ToString() == "All Pakistan" ? null : Session["City"].ToString();
            var    result = await StudyController.searchResults("Fashion", "Beauty products", q, tags, minPrice, maxPrice, city, null, 50000, condition);

            var pager = new Pager(result.Count(), page);

            var viewModel = new ListViewModel
            {
                ItemsCount = result.Count(),
                Items      = result.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize),
                Pager      = pager
            };

            return(View("../Study/Index", viewModel));
        }
コード例 #36
0
        public IActionResult MyRent(int page = 1)
        {
            int ITEM_PER_PAGE_SIZE = 6;

            int loggedUserId = this.GetClaim <int>(nameof(DataAccess.Entities.User.Id));

            ListViewModel listViewModel = new ListViewModel()
            {
                Apartments = apartmentRepository.Get(page: page, amount: ITEM_PER_PAGE_SIZE, filter: a => a.Renter.Id == loggedUserId),

                PaginationModel = Pagination.Pagination.GetBuilder
                                  .SetRecordsAmountPerPage(ITEM_PER_PAGE_SIZE)
                                  .SetCurrentPage(page)
                                  .SetTotalRecordsAmount(apartmentRepository.Count(a => a.Renter.Id == loggedUserId))
            };

            return(View(listViewModel));
        }
コード例 #37
0
        protected override void Init()
        {
            var vm = new ListViewModel();

            BindingContext = vm;
            vm.Init();
            var listview = new ListView();

            listview.SetBinding(ListView.ItemsSourceProperty, new Binding("Items"));
            listview.ItemTemplate  = new DataTemplate(typeof(CustomTextCell));
            listview.ItemSelected += (object sender, SelectedItemChangedEventArgs e) =>
            {
                (e.SelectedItem as ListItemViewModel).CanExecute = true;
                ((e.SelectedItem as ListItemViewModel).DeleteItemCommand as Command).ChangeCanExecute();
            };
            // Initialize ui here instead of ctor
            Content = listview;
        }
コード例 #38
0
        public async Task <ActionResult> Index(string q = "", string tags = null, int minSalary = 0, int maxSalary = 10000, int?page = null)
        {
            ViewBag.category      = "Jobs";
            ViewBag.subcategories = new string[] { "Customer Service", "It", "Online Jobs", "Marketing", "Advertising & PR", "Sales", "Clerical & Administration", "Human Resources", "Education", "Hotels & Tourism", "Accounting & Finance", "Manufacturing", "Part time Jobs", "Other Jobs" };

            var result = await searchResults("Jobs", null, q, tags, minSalary, maxSalary, Session["City"] == null || Session["City"].ToString() == "All Pakistan"?null : Session["City"].ToString());

            var pager = new Pager(result.Count(), page);

            var viewModel = new ListViewModel
            {
                ItemsCount = result.Count,
                Items      = result.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize),
                Pager      = pager
            };

            return(View(viewModel));
        }
コード例 #39
0
        public IActionResult Search(ListViewModel model)
        {
            model.Groups = CleanGroups(model.Groups);
            var preTickets = ticketRepository.Tickets
                             .Where(t => model.TicketID == null || model.TicketID.Value == t.TicketId)
                             .Where(t => model.AssignmentStatus == null || model.AssignmentStatus.Value == t.AssignmentStatus)
                             .Where(t => model.Title == null || t.Title.Contains(model.Title))
                             .Where(t => model.Groups == null || model.Groups.Length == 0 || model.Groups.Contains(t.AssignedGroup.Name))
                             .Where(t => model.User == null || t.AssignedUser.UserName.Contains(model.User));

            model.PageSize   = 10;
            model.PageNumber = 1;
            model.Total      = preTickets.Count();
            model.Tickets    = preTickets.OrderBy(t => t.TicketId)
                               .Skip((model.PageNumber - 1) * model.PageSize)
                               .Take(model.PageSize);
            return(View("List", model));
        }
コード例 #40
0
        public async Task <ActionResult> Bikes(string brand, string model, string q = "", string tags = null, int minPrice = 0, int maxPrice = 50000, bool accessories = false, string condition = null, int?page = null)
        {
            ViewBag.category = "Bikes";

            string city   = Session["City"] == null || Session["City"].ToString() == "All Pakistan" ? null : Session["City"].ToString();
            var    result = await searchBikes("Vehicles", "Bikes", brand, model, q, tags, minPrice, maxPrice, city, null, 50000, accessories, condition);

            var pager = new Pager(result.Count(), page);

            var viewModel = new ListViewModel
            {
                ItemsCount = result.Count,
                Items      = result.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize),
                Pager      = pager
            };

            return(View(viewModel));
        }
コード例 #41
0
        public ListViewModel GetAll(ListViewModel paginate)
        {
            var query = GetAll();

            if (!string.IsNullOrEmpty(paginate.EmailFrom))
            {
                query = query.Where(c => c.EmailFrom.ToLower().Contains(paginate.EmailFrom.ToLower()));
            }

            if (!string.IsNullOrEmpty(paginate.Subject))
            {
                query = query.Where(c => c.Subject.ToLower().Contains(paginate.Subject.ToLower()));
            }

            if (!string.IsNullOrEmpty(paginate.Message))
            {
                query = query.Where(c => c.Message.ToLower().Contains(paginate.Message.ToLower()));
            }

            if (DateTime.TryParse(paginate.SendAt, out var sendAt))
            {
                query = query.Where(c => c.SendAt.ToShortDateString() == sendAt.ToShortDateString());
            }

            switch (paginate.HasRead)
            {
            case HasReadStatus.Read:
                query = query.Where(c => c.HasRead);
                break;

            case HasReadStatus.Unread:
                query = query.Where(c => c.HasRead == false);
                break;

            case HasReadStatus.None:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            paginate.Paginate(query);
            return(paginate);
        }
コード例 #42
0
        public ActionResult List(ListViewModel model)
        {
            if (model.Filter == null)
            {
                model.Filter = new ListFilterViewModel();
            }

            if (!model.CurrentPage.HasValue)
            {
                model.CurrentPage = 1;
            }

            if (!model.PageSize.HasValue)
            {
                model.PageSize = 10;
            }
            //select list
            model.SeanceSelectList = GetSeanceSelectList(SessionHelper.CurrentUser.UserToken);
            model.SalonSelectList  = GetSalonSelectList(SessionHelper.CurrentUser.UserToken);

            MoviesSearchFilter searchFilter = new MoviesSearchFilter();

            searchFilter.CurrentPage     = model.CurrentPage.HasValue ? model.CurrentPage.Value : 1;
            searchFilter.PageSize        = model.PageSize.HasValue ? model.PageSize.Value : 10;
            searchFilter.SortOn          = model.SortOn;
            searchFilter.SortDirection   = model.SortDirection;
            searchFilter.Filter_SeanceId = model.Filter.Filter_SeanceId;
            searchFilter.Filter_SalonId  = model.Filter.Filter_SalonId;
            searchFilter.Filter_Name     = model.Filter.Filter_Name;

            var apiResponseModel = _moviesService.GetAllPaginatedWithDetailBySearchFilter(SessionHelper.CurrentUser.UserToken, searchFilter);

            if (apiResponseModel.ResultStatusCode == ResultStatusCodeStatic.Success)
            {
                model.DataList = apiResponseModel.Data;
            }
            else
            {
                ViewBag.ErrorMessage = apiResponseModel.ResultStatusMessage;
                model.DataList       = new Business.Models.PaginatedList <MoviesWithDetail>(new List <MoviesWithDetail>(), 0, model.CurrentPage.Value, model.PageSize.Value, model.SortOn, model.SortDirection);
                return(View(model));
            }
            return(View(model));
        }
コード例 #43
0
        public ActionResult List(string errorMessage = "")
        {
            if (!string.IsNullOrEmpty(errorMessage))
            {
                ViewBag.ErrorMessage = errorMessage;
            }
            ListViewModel model = new ListViewModel();

            model.Filter      = new ListFilterViewModel();
            model.CurrentPage = 1;
            model.PageSize    = 10;

            BroadcastSearchFilter searchFilter = new BroadcastSearchFilter();

            searchFilter.CurrentPage   = model.CurrentPage.HasValue ? model.CurrentPage.Value : 1;
            searchFilter.PageSize      = model.PageSize.HasValue ? model.PageSize.Value : 10;
            searchFilter.SortOn        = model.SortOn;
            searchFilter.SortDirection = model.SortDirection;
            if (model.Filter.Filter_ValidationEndDateTime.HasValue)
            {
                searchFilter.Filter_ValidationEndDateTimeAsString = model.Filter.Filter_ValidationEndDateTime.Value.ToString("yyyy-MM-dd");
            }
            searchFilter.Filter_BroadcastTypeId = BroadcastTypeStatic.Announcement;
            model.Filter.Filter_BroadcastTypeId = BroadcastTypeStatic.Announcement;
            model.CurrentLanguageTwoChar        = SessionHelper.CurrentLanguageTwoChar;
            // select lists
            model.FilterIsActiveSelectList = GetIsActiveSelectList(SessionHelper.CurrentLanguageTwoChar);

            var apiResponseModel = _broadcastService.GetAllPaginatedWithDetailBySearchFilter(SessionHelper.CurrentUser.UserToken, SessionHelper.CurrentLanguageTwoChar, searchFilter);

            if (apiResponseModel.ResultStatusCode == ResultStatusCodeStatic.Success)
            {
                model.DataList = apiResponseModel.Data;
            }
            else
            {
                model.DataList           = new Business.Models.PaginatedList <BroadcastWithDetail>();
                model.DataList.Items     = new List <BroadcastWithDetail>();
                ViewBag.ErrorMessage     = apiResponseModel.ResultStatusMessage;
                ViewBag.ErrorMessageList = apiResponseModel.ErrorMessageList;
                return(View(model));
            }
            return(View(model));
        }
コード例 #44
0
        public ActionResult Index(ListViewModel model)
        {
            if (ModelState.IsValid)
            {
                string timeToday = DateTime.Now.ToString("h:mm:ss tt");
                string dateToday = DateTime.Now.ToString("M/dd/yyyy");

                Claim  sessionEmail = ClaimsPrincipal.Current.FindFirst(ClaimTypes.Email);
                string userEmail    = sessionEmail.Value;
                string text_details = Request.Form["text_details"];
                string check_public = Request.Form["check_public"];
                using (var dbContext = new MvcDbContext())
                {
                    Users user = dbContext.Users.FirstOrDefault(usr => usr.Email == userEmail);
                    Lists list = dbContext.Lists.Create();
                    list.Details     = text_details;
                    list.Date_Posted = dateToday;
                    list.Time_Posted = timeToday;
                    if (user != null)
                    {
                        list.User_Id = user.Id;
                        if (check_public != null)
                        {
                            list.Public = "YES";
                        }
                        else
                        {
                            list.Public = "NO";
                        }
                        dbContext.Lists.Add(list);
                        dbContext.SaveChanges();
                        ModelState.Clear();
                    }
                }
            }
            else
            {
                ModelState.AddModelError("", "One or more fields are having an incorrect format");
            }

            List <ListViewModel> listItems = GetListItems();

            return(View(listItems));
        }
コード例 #45
0
        public ActionResult Index(int page = 1)
        {
            var       user    = (UserViewModel)Session["CurrentUser"];
            WSRequest request = null;

            request = new WSRequest("/plans?page=" + page);
            request.AddAuthorization(Session["token"].ToString());
            var response = request.Get();
            ListViewModel <PlanViewModel> model = new ListViewModel <PlanViewModel>();

            if (response.Code == 200)
            {
                var body = response.Body;

                var pagination = body.GetValue("pagination");
                if (pagination != null)
                {
                    model.Pagination = new PaginationViewModel
                    {
                        NextPage         = (bool)pagination["next_page"],
                        PreviousPage     = (bool)pagination["previous_page"],
                        CurrentPage      = (int)pagination["current_page"],
                        TotalNumberPages = (int)pagination["total_number_pages"],
                        ControllerName   = "Plan"
                    };
                }

                foreach (var plan in body["plans"])
                {
                    model.ListModel.Add(
                        new PlanViewModel
                    {
                        IdPlan      = (int)plan["id_plan"],
                        Name        = plan["name"].ToString(),
                        Left        = (int)plan["left"],
                        Price_cents = (int)plan["price_cents"],
                        Rewards     = plan["rewards"].ToString(),
                    }
                        );
                }
                ;
            }
            return(View(model));
        }
コード例 #46
0
        public ActionResult Report(ReportViewModel filter)
        {
            var user = (UserViewModel)Session["CurrentUser"];
            ListViewModel <ReportViewModel> model = new ListViewModel <ReportViewModel>();

            model.Filter = filter;
            WSRequest request = null;

            request = new WSRequest("/plans/reports?id_plan=" + filter.IdPlan +
                                    "&id_plan2=" + filter.IdPlan +
                                    "&name=" + filter.Name +
                                    "&plan_left=" + filter.PlanLeft +
                                    "&plan_left2=" + filter.PlanLeft2 +
                                    "&plan_sold=" + filter.PlanSold +
                                    "&plan_sold2=" + filter.PlanSold2);
            request.AddAuthorization(Session["token"].ToString());
            var response = request.Get();

            if (response.Code == 200)
            {
                var body   = response.Body;
                var report = body["report"];
                foreach (var plan in report)
                {
                    model.ListModel.Add(
                        new ReportViewModel
                    {
                        IdPlan     = (int)plan["id_plan"],
                        Name       = plan["name_plan"].ToString(),
                        PlanLeft   = (int)plan["plan_left"],
                        PriceCents = (int)plan["price_cents"],
                        PlanSold   = (int)plan["plan_solds"],
                    }
                        );
                }
                ;
                return(View(model));
            }
            else
            {
                ModelState.AddModelError("", response.Code + " - " + response.Body["Message"]);
                return(View(model));
            }
        }
コード例 #47
0
        public async Task <ActionResult> Books(string q = "", string tags = null, int minPrice = 0, int maxPrice = 10000, int?page = null)
        {
            ViewBag.category = "Education & Learning";
            //var subcategories = new string[] { "Books & Study Material", "Home Tuitions", "Classes", "Courses", "Others in Education & Learning" };
            //ViewBag.subcategories = subcategories;
            ViewBag.subcategory = "Books & Study Material";
            var result = await searchResults("Education-Learning", "Books & Study Material", q, tags, minPrice, maxPrice, Session["City"] == null || Session["City"].ToString() == "All Pakistan"?null : Session["City"].ToString());

            var pager = new Pager(result.Count(), page);

            var viewModel = new ListViewModel
            {
                ItemsCount = result.Count(),
                Items      = result.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize),
                Pager      = pager
            };

            return(View("Index", viewModel));
        }
コード例 #48
0
        public IActionResult List(int?id)
        {
            ListViewModel model = new ListViewModel();

            if (id != null)
            {
                model.Arabalar     = _context.Arabalar.Where(x => x.MarkaId == id).Include("Marka").ToList();
                model.CurrentMarka = _context.Markalar.Where(x => x.Id == id).SingleOrDefault();
            }
            else
            {
                model.Arabalar = _context.Arabalar.Include("Marka").ToList();
            }
            model.Markalar = _context.Markalar.ToList();



            return(View(model));
        }
コード例 #49
0
        public async Task <IActionResult> Remove(int id = 0)
        {
            if (id > 0)
            {
                var removeEntity = _lesson.FindById(Convert.ToInt32(id));
                if (removeEntity != null)
                {
                    _lesson.Remove(removeEntity);
                    _lesson.Save();
                }
            }
            ListViewModel model = new ListViewModel
            {
                Lessons = await _lesson.GetList()
            };

            model.Lessons.OrderBy(x => x.LessonName).ToList();
            return(Content(id.ToString()));
        }
コード例 #50
0
 /// <summary>
 ///		Inicializa las propiedades
 /// </summary>
 private void InitProperties()
 {
     // Inicializa la colección
     ProjectsDefinition = new ListViewModel <ListItems.ProjectDefinitionListItemViewModel>();
     // Carga la colección de proyectos
     foreach (Model.Definitions.ProjectDefinitionModel project in SourceEditorViewModel.Instance.PluginsController.ProjectDefinitions)
     {
         ProjectsDefinition.Add(new ListItems.ProjectDefinitionListItemViewModel(project));
     }
     // Asigna la ruta inicial
     if (_solution == null)
     {
         PathTarget = SourceEditorViewModel.Instance.PathData;
     }
     else
     {
         PathTarget = System.IO.Path.GetDirectoryName(_solution.FullFileName);
     }
 }
コード例 #51
0
        public IActionResult List()
        {
            if (HttpContext.Session.GetInt32("currentUserId") == null)
            {
                return(RedirectToAction("Main"));
            }
            int currentId = (int)HttpContext.Session.GetInt32("currentUserId");

            ViewBag.alias = _context.users
                            .FirstOrDefault(item => item.usersId == currentId)
                            .alias;
            ViewBag.id = currentId;
            ListViewModel showIdeas = new ListViewModel
            {
                ideas = _context.ideas.Include(item => item.creator).ToList()
            };

            return(View(showIdeas));
        }
コード例 #52
0
        public ActionResult List()
        {
            ListViewModel model = new ListViewModel();

            model.Filter = new ListFilterViewModel();
            if (model.Filter == null)
            {
                model.Filter = new ListFilterViewModel();
            }

            if (!model.CurrentPage.HasValue)
            {
                model.CurrentPage = 1;
            }

            if (!model.PageSize.HasValue)
            {
                model.PageSize = 10;
            }
            //select list
            model.ProfileSelectList = GetProfileSelectList(SessionHelper.CurrentUser.UserToken);

            UserSearchFilter searchFilter = new UserSearchFilter();

            searchFilter.CurrentPage = model.CurrentPage.HasValue ? model.CurrentPage.Value : 1;
            searchFilter.PageSize    = model.PageSize.HasValue ? model.PageSize.Value : 10;

            var apiResponseModel = _userService.GetAllPaginatedWithDetailBySearchFilter(SessionHelper.CurrentUser.UserToken, searchFilter);

            if (apiResponseModel.ResultStatusCode == ResultStatusCodeStatic.Success)
            {
                model.DataList = apiResponseModel.Data;
            }
            else
            {
                ViewBag.ErrorMessage    = apiResponseModel.ResultStatusMessage;
                model.ProfileSelectList = GetProfileSelectList("");
                model.DataList          = new Business.Models.PaginatedList <UserWithDetail>(new List <UserWithDetail>(), 0, model.CurrentPage.Value, model.PageSize.Value, model.SortOn, model.SortDirection);
                return(View(model));
            }

            return(View(model));
        }
コード例 #53
0
        private async Task ChangeWeekOfYearActionAsync()
        {
            try
            {
                var datas = new List <Message.GenericData>();

                String              dateStr, labelStr;
                DateTime            date;
                Message.GenericData data, currentData = null;
                for (int i = 1; i <= 52; i++)
                {
                    date     = Utils.YearWeekToPlanningDateTime(TrainingWeek.Year, i);
                    dateStr  = string.Format(Translation.Get(TRS.FROM_THE_P0TH_TO_THE_P1TH_OF_P2_P3), date.Day, date.AddDays(6).Day, Translation.Get(((TMonthType)date.Month).ToString().ToUpper()), date.Year);
                    labelStr = Translation.Get(TRS.WEEK_NUMBER) + ' ' + i;

                    data = new Message.GenericData()
                    {
                        Tag = i, Name = labelStr, Description = dateStr
                    };
                    datas.Add(data);

                    if (i == TrainingWeek.WeekOfYear)
                    {
                        currentData = data;
                    }
                }

                var result = await ListViewModel.ShowGenericListAsync(Translation.Get(TRS.WEEK_NUMBER), datas, currentData, this);

                if (result.Validated && result.SelectedData != null)
                {
                    if (((int)result.SelectedData.Tag) > 0)
                    {
                        TrainingWeek.WeekOfYear = (int)result.SelectedData.Tag;
                    }
                    SynchronizeData();
                }
            }
            catch (Exception except)
            {
                ILogger.Instance.Error("Unable to change week of year", except);
            }
        }
コード例 #54
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ViewModel = new ListViewModel();

            View view         = inflater.Inflate(Resource.Layout.fragment_list, container, false);
            var  recyclerView =
                view.FindViewById <RecyclerView>(Resource.Id.recyclerView);

            recyclerView.HasFixedSize       = true;
            recyclerView.SetAdapter(adapter = new BrowseItemsAdapter(Activity, ViewModel));

            refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher);
            refresher.SetColorSchemeColors(Resource.Color.accent);

            progress            = view.FindViewById <ProgressBar>(Resource.Id.progressbar_loading);
            progress.Visibility = ViewStates.Gone;

            return(view);
        }
コード例 #55
0
        public ActionResult List()
        {
            ListViewModel model = new ListViewModel();

            model.Filter      = new ListFilterViewModel();
            model.CurrentPage = 1;
            model.PageSize    = 10;
            ProfileSearchFilter searchFilter = new ProfileSearchFilter();

            searchFilter.CurrentPage   = model.CurrentPage.HasValue ? model.CurrentPage.Value : 1;
            searchFilter.PageSize      = model.PageSize.HasValue ? model.PageSize.Value : 10;
            searchFilter.SortOn        = model.SortOn;
            searchFilter.SortDirection = model.SortDirection;
            searchFilter.Filter_Code   = model.Filter.Filter_Code;
            searchFilter.Filter_Name   = model.Filter.Filter_Name;

            model.DataList = _profileService.GetAllPaginatedWithDetailBySearchFilter(searchFilter);
            return(View(model));
        }
コード例 #56
0
        public async Task <IActionResult> LoadComments([FromBody] ListViewModel vm)
        {
            var comments = context.Ideas
                           .Where(r => r.Id == vm.IdeaId)
                           .Select(x => x.Comments.Select(z =>
                                                          new Comment {
                Id        = z.Id,
                Owner     = z.Owner,
                Text      = z.Text,
                DateTime  = z.DateTime,
                RepliedTo = z.RepliedTo
            }).OrderByDescending(r => r.DateTime).ToList()
                                   );
            var JsonData = JsonConvert.SerializeObject(comments, Formatting.Indented, new JsonSerializerSettings {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            });

            return(Json(JsonData));
        }
コード例 #57
0
        public ActionResult List(ListViewModel model)
        {
            // filter bilgilerinin default boş değerlerle doldurulması sağlanıyor
            if (model.Filter == null)
            {
                model.Filter = new ListFilterViewModel();
            }

            if (!model.CurrentPage.HasValue)
            {
                model.CurrentPage = 1;
            }

            if (!model.PageSize.HasValue)
            {
                model.PageSize = 10;
            }

            AuthSearchFilter searchFilter = new AuthSearchFilter();

            searchFilter.CurrentPage     = model.CurrentPage.HasValue ? model.CurrentPage.Value : 1;
            searchFilter.PageSize        = model.PageSize.HasValue ? model.PageSize.Value : 10;
            searchFilter.SortOn          = model.SortOn;
            searchFilter.SortDirection   = model.SortDirection;
            searchFilter.Filter_Code     = model.Filter.Filter_Code;
            searchFilter.Filter_NameTR   = model.Filter.Filter_NameTR;
            searchFilter.Filter_NameEN   = model.Filter.Filter_NameEN;
            model.CurrentLanguageTwoChar = SessionHelper.CurrentLanguageTwoChar;

            var apiResponseModel = _authService.GetAllPaginatedWithDetailBySearchFilter(SessionHelper.CurrentUser.UserToken, SessionHelper.CurrentLanguageTwoChar, searchFilter);

            if (apiResponseModel.ResultStatusCode == ResultStatusCodeStatic.Success)
            {
                model.DataList = apiResponseModel.Data;
            }
            else
            {
                ViewBag.ErrorMessage     = apiResponseModel.ResultStatusMessage;
                ViewBag.ErrorMessageList = apiResponseModel.ErrorMessageList;
                return(View(model));
            }
            return(View(model));
        }
コード例 #58
0
        [Route("category-{alias}-{id}/shop_list.html")] //View product by list view
        public IActionResult Shop_List(int id, int?pageSize, string sortBy, string priceRange, int page = 1)
        {
            ViewData["BodyClass"] = "shop_list_page";
            var catalog = new ListViewModel();

            if (pageSize == null)
            {
                pageSize = _configuration.GetValue <int>("PageSize_List");
            }

            catalog.PageSize = pageSize;
            catalog.SortType = sortBy;
            var results = new PageResult <ProductViewModel>();

            if (priceRange != null)
            {
                catalog.IsSorted      = true;
                catalog.PriceSort     = priceRange;
                TempData["PriceSort"] = priceRange;
                results = _productService.SortProductByConditions(id, priceRange, catalog.SortType, page, pageSize.Value);
            }
            else
            {
                results = _productService.SortProductByConditions(id, string.Empty, catalog.SortType, page, pageSize.Value);
            }

            catalog.Data            = results;
            catalog.ProductCategory = _productCategoryService.GetById(id);
            catalog.AllCategories   = _productCategoryService.GetAll();
            catalog.Blogs           = _blogService.GetAll().Take(4).ToList();
            catalog.ProductTags     = _productService.GetAllTags().Take(10).ToList();

            var session = HttpContext.Session.Get <List <CartViewModel> >(CommonConstants.CartSession);

            if (session != null)
            {
                catalog.CartViewModels = session;
            }

            //catalog.AdvertisementViewModels = _advertisementService.GetClientSideAds(AdsPages.Category);

            return(View(catalog));
        }
コード例 #59
0
        public ActionResult List(int page = 1)
        {
            var aos = _addressObjectService.ListByPage(page, PAGE_SIZE);

            var pageingInfo = new PagingViewModel
            {
                CurrentPage  = page,
                TotalItems   = _addressObjectService.List().Count,
                ItemsPerPage = PAGE_SIZE
            };

            var list = new ListViewModel
            {
                AddressObjects = aos.Select(ao => _addressObjectMapper.Map(ao)),
                PagingInfo     = pageingInfo
            };

            return(View(list));
        }
コード例 #60
0
ファイル: ProjectController.cs プロジェクト: RIDICS/ITJakub
        public IActionResult CooperationList(long projectId, string search, int start, int count = PageSizes.CooperationList)
        {
            SetProjectPermissions(projectId);

            var client = GetProjectClient();

            search = search ?? string.Empty;
            var result    = client.GetUserGroupsByProject(projectId, start, count, search);
            var viewModel = new ListViewModel <UserGroupContract>
            {
                TotalCount  = result.TotalCount,
                List        = result.List,
                PageSize    = count,
                Start       = start,
                SearchQuery = search
            };

            return(PartialView("Work/SubView/_CooperationList", viewModel));
        }