private void OnWFRequestResources(object sender, EventArgs e) { List<LabourOffFarmFilterGroup> taskList = this.Children.Where(a => a.GetType() == typeof(LabourOffFarmFilterGroup)).Cast<LabourOffFarmFilterGroup>().ToList(); if (taskList.Count > 0) { int month = Clock.Today.Month - 1; foreach (var item in taskList) { // get family types based on filter // request labour for x individuals // request labour LabourRequest request = new LabourRequest(); request.Activity = this; request.Amount = item.DailyRate * item.DaysWorkAvailableEachMonth[month]; request.Requestor = item; // labour.Remove(request); } } }
private void OnWFRequestResources(object sender, EventArgs e) { List <LabourOffFarmFilterGroup> taskList = this.Children.Where(a => a.GetType() == typeof(LabourOffFarmFilterGroup)).Cast <LabourOffFarmFilterGroup>().ToList(); if (taskList.Count > 0) { int month = Clock.Today.Month - 1; foreach (var item in taskList) { // get family types based on filter // request labour for x individuals // request labour LabourRequest request = new LabourRequest(); request.Activity = this; request.Amount = item.DailyRate * item.DaysWorkAvailableEachMonth[month]; request.Requestor = item; // labour.Remove(request); } } }