我从Personel[]
生成了Biz.Bal.GetPersonelById("1")
类型数组,但如果我想添加winforms,我会像下面那样做。有更简单的方法吗?喜欢GridView.dataSource=myArray
?
private void Form1_Load(object sender, EventArgs e)
{
Form_init();
Model.Personel[] list = new Model.Personel[0];
list = Biz.BAL.GetPersonelByID("1");
dataGridView1.Rows[0].Cells[0].Value = list[0].ID;
dataGridView1.Rows[0].Cells[1].Value = list[0].Ad;
dataGridView1.Rows[0].Cells[2].Value = list[0].SoyAd;
dataGridView1.Rows[0].Cells[3].Value = list[0].Maas;
dataGridView1.Rows[0].Cells[4].Value = list[0].Departman;
}