// GET: Complaint
        public ActionResult Index()
        {
            ViewBag.Date                  = DateTime.Now;
            ViewBag.ComplaintType         = _complaintType.GetAll();
            ViewBag.currentType           = 0;
            ViewBag.ComplaintStatus       = _complaintStatus.GetAll();
            ViewBag.currentStatus         = 0;
            ViewBag.SolutionStatus        = _slnStatus.GetAll();
            ViewBag.currentSolutionStatus = 0;
            ViewBag.Agents                = _user.GetAllComplaintUsers();//.GetAll();
            ViewBag.currentAgent          = 0;
            if (Session["UserId"] == null)
            {
                return(RedirectToAction("LogOff", "Account"));
            }
            List <vComplaint> complaints = new List <vComplaint>();

            if (User.IsInRole("Admin"))
            {
                complaints = _vComplaint.GetTodayComplaint().Where(c => c.ComplaintStatus.ToUpper() != "CLOSED").ToList();//GetTodayComplaint(user.UserId).Where(c => c.ComplaintStatus.ToUpper() != "CLOSED").ToList();
            }
            else if (User.IsInRole("User"))
            {
                var user = _user.GetUser(User.Identity.Name);
                complaints = _vComplaint.GetTodayComplaint(user.UserId).Where(c => c.ComplaintStatus.ToUpper() != "CLOSED").ToList();//.GetTodayComplaint().Where(c => c.ComplaintStatus.ToUpper() != "CLOSED").ToList();
            }
            else
            {
                var user = _user.GetUser(User.Identity.Name);
                complaints = _vComplaint.GetTodayComplaintBySupportUser(user.UserId).Where(c => c.ComplaintStatus.ToUpper() != "CLOSED").ToList();//.GetTodayComplaint().Where(c => c.ComplaintStatus.ToUpper() != "CLOSED").ToList();
            }

            ViewBag.Msg = TempData["Msg"];
            return(View(complaints));
        }
        // GET: Dashboard
        public ActionResult Index()
        {
            ViewBag.sDate = DateTime.Now.ToString("dd/MM/yyyy");
            ViewBag.eDate = DateTime.Now.ToString("dd/MM/yyyy");
            var dt = _vComplaint.GetTodayComplaint();
            DashboardViewModel obj = new DashboardViewModel();

            obj.TotalUnresolved = dt.Where(c => c.SolutionStatus.ToUpper() != "RESOLVED FULLY").ToList().Count();
            obj.TotalClosed     = dt.Where(c => c.ComplaintStatus.ToUpper() == "CLOSED").ToList().Count();
            obj.TotalComplaint  = dt.Count();
            obj.TotalResolved   = dt.Where(c => c.SolutionStatus.ToUpper() == "RESOLVED FULLY").ToList().Count();
            var ct = GetChartData(DateTime.Now, DateTime.Now);

            ViewBag.Chart = _app.GetChart(ChartTypes.Column, "Complaints Chart", ct.data.ToArray(), ct.series.ToArray(), Color.White, Color.White, $"Complaints from {DateTime.Now.ToString("MMM dd, yyyy")} To {DateTime.Now.ToString("MMM dd, yyyy")}", "Complaint Code", "No.of Complaints");
            return(View(obj));
        }