public async Task <ActionResult> CrmDashboard()
        {
            tbl_emp_info        loggedInUserInfo         = Utilities.GetLoggedInUserInfo(User.Identity.Name);
            int?                loggedInUser             = loggedInUserInfo.Emp_ID;
            int                 myTotalLeads             = 0;
            int                 myTotalLeadsToday        = 0;
            int                 TotalLeads               = 0;
            int                 TotalLeadsToday          = 0;
            int                 numberOfHighPrioritytask = 0;
            int                 totalTask             = 0;
            List <tbl_crm_task> todaysCallList        = new List <tbl_crm_task>();
            List <tbl_crm_task> todaysAppointmentList = new List <tbl_crm_task>();
            List <tbl_crm_task> todaysOtherTaskList   = new List <tbl_crm_task>();

            if (loggedInUser == null)
            {
                return(new HttpUnauthorizedResult());
            }
            else
            {
                if (User.IsInRole(Permissions.CRM.VIEW_OWN_CRM_DASHBOARD))
                {
                    myTotalLeads = await leadsManager.GetMyTotalLeadsAsync(loggedInUser).ConfigureAwait(false);

                    myTotalLeadsToday = await leadsManager.GetMyTotalLeadsTodayAsync(loggedInUser).ConfigureAwait(false);
                }
                else if (User.IsInRole(Permissions.CRM.VIEW_CRM_DASHBOARD))
                {
                    TotalLeads = await leadsManager.GetTotalLeadsAsync().ConfigureAwait(false);

                    TotalLeadsToday = await leadsManager.GetTotalLeadsTodayAsync().ConfigureAwait(false);
                }

                if (User.IsInRole(Permissions.CRM.VIEW_OWN_TASKS))
                {
                    numberOfHighPrioritytask = await taskManager.GetNumberOfInCompleteHighPriorityTaskAsync(loggedInUser).ConfigureAwait(false);

                    totalTask = await taskManager.GetTotalIncompleteTaskAsync(loggedInUser).ConfigureAwait(false);

                    todaysCallList = await taskManager.GetTodaysCallListAsync(loggedInUser).ConfigureAwait(false);

                    todaysAppointmentList = await taskManager.GetTodaysAppointmentListAsync(loggedInUser).ConfigureAwait(false);

                    todaysOtherTaskList = await taskManager.GetTodaysOtherTaskListAsync(loggedInUser).ConfigureAwait(false);
                }

                ViewBag.MyTotalLeads          = myTotalLeads;
                ViewBag.MyTotalLeadsToday     = myTotalLeadsToday;
                ViewBag.TotalLeads            = TotalLeads;
                ViewBag.TotalLeadsToday       = TotalLeadsToday;
                ViewBag.HighPriorityTask      = numberOfHighPrioritytask;
                ViewBag.TotalTask             = totalTask;
                ViewBag.TodaysCallList        = todaysCallList;
                ViewBag.TodaysAppointmentList = todaysAppointmentList;
                ViewBag.TodaysOtherTaskList   = todaysOtherTaskList;
                return(View());
            }
        }