Beispiel #1
0
        public ActionResult FilterContactToday()
        {
            #region "Start Checkpoint BEGIN_LOAD_LICH_LAM_VIEC_CONTACT"
            int SessionLog = TmpJobReportRepository.GetSessionLog();
            ViewBag.SessionLog = SessionLog;
            DateTime TimeBegin = DateTime.Now;
            ViewBag.TimeBegin = TimeBegin.ToString("dd/MM/yyyy HH:mm:ss:fff");

            var logbegin = new LogDashBoard
            {
                Date      = DateTime.Now.Date,
                Time      = TimeBegin.ToString("dd/MM/yyyy HH:mm:ss:fff"),
                Name      = "BEGIN_LOAD_LICH_LAM_VIEC_CONTACT",
                ContactId = 0,
                CreatedBy = UserContext.GetCurrentUser().UserID,
                Runtime   = "0",
                Session   = SessionLog,
            };

            LogDashBoardRepository.CreateLogDashBoard(logbegin);
            #endregion

            var branchId = UserContext.GetDefaultBranch();
            var userId   = UserContext.GetCurrentUser().UserID;

            var user         = UserContext.GetCurrentUser();
            var employeeType = user.IsCollaborator
                ? EmployeeType.Collaborator
                : user.IsConsultant ? EmployeeType.Consultant : EmployeeType.All;


            var levels = LevelRepository.GetAllWithContactCountForConsultant(userId, branchId, employeeType) ?? new List <LevelInfo>();
            foreach (var level in StoreData.ListLevel
                     .Where(c => !levels.Exists(p => p.LevelId == c.LevelId)))
            {
                levels.Add(level);
            }
            ViewBag.LevelWithContactCount = levels.OrderBy(c => c.LevelId).ToList();

            #region "Start Checkpoint END_CONTROLLER_LOAD_LICH_LAM_VIEC_CONTACT"
            DateTime TimeEnd = DateTime.Now;
            var      logend  = new LogDashBoard
            {
                Date      = DateTime.Now.Date,
                Time      = TimeEnd.ToString("dd/MM/yyyy HH:mm:ss:fff"),
                Name      = "END_CONTROLLER_LOAD_LICH_LAM_VIEC_CONTACT",
                ContactId = 0,
                CreatedBy = UserContext.GetCurrentUser().UserID,
                Runtime   = "0",
                Session   = SessionLog,
            };

            LogDashBoardRepository.CreateLogDashBoard(logend);
            #endregion

            return(View());
        }