Exemplo n.º 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));
        }
Exemplo n.º 2
0
        public IActionResult GetContactRatio(int days)
        {
            var currentUser          = GetCurrentUserProfile();
            var startdate            = DateTime.Now - TimeSpan.FromDays(days);
            var contacts             = _callSessionRepo.GetContactsTotal(currentUser.Id, startdate);
            var appointmentsBooked   = _callSessionRepo.GetAppointmentBookedTotal(currentUser.Id, startdate);
            var appointmentRatioView = new ContactRatioViewModel()
            {
                Contacts           = contacts,
                AppointmentsBooked = appointmentsBooked
            };


            return(Ok(appointmentRatioView));
        }