/// <summary> /// 景点删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lbDelete_Click(object sender, EventArgs e) { if (indexer != -1) { DialogResult dr = MessageBox.Show("确定删除景点ID为" + SYId + "景点吗?", "确定", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { dataGridView1.DataSource = SYds.Tables[0]; bool isSuccess = SceneryAccess.DeleteScenery(SYId); if (isSuccess) { MessageBox.Show("景点删除成功"); } DataSet ds = SceneryAccess.ShowScenery(); dataGridView1.DataSource = ds.Tables[0]; if (ds != null) { this.Refresh(); } } } else { MessageBox.Show("请选择要删除的景点...."); } }
private void InitializeData() { this.dataGridView1.AutoGenerateColumns = true; DTds = SceneryAccess.selectForDistributor(DTId); if (DTds != null) { dataGridView1.DataSource = DTds.Tables[0]; } this.dataGridView2.AutoGenerateColumns = true; OAds = OrderAccess.ShowOrderForDistributor(DTId); if (OAds != null) { this.dataGridView2.DataSource = OAds.Tables[0]; } this.dataGridView3.AutoGenerateColumns = true; SYds = SceneryAccess.ShowScenery(); if (SYds != null) { this.dataGridView3.DataSource = SYds.Tables[0]; } this.dataGridView4.AutoGenerateColumns = true; ASds1 = ApplySceneryAccess.selectForApply(DTId); if (ASds1 != null) { this.dataGridView4.DataSource = ASds1.Tables[0]; } }
public SupplierUser() { InitializeComponent(); this.dataGridView1.AutoGenerateColumns = true; SYds = SceneryAccess.ShowScenery(); if (SYds != null) { this.dataGridView1.DataSource = SYds.Tables[0]; } }