/// <summary> /// /// </summary> public ComplaintFormPage() { InitializeComponent(); controller = new ComplaintsController(this); controller.CheckLocationEnabledAsync(); this.BackgroundColor = new Color(0, 0, 0, 0.4); }
void GetGlobalComplaintScore() { ComplaintsController controller = new ComplaintsController(); int totalComplaints = 0; int totalLungs = 0; int totalEyes = 0; int totalNose = 0; int totalAverage = 0; try { foreach (Complaint complaint in controller.GetComplaints()) { string format = "dd-MM-yyyy"; var todayDate = DateTime.Now.ToString(format); var complaintDate = complaint.date.ToString(format); if (complaintDate == todayDate) { totalNose += complaint.nose; totalEyes += complaint.eyes; totalLungs += complaint.lungs; totalComplaints++; } } int averageLungs = (totalLungs / totalComplaints); int averageEyes = (totalEyes / totalComplaints); int averageNose = (totalNose / totalComplaints); totalAverage = (averageEyes + averageLungs + averageNose) / 3; } catch (Exception ex) { Debug.WriteLine("FFF " + ex); } globalComplaintScore.Text = totalAverage.ToString(); }
public ComplaintsControllerTests() { _controller = new ComplaintsController(_mockService.Object); }