private DataGridViewModel <Dictionary <string, object> > GetBalanceDetails(BalanceDetailSupplierQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();
            string empty = string.Empty;

            if (query != null)
            {
                DbQueryResult balanceDetails             = BalanceHelper.GetBalanceDetails(query);
                List <Dictionary <string, object> > list = DataHelper.DataTableToDictionary(balanceDetails.Data);
                foreach (Dictionary <string, object> item in list)
                {
                    SupplierBalanceDetailInfo supplierBalanceDetailInfo = item.ToObject <SupplierBalanceDetailInfo>();
                    if (supplierBalanceDetailInfo.TradeType == SupplierTradeTypes.DrawRequest)
                    {
                        item.Add("TradeTypeStr", "提现");
                    }
                    else
                    {
                        item.Add("TradeTypeStr", "商品交易");
                    }
                    if (string.IsNullOrEmpty(supplierBalanceDetailInfo.OrderId))
                    {
                        item.Add("OrderIdStr", "--");
                    }
                    else
                    {
                        item.Add("OrderIdStr", supplierBalanceDetailInfo.OrderId);
                    }
                    if (supplierBalanceDetailInfo.Income == decimal.Zero)
                    {
                        item.Add("IncomeStr", "--");
                    }
                    else
                    {
                        item.Add("IncomeStr", supplierBalanceDetailInfo.Income.F2ToString("f2"));
                    }
                    if (supplierBalanceDetailInfo.Expenses == decimal.Zero)
                    {
                        item.Add("ExpensesStr", "--");
                    }
                    else
                    {
                        item.Add("ExpensesStr", supplierBalanceDetailInfo.Expenses.F2ToString("f2"));
                    }
                }
                dataGridViewModel.rows  = list;
                dataGridViewModel.total = balanceDetails.TotalRecords;
            }
            return(dataGridViewModel);
        }
        private DataGridViewModel <Dictionary <string, object> > GetDataList(BalanceDetailSupplierQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();

            if (query != null)
            {
                DbQueryResult balanceDetails = BalanceHelper.GetBalanceDetails(query);
                dataGridViewModel.rows  = new List <Dictionary <string, object> >();
                dataGridViewModel.total = balanceDetails.TotalRecords;
                foreach (DataRow row in balanceDetails.Data.Rows)
                {
                    Dictionary <string, object> item = DataHelper.DataRowToDictionary(row);
                    dataGridViewModel.rows.Add(item);
                }
            }
            return(dataGridViewModel);
        }