public List <InterventionViewByUser> GetListWithValue(List <InterventionViewByUser> anInterventionViewByUserList) { List <Client> aClientList = aClientManager.GetClientListByDistrict(districtID); foreach (Client aClient in aClientList) { List <Intervention> anInterventionList = anInterventionManager.GetInterventionListByClient(aClient.ClientID); foreach (Intervention anIntervention in anInterventionList) { InterventionViewByUser anInterventionViewByUser = new InterventionViewByUser(); anInterventionViewByUser.InterventionStatus = anIntervention.InterventionState; anInterventionViewByUser.InterventionID = anIntervention.InterventionID; anInterventionViewByUser.InterventionTypeID = anIntervention.InterventionTypeID; anInterventionViewByUser.InterventionType = anInterventionTypeManager.GetInterventionNameByTypeId(anIntervention.InterventionTypeID); anInterventionViewByUser.InterventionDate = anIntervention.InterventionDate; anInterventionViewByUser.ClientID = aClient.ClientID; anInterventionViewByUser.ClientName = aClientManager.GetClientNameByClientID(aClient.ClientID); anInterventionViewByUser.CostRequired = anIntervention.CostRequired; anInterventionViewByUser.LabourRequired = anIntervention.LabourRequired; if (anInterventionManager.IsEligibleForProposedList(anInterventionViewByUser.InterventionStatus, anIntervention.CostRequired, anIntervention.LabourRequired, anUserManager.GetMaxCostByUserID(userID), anUserManager.GetMaxHourByUserID(userID))) { anInterventionViewByUserList.Add(anInterventionViewByUser); } } } return(anInterventionViewByUserList); }
public List <InterventionViewByUser> GetListWithValue(List <InterventionViewByUser> anInterventionViewByUserList) { List <Intervention> anInterventionList = anInterventionManager.GetInterventionListByApprovalUserID(userID); foreach (Intervention anIntervention in anInterventionList) { InterventionViewByUser anInterventionViewByUser = new InterventionViewByUser(); anInterventionViewByUser.InterventionStatus = anIntervention.InterventionState; anInterventionViewByUser.InterventionID = anIntervention.InterventionID; anInterventionViewByUser.InterventionTypeID = anIntervention.InterventionTypeID; anInterventionViewByUser.InterventionType = anInterventionTypeManager.GetInterventionNameByTypeId(anIntervention.InterventionTypeID); anInterventionViewByUser.InterventionDate = anIntervention.InterventionDate; anInterventionViewByUser.ClientID = anIntervention.ClientID; anInterventionViewByUser.ClientName = aClientManager.GetClientNameByClientID(anIntervention.ClientID); anInterventionViewByUser.CostRequired = anIntervention.CostRequired; anInterventionViewByUser.LabourRequired = anIntervention.LabourRequired; anInterventionViewByUserList.Add(anInterventionViewByUser); } return(anInterventionViewByUserList); }
public List <InterventionViewByUser> PopulateViewList(List <Intervention> anInterventionList) { // get intervention for each client -> foreach loop for client // Populate intervention list List <InterventionViewByUser> anInterventionViewByUserList = new List <InterventionViewByUser>(); foreach (Intervention anIntervention in anInterventionList) { InterventionViewByUser anInterventionViewByUser = new InterventionViewByUser(); anInterventionViewByUser.InterventionID = anIntervention.InterventionID; anInterventionViewByUser.InterventionTypeID = anIntervention.InterventionTypeID; anInterventionViewByUser.InterventionType = anInterventionTypeManager.GetInterventionNameByTypeId(anIntervention.InterventionTypeID); anInterventionViewByUser.InterventionDate = anIntervention.InterventionDate; anInterventionViewByUser.ClientID = anIntervention.ClientID; anInterventionViewByUser.ClientName = aClientManager.GetClientNameByClientID(anIntervention.ClientID); anInterventionViewByUser.InterventionStatus = anIntervention.InterventionState; anInterventionViewByUserList.Add(anInterventionViewByUser); } return(anInterventionViewByUserList); }