// 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));
        }