public static double ReturnResultStatsColumn(string columnname, OperationOnTable operation, DataTable data)
        {
            double result = 0;

            switch (operation)
            {
            case OperationOnTable.SUM:
                result = ReturnListNumber(data, columnname).Sum();
                break;

            case OperationOnTable.AVG:
                result = ReturnListNumber(data, columnname).Average();
                break;

            default:
                break;
            }
            return(result);
        }
예제 #2
0
        public Tuple <double?, List <GroupByList> > GetStats(string filename, string columname, string groupname, OperationOnTable operation)
        {
            ErroMessage = string.Empty;
            SummaryDataRequest request = new SummaryDataRequest()
            {
                FileName        = filename,
                ColumnName      = columname,
                GroupColumnName = groupname,
                Operation       = operation
            };

            try
            {
                var result = proxy.GetSummary(request);
                return(new Tuple <double?, List <GroupByList> >(result.Value, result.ListValue.ToList()));
            }
            catch (Exception e)
            {
                ErroMessage = e.Message;
                return(null);
            }
        }