Beispiel #1
0
        public ActionResult Resolved(DateTime sDate, DateTime eDate, int typeId)
        {
            ViewBag.sDate         = sDate.ToString("dd/MM/yyyy");
            ViewBag.eDate         = eDate.ToString("dd/MM/yyyy");
            ViewBag.ComplaintType = _complaintType.GetAll();
            ViewBag.currentType   = typeId;

            int UserId = 0;

            if (Session["UserId"] == null)
            {
                RedirectToAction("LogOff", "Account");
            }
            else
            {
                UserId = (int)Session["UserId"];
            }

            if (User.IsInRole("Admin"))
            {
                var complaints = _vComplaint.FilterComplaint(sDate, eDate, typeId).Where(c => c.SolutionStatus.ToUpper() == "RESOLVED FULLY").ToList();
                return(View(complaints));
            }
            else
            {
                var complaints = _vComplaint.FilterComplaintBySupportUser(sDate, eDate, typeId, 0, 0, UserId).Where(c => c.SolutionStatus.ToUpper() == "RESOLVED FULLY").ToList();
                return(View(complaints));
            }
            //var complaints = _vComplaint.FilterComplaint(sDate, eDate, typeId).Where(c => c.SolutionStatus.ToUpper() == "RESOLVED FULLY").ToList();
            //return View(complaints);
        }
        public ActionResult Index(DateTime sDate, DateTime eDate)
        {
            ViewBag.sDate = sDate.ToString("dd/MM/yyyy");
            ViewBag.eDate = eDate.ToString("dd/MM/yyyy");
            var dt = _vComplaint.FilterComplaint(sDate, eDate);
            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(sDate, eDate);

            ViewBag.Chart = _app.GetChart(ChartTypes.Column, "Complaints Chart", ct.data.ToArray(), ct.series.ToArray(), Color.White, Color.White, $"Complaints from {sDate.ToString("MMM dd, yyyy")} To {eDate.ToString("MMM dd, yyyy")}", "Complaint Code", "No.of Complaints");
            return(View(obj));
        }
        public ActionResult Index(DateTime date, int complaintStatus, int complaintType, int solnStatus, int agent)
        {
            ViewBag.Date                  = date;
            ViewBag.ComplaintType         = _complaintType.GetAll();
            ViewBag.currentType           = complaintType;
            ViewBag.ComplaintStatus       = _complaintStatus.GetAll();
            ViewBag.currentStatus         = complaintStatus;
            ViewBag.SolutionStatus        = _slnStatus.GetAll();
            ViewBag.currentSolutionStatus = solnStatus;
            ViewBag.Agents                = _user.GetAll();
            ViewBag.currentAgent          = agent;
            var complaints = _vComplaint.FilterComplaint(date, date, complaintType, complaintStatus, solnStatus, agent).Where(c => c.ComplaintStatus.ToUpper() != "CLOSED").ToList();

            return(View(complaints));
        }