/// <summary> /// 界面显示初始化 /// </summary> private void InitializeDataSet() { this.dataGridView1.AutoGenerateColumns = true; this.dataGridView2.AutoGenerateColumns = true; this.dataGridView3.AutoGenerateColumns = true; this.dataGridView4.AutoGenerateColumns = true; this.dataGridView5.AutoGenerateColumns = true; this.dataGridView6.AutoGenerateColumns = true; this.dataGridView7.AutoGenerateColumns = true; SPds = SupplierAccess.Select(); DTds = DistributorAccess.Select(); ACds = AdminAccess.ShowSupperUser(); RLds = RoleAccess.ShowRole(); ASds = ApplySceneryAccess.selectForApply(); RPds = RoleProductAccess.ShowRoleProduct(); SYds = SceneryAccess.ShowSceneryForSupper(); if (SPds != null) { dataGridView1.DataSource = SPds.Tables[0]; } if (DTds != null) { dataGridView2.DataSource = DTds.Tables[0]; } if (RLds != null) { dataGridView3.DataSource = RLds.Tables[0]; } if (ACds != null) { dataGridView4.DataSource = ACds.Tables[0]; } if (RPds != null) { dataGridView5.DataSource = RPds.Tables[0]; } if (ASds != null) { dataGridView6.DataSource = ASds.Tables[0]; } if (SYds != null) { dataGridView7.DataSource = SYds.Tables[0]; } }
private void lbDeleteAdmin_Click(object sender, EventArgs e) { if (indexer != -1) { DialogResult dr = MessageBox.Show("确定删除?", "确定", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { dataGridView4.DataSource = ACds.Tables[0]; bool isSuccess = AdminAccess.DeleteSupperUser(SPId); if (isSuccess) { MessageBox.Show("管理员删除成功"); } DataSet ds = AdminAccess.ShowSupperUser(); dataGridView3.DataSource = ds.Tables[0]; if (ds != null) { this.Refresh(); } this.Refresh(); } } }