예제 #1
0
        private void InitControls()
        {
            this.dataGridView1.Rows.Clear();
            this.dataGridView1.Columns[0].Width = 250;
            this.dataGridView1.Columns[1].Width = 250;
            this.dataGridView1.Columns[2].Width = 80;
            var result = WebRequestUtil.GetCityExLogisticsAmountList();

            if (result != null)
            {
                var response = JsonUtil.Deserialize <QSWResponse <List <CityExLogisticsAmountModel> > >(result.Content);
                if (response != null)
                {
                    List <CityExLogisticsAmountModel> brandModelList = response.Data;
                    foreach (var brand in brandModelList)
                    {
                        int index = this.dataGridView1.Rows.Add();
                        this.dataGridView1.Rows[index].Cells[0].Value = this.GetCityName(brand.CityId);
                        this.dataGridView1.Rows[index].Cells[1].Value = this.GetExName(brand.ExId);
                        this.dataGridView1.Rows[index].Cells[2].Value = brand.Amount;
                        this.dataGridView1.Rows[index].Tag            = brand;
                    }
                }
            }
        }