Beispiel #1
0
        public IActionResult GetAllLogTotals(int days)
        {
            var currentUser      = GetCurrentUserProfile();
            var startdate        = DateTime.Now - TimeSpan.FromDays(days);
            var presentations    = _appointmentSessionRepo.GetPresentationsTotal(currentUser.Id, startdate);
            var appointmentsKept = _appointmentSessionRepo.GetAppointmentKeptTotal(currentUser.Id, startdate);
            var calls            = _callSessionRepo.GetCallsTotal(currentUser.Id, startdate);
            var callGoal         = _callSessionRepo.GetCallGoalsTotal(currentUser.Id, startdate);
            var contacts         = _callSessionRepo.GetContactsTotal(currentUser.Id, startdate);
            var appointments     = _callSessionRepo.GetAppointmentBookedTotal(currentUser.Id, startdate);
            var closes           = _saleRepo.GetClosesTotal(currentUser.Id, startdate);
            var commission       = _saleRepo.GetCommissionTotal(currentUser.Id, startdate);

            var logTotals = new LogTotalsViewModel()
            {
                Commission       = commission,
                Calls            = calls,
                Appointments     = appointments,
                AppointmentsKept = appointmentsKept,
                Presentations    = presentations,
                Contacts         = contacts,
                Closes           = closes,
                CallGoals        = callGoal
            };

            return(Ok(logTotals));
        }
        public IActionResult GetPresentationRatio(int days)
        {
            var currentUser            = GetCurrentUserProfile();
            var startdate              = DateTime.Now - TimeSpan.FromDays(days);
            var appointmentsKept       = _appointmentSessionRepo.GetAppointmentKeptTotal(currentUser.Id, startdate);
            var presentations          = _appointmentSessionRepo.GetPresentationsTotal(currentUser.Id, startdate);
            var presentationsRatioView = new PresentationsRatioViewModel()
            {
                AppointmentsKept = appointmentsKept,
                Presentations    = presentations
            };

            return(Ok(presentationsRatioView));
        }