Пример #1
0
        public IEnumerable <ListViewModel> SortingFilteringPaging(string sortOrder, string searchString, int pagenumber, int boardid, string boardname)
        {
            IEnumerable <ListViewModel> lists;

            switch (sortOrder)
            {
            case ListVMConstants.NameDesc:
                lists = VMConverters.ModelsToViewModels(_lr.GetListsOfBoardPaging(e => e.Name, SortDirection.Descending, searchString, pagenumber, PageSize, boardid), boardname);
                break;

            case ListVMConstants.NameAsc:
                lists = VMConverters.ModelsToViewModels(_lr.GetListsOfBoardPaging(e => e.Name, SortDirection.Ascending, searchString, pagenumber, PageSize, boardid), boardname);
                break;

            case ListVMConstants.LixDesc:
                lists = VMConverters.ModelsToViewModels(_lr.GetListsOfBoardPaging(e => e.Lix, SortDirection.Descending, searchString, pagenumber, PageSize, boardid), boardname);
                break;

            case ListVMConstants.LixAsc:
                lists = VMConverters.ModelsToViewModels(_lr.GetListsOfBoardPaging(e => e.Lix, SortDirection.Ascending, searchString, pagenumber, PageSize, boardid), boardname);
                break;

            default:     // Lix ascending
                lists = VMConverters.ModelsToViewModels(_lr.GetListsOfBoardPaging(e => e.Lix, SortDirection.Ascending, searchString, pagenumber, PageSize, boardid), boardname);
                break;
            }
            return(lists);
        }
Пример #2
0
        public IEnumerable <CardViewModel> SortingFilteringPaging(string sortOrder, string searchString, int pagenumber, int listid, string listname)
        {
            IEnumerable <CardViewModel> cards;

            switch (sortOrder)
            {
            case CardVMConstants.NameDesc:
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.Name, SortDirection.Descending, searchString, pagenumber, PageSize, listid), listname);
                break;

            case CardVMConstants.NameAsc:
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.Name, SortDirection.Ascending, searchString, pagenumber, PageSize, listid), listname);
                break;

            case CardVMConstants.DiscriptionDesc:
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.Discription, SortDirection.Descending, searchString, pagenumber, PageSize, listid), listname);
                break;

            case CardVMConstants.DiscriptionAsc:
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.Discription, SortDirection.Ascending, searchString, pagenumber, PageSize, listid), listname);
                break;

            case CardVMConstants.CDateDesc:
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.CreationDate, SortDirection.Descending, searchString, pagenumber, PageSize, listid), listname);
                break;

            case CardVMConstants.CDateAsc:
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.CreationDate, SortDirection.Ascending, searchString, pagenumber, PageSize, listid), listname);
                break;

            case CardVMConstants.DueDateDesc:
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.DueDate, SortDirection.Descending, searchString, pagenumber, PageSize, listid), listname);
                break;

            case CardVMConstants.DueDateAsc:
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.DueDate, SortDirection.Ascending, searchString, pagenumber, PageSize, listid), listname);
                break;

            case CardVMConstants.CixDesc:
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.Cix, SortDirection.Descending, searchString, pagenumber, PageSize, listid), listname);
                break;

            case CardVMConstants.CixAsc:
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.Cix, SortDirection.Ascending, searchString, pagenumber, PageSize, listid), listname);
                break;

            default:     // Cix ascending
                cards = VMConverters.ModelsToViewModels(_cr.GetCardsOfListPaging(e => e.Cix, SortDirection.Ascending, searchString, pagenumber, PageSize, listid), listname);
                break;
            }
            return(cards);
        }
Пример #3
0
        /*[HttpGet]
         * [Route("CheckBoardName")]
         * public JsonResult CheckBoardName(string Name)
         * {
         *  var result = _br.HasRepeatedBoardName(id, Name);
         *  return Json(result, JsonRequestBehavior.AllowGet);
         * }
         */
        #endregion

        #region Auxiliar Methods
        public IEnumerable <BoardViewModel> SortingFilteringPaging(string sortOrder, string searchString, int pagenumber)
        {
            IEnumerable <BoardViewModel> boards;

            switch (sortOrder)
            {
            case BoardVMConstants.NameDesc:
                boards = VMConverters.ModelsToViewModels(_br.GetAllPaging(e => e.Name, SortDirection.Descending, searchString, pagenumber, PageSize));
                break;

            case BoardVMConstants.DiscriptionAsc:
                boards = VMConverters.ModelsToViewModels(_br.GetAllPaging(e => e.Discription, SortDirection.Ascending, searchString, pagenumber, PageSize));
                break;

            case BoardVMConstants.DiscriptionDesc:
                boards = VMConverters.ModelsToViewModels(_br.GetAllPaging(e => e.Discription, SortDirection.Descending, searchString, pagenumber, PageSize));
                break;

            default:     // Name ascending
                boards = VMConverters.ModelsToViewModels(_br.GetAllPaging(e => e.Name, SortDirection.Ascending, searchString, pagenumber, PageSize));
                break;
            }
            return(boards);
        }