Ejemplo n.º 1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            CallLogs calllog = new CallLogs();

            calllog.InsertBLCall(customerName, customerSurname, callDuration);

            callTimer.Stop();


            this.Close();
        }
        public async Task OnItemAppearingAsync(FifteenCallModel callModel)
        {
            var itemIsLastVisible = callModel == CallLogs.Last();

            if (itemIsLastVisible)
            {
                // oldest calls are in the bottom - load more oldest calls
                var paginationInitialDate = callModel.CreatedDate;
                await LoadData(paginationInitialDate, _minDay, _maxDay, _userType);
            }
        }
        private void GetAdminWeeklySummary(DateTime selectedStart, DateTime endDate)
        {
            AdminWeeklySummary summary = CallLogs.GetAdminWeeklySummary(selectedStart, endDate);

            ViewBag.TotalMinutes = summary.TotalHours ?? 0;
            ViewBag.TotalCalls   = summary.TotalCalls;

            IList <EvalEndCounts> endEvals = CallLogs.GetEvalEndCounts(selectedStart, endDate).ToList();

            int totalEndEvals       = endEvals.Count();
            int completedAssignment = (from e2 in endEvals where e2.EvalEndID == 2 select e2.CallCount).FirstOrDefault();
            int masteredMaterial    = (from e2 in endEvals where e2.EvalEndID == 3 select e2.CallCount).FirstOrDefault();

            if (totalEndEvals > 0)
            {
                ViewBag.CompletedAssignment = Math.Round(((Convert.ToDecimal(completedAssignment) / Convert.ToDecimal(summary.TotalCalls)) * 100), 1);
                ViewBag.MasteredMaterial    = Math.Round(((Convert.ToDecimal(masteredMaterial) / Convert.ToDecimal(summary.TotalCalls)) * 100), 1);
                var test = (completedAssignment / summary.TotalCalls) * 100;
            }
            else
            {
                ViewBag.CompletedAssignment = 0;
                ViewBag.MasteredMaterial    = 0;
            }

            string weekdayTotalCalls = "";
            string weekdayTotalTime  = "";

            DateTime reference = selectedStart;

            int                totalDailyCalls;
            decimal            totalDailyTime;
            AdminWeeklySummary callLogSummary;

            for (int i = 0; i < 28; i++)
            {
                if (reference.DayOfWeek != DayOfWeek.Saturday && reference.DayOfWeek != DayOfWeek.Sunday)
                {
                    callLogSummary     = CallLogs.GetAdminWeeklySummary(reference, reference.AddDays(1));
                    totalDailyCalls    = callLogSummary.TotalCalls;
                    totalDailyTime     = (callLogSummary.TotalHours == null) ? 0 : (decimal)callLogSummary.TotalHours;
                    weekdayTotalCalls += ",['" + reference.ToString("MM/dd") + "'," + totalDailyCalls + "]";
                    weekdayTotalTime  += ",['" + reference.ToString("MM/dd") + "'," + totalDailyTime + "]";
                }
                reference = reference.AddDays(1);
            }
            ViewBag.DailyTotalCalls = new HtmlString(weekdayTotalCalls);
            ViewBag.DailyTotalHours = new HtmlString(weekdayTotalTime);
        }
        private void GetNumberOfCallsPerSubject(DateTime selectedStart, DateTime endDate)
        {
            var CallsPerSubject = CallLogs.GetNumberOfCallsPerSubject(selectedStart, endDate);

            string Subject = "";

            foreach (var call in CallsPerSubject)
            {
                {
                    var Call        = call.CallCount;
                    var Subjectname = call.SubjectTypeName;
                    Subject += ",['" + Subjectname + "'," + Call + "]";
                }
            }
            ViewBag.CallPerSubject = new HtmlString(Subject);
        }
        private void GetFeaturesUsed(DateTime selectedStart, DateTime endDate)
        {
            var FeaturesUsed = CallLogs.GetFeaturesUsed(selectedStart, endDate);

            string Features = "";

            foreach (var call in FeaturesUsed)
            {
                {
                    var features  = call.Features;
                    var numResult = call.NumResult;
                    Features += ",['" + features + "'," + numResult + "]";
                }
            }
            ViewBag.FeaturesUsed = new HtmlString(Features);
        }
