Example #1
0
        public IList <TabSpyOut> GetSpyItems(IDbConnection connection, int currentUserId, int lastSpyId)
        {
            var collection = _getSpyItemsList(connection, currentUserId, lastSpyId);

            TabSpyOut.InitComplexBtnCollection(collection);
            return(collection);
        }
Example #2
0
        public IPlanshetViewData InitialPlanshet(IDbConnection connection, int currentUserId, List <int> userPlanetIds = null)
        {
            if (userPlanetIds == null)
            {
                var up = _gDetailPlanetService.GetUserPlanets(connection, currentUserId);
                userPlanetIds = up.Select(i => i.Id).ToList();
            }

            #region Task

            var taskTab = new TabTaskOut {
                MotherJump = _motherJumpService.GetJumpTaskModel(connection, currentUserId),
                Collection = _uTaskService.GetActiveTask(connection, currentUserId, SetTaskItem, userPlanetIds)
            };


            taskTab.TaskButtons();
            TabTaskOut.InitComplexBtnCollection(taskTab.Collection);

            #endregion

            #region Report

            var reportTab = new TabReportOut {
                Collection = _getReportItemsList(connection, currentUserId),
                TotalItems = _uReportService.GetTotalUserReports(connection, currentUserId),
            };
            TabReportOut.InitComplexBtnCollection(reportTab.Collection);

            #endregion

            #region Spy

            var spyCollection = _getSpyItemsList(connection, currentUserId);
            var spyTab        = new TabSpyOut {
                Collection = spyCollection,
                TotalItems = _uSpyService.GetTotalUserSpyReports(connection, currentUserId),
                Buttons    = new List <IButtonsView> {
                    ButtonsView.NewSpyItemFromSerch()
                }
            };
            TabSpyOut.InitComplexBtnCollection(spyTab.Collection);

            #endregion

            return(JournalOut.InitialTabs(taskTab, reportTab, spyTab, _localizer));
        }