Beispiel #1
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList(ProductPreSaleQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();

            if (query != null)
            {
                PageModel <ProductPreSaleInfo> preSaleList = ProductPreSaleHelper.GetPreSaleList(query);
                dataGridViewModel.rows  = new List <Dictionary <string, object> >();
                dataGridViewModel.total = preSaleList.Total;
                foreach (ProductPreSaleInfo model in preSaleList.Models)
                {
                    Dictionary <string, object> dictionary = model.ToDictionary();
                    dictionary.Add("IsPreSaleEnd", !this.IsPreSaleEnd(model.PreSaleEndDate));
                    dictionary.Add("IsPreSaleHasOrder", ProductPreSaleHelper.IsPreSaleHasOrder(model.PreSaleId));
                    dataGridViewModel.rows.Add(dictionary);
                }
            }
            return(dataGridViewModel);
        }