Ejemplo n.º 6
0
        public void RefreshPage()
        {
            List <Client> getClientDate = new List <Client>();
            BindingSource bs            = new BindingSource();

            getClientDate           = new Client().GetCustomer();
            bs.DataSource           = getClientDate;
            dgvCustomers.DataSource = bs;

            dgvCustomers.AutoResizeColumns();

            List <CallLogs> getCallData = new List <CallLogs>();

            getCallData = new CallLogs().getBLCall();

            dgvCall.DataSource = getCallData;
        }
        private void GetCountyCountCalls(DateTime selectedStart, DateTime endDate)
        {
            var CountyCount = CallLogs.GetCountyCount(selectedStart, endDate);

            string CountyCall = "";

            foreach (var call in CountyCount)
            {
                {
                    var callCount  = call.CallCount;
                    var countyName = call.CountyName;
                    if (callCount > 5)
                    {
                        CountyCall += ",['" + countyName.Replace("County", "") + "'," + callCount + "]";
                    }
                }
            }
            ViewBag.CountyCall = new HtmlString(CountyCall);
        }
        public ActionResult AdminDashboard(DateTime?startDate = null)
        {
            // TODO: get dates from date/time pickers
            DateTime varForStartAndEndDate = startDate ?? DateTime.Today;
            DateTime endDate       = varForStartAndEndDate;
            DateTime selectedStart = varForStartAndEndDate.AddDays(-30);

            GetAllStudents(selectedStart, endDate);
            GetBeatMathCalls(selectedStart, endDate);
            GetCallsInForeignLanguage(selectedStart, endDate);
            GetCountyCountCalls(selectedStart, endDate);
            GetFeaturesUsed(selectedStart, endDate);
            GetNumberOfCallsPerSubject(selectedStart, endDate);
            GetAdminWeeklySummary(selectedStart, endDate);
            AdminWeeklySummary summary = CallLogs.GetAdminWeeklySummary(selectedStart, endDate);
            var sessions = CallLogs.GetSessionsByGrade(selectedStart, endDate).ToList();
            var k        = sessions.Single(s => s.Grade.ToLower() == "k");

            sessions.Remove(k);
            sessions = sessions.OrderBy(s => int.Parse(s.Grade)).ToList();
            sessions.Insert(0, k);
            return(View(sessions));
        }
        public async Task LoadData(String fromDate, String minDay, String maxDay, UserTypes userType)
        {
            IsLoading = true;

            _minDay   = minDay;
            _maxDay   = maxDay;
            _userType = userType;

            var fifteenCallsRequestModel = new FifteenCallsRequestModel();

            fifteenCallsRequestModel.FromDate = fromDate;
            fifteenCallsRequestModel.MinDay   = minDay;
            fifteenCallsRequestModel.MaxDay   = maxDay;
            FetchFifteenCallsRespnse    response   = null;
            FetchFifteenCallsABResponse ABresponse = null;

            switch (userType)
            {
            case UserTypes.Interpreter:
                InterpreterService interpreterService = new InterpreterService();
                response = await interpreterService.FetchFifteenCalls(fifteenCallsRequestModel);

                break;

            case UserTypes.Client:
                ClientService clientService = new ClientService();
                response = await clientService.FetchFifteenCalls(fifteenCallsRequestModel);

                break;

            case UserTypes.Business:
                BusinessService businessService = new BusinessService();
                if (Business != null)
                {
                    fifteenCallsRequestModel.ClientBusinessId = int.Parse(Business.ClientBusinessId);
                    ABresponse = await businessService.FetchFifteenCalls(fifteenCallsRequestModel);
                }
                break;

            case UserTypes.Agency:
                AgencyService agencyService = new AgencyService();
                if (Agency != null)
                {
                    fifteenCallsRequestModel.AgencyId = int.Parse(Agency.InterpreterBusinessId);
                    ABresponse = await agencyService.FetchFifteenCalls(fifteenCallsRequestModel);
                }
                break;
            }
            if (response != null)
            {
                foreach (var call in response.Calls)
                {
                    CallLogs.Add(call);
                }
            }

            if (ABresponse != null && ABresponse.Call != null)
            {
                foreach (var call in ABresponse.Call.Calls)
                {
                    CallLogs.Add(call);
                }
            }
            IsLoading = false;
        }
        private void GetCallsInForeignLanguage(DateTime selectedStart, DateTime endDate)
        {
            var CallsInForeignLanguage = CallLogs.GetCallsInForeignLanguage(selectedStart, endDate);

            ViewBag.ForeignLanguage = CallsInForeignLanguage.NumForeignLanguageSpoken;
        }
        private void GetBeatMathCalls(DateTime selectedStart, DateTime endDate)
        {
            var BeatMath = CallLogs.GetBeatMath(selectedStart, endDate);

            ViewBag.BeatMath = BeatMath.NumBeatMathSessions;
        }
        private void GetAllStudents(DateTime selectedStart, DateTime endDate)
        {
            var AllStudentsdeName = CallLogs.GetAllStudents(selectedStart, endDate);

            ViewBag.AllStudentsdeName = AllStudentsdeName.NumOFStudents;
        }