public List <CategoryViewModel> DebugResults(List <CategoryViewModel> jCategory) { Calculate Calculate = new Calculate(); Calculate.CalculateAction(jCategory); return(jCategory); }
public List <OutputListGroup> OutputResults(List <CategoryViewModel> jCategory) { Calculate Calculate = new Calculate(); Calculate.CalculateAction(jCategory); var OutputListGroupOrdered = Calculate.OutputList.GroupBy(employees => employees.Group); List <OutputListGroup> List = new List <OutputListGroup>(); var i = 0; foreach (var group in OutputListGroupOrdered) { List <OutputList> SubList = new List <OutputList>(); foreach (var list in group) { SubList.Add(new OutputList { ID = list.ID, Group = list.Group, Field = list.Field, Value = list.Value, SubOutput = list.SubOutput }); //int index = SubList.FindIndex(a => a.Field == list.Field); //if (index == -1) //{ // SubList.Add(new OutputList { ID = list.ID, Group = list.Group, Field = list.Field, Value = list.Value }); //} //else //{ // SubList.RemoveAt(index); // SubList.Add(new OutputList { ID = list.ID, Group = list.Group, Field = list.Field, Value = list.Value }); //} } List.Add(new OutputListGroup { ID = i, Group = group.Key, Output = SubList }); i = i + 1; } return(List); }
public List<OutputListGroup> OutputResults(List<CategoryViewModel> jCategory) { Calculate Calculate = new Calculate(); Calculate.CalculateAction(jCategory); var OutputListGroupOrdered = Calculate.OutputList.GroupBy(employees => employees.Group); List<OutputListGroup> List = new List<OutputListGroup>(); var i = 0; foreach (var group in OutputListGroupOrdered) { List<OutputList> SubList = new List<OutputList>(); foreach (var list in group) { SubList.Add(new OutputList { ID = list.ID, Group = list.Group, Field = list.Field, Value = list.Value }); //int index = SubList.FindIndex(a => a.Field == list.Field); //if (index == -1) //{ // SubList.Add(new OutputList { ID = list.ID, Group = list.Group, Field = list.Field, Value = list.Value }); //} //else //{ // SubList.RemoveAt(index); // SubList.Add(new OutputList { ID = list.ID, Group = list.Group, Field = list.Field, Value = list.Value }); //} } List.Add(new OutputListGroup { ID = i, Group = group.Key, Output = SubList}); i = i + 1; } return List; }
public List<CategoryViewModel> DebugResults(List<CategoryViewModel> jCategory) { Calculate Calculate = new Calculate(); Calculate.CalculateAction(jCategory); return jCategory; }