public async Task <ActionResult> Index()
        {
            tbl_emp_info loggedInUserInfo = Utilities.GetLoggedInUserInfo(User.Identity.Name);
            int?         loggedInUser     = loggedInUserInfo.Emp_ID;
            string       permission       = "";

            if (loggedInUser == null)
            {
                return(new HttpUnauthorizedResult());
            }

            List <tbl_crm_leads> allLeadList = new List <tbl_crm_leads>();

            if ((!User.IsInRole(Permissions.CRM.VIEW_ALL_LEADS)) && (User.IsInRole(Permissions.CRM.VIEW_OWN_LEADS)))
            {
                allLeadList = await db.tbl_crm_leads.Where(i => i.Generated_By == loggedInUser && i.ActionType != Constant.DELETE).ToListAsync().ConfigureAwait(false);

                permission = Permissions.CRM.VIEW_OWN_LEADS;
            }
            else if (User.IsInRole(Permissions.CRM.VIEW_ALL_LEADS))
            {
                allLeadList = await db.tbl_crm_leads.Where(i => i.ActionType != Constant.DELETE).ToListAsync().ConfigureAwait(false);

                permission = Permissions.CRM.VIEW_ALL_LEADS;
            }

            ViewBag.NumberOfContactedLeads = await leadsManager.GetNumberOfContactedLeadsAsync(loggedInUser, permission).ConfigureAwait(false);

            ViewBag.NumberOfProcessingLeads = await leadsManager.GetNumberOfProcessingLeadsAsync(loggedInUser, permission).ConfigureAwait(false);

            ViewBag.NumberOfWonLeads = await leadsManager.GetNumberOfWonLeadsAsync(loggedInUser, permission).ConfigureAwait(false);

            ViewBag.NumberOfCustomer = await leadsManager.GetNumberOfCustomerAsync(loggedInUser, permission).ConfigureAwait(false);

            return(View(allLeadList));
        }