private Goals.NewGoal RecommendedGoal(ClientsData.NewClientData client) { Goals.NewGoal x = new Goals.NewGoal(); Goals g = new Goals(); List <Goals.NewGoal> goals = g.GetGoals(); double bmi = Bmi(client).value; if (bmi < 18.5) { x.code = "G3"; } if (bmi >= 18.5 && bmi <= 25) { x.code = "G2"; } if (bmi > 25 && bmi < 30) { x.code = "G1"; } if (bmi >= 30) { x.code = "G1"; } x.title = goals.First(a => a.code == x.code).title; x.isDisabled = false; return(x); }
private Goals.NewGoal RecommendedGoal(ClientsData.NewClientData client) { Goals.NewGoal x = new Goals.NewGoal(); Goals g = new Goals(); List <Goals.NewGoal> goals = g.GetGoals(); double bmi = Bmi(client).value; if (client.bmiPercentile == null) { client.bmiPercentile = new BmiPercentile(); } if (client.bmiPercentile.Agemos > 0) { if (bmi < client.bmiPercentile.P5) { x.code = "G3"; } if (bmi >= client.bmiPercentile.P5 && bmi <= client.bmiPercentile.P85) { x.code = "G2"; } if (bmi >= client.bmiPercentile.P85) { x.code = "G1"; } } else { if (bmi < 18.5) { x.code = "G3"; } if (bmi >= 18.5 && bmi <= 25) { x.code = "G2"; } if (bmi > 25 && bmi < 30) { x.code = "G1"; } if (bmi >= 30) { x.code = "G1"; } } x.title = goals.First(a => a.code == x.code).title; x.isDisabled = false; return(x); }
void Start() { SetupUI(goals.GetGoals()); }