Exemplo n.º 1
0
        public List <CategoryViewModel> DebugResults(List <CategoryViewModel> jCategory)
        {
            Calculate Calculate = new Calculate();

            Calculate.CalculateAction(jCategory);
            return(jCategory);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 public List<CategoryViewModel> DebugResults(List<CategoryViewModel> jCategory)
 {
     Calculate Calculate = new Calculate();
     Calculate.CalculateAction(jCategory);
     return jCategory;
 }