private void SummaryForm_Load(object sender, EventArgs e) { dgvSelectgroup.DataSource = groupBLL.FindAllInfo(); dgvSummary.DataSource = manageCarRequiredmentBLL.FindAllInfo(); this.dgvSummary.Columns[0].Frozen = true; this.WindowState = FormWindowState.Maximized; }
private void CarRequirementMamage_Load(object sender, EventArgs e) { dgvGroupList1.DataSource = groupBLL.FindAllInfo(); dgvWriteDriverList.DataSource = driverWriteListBLL.FindAllInfo(); dgvCarList.DataSource = calBll.FindAllInfo(); dgvManagedInfo.DataSource = manageCarRequiredmentBLL.FindAllInfo(); }
private void btnSaveGroup_Click(object sender, EventArgs e) { Group group = new Group(); if (txtGroupName.Text == "") { MessageBox.Show("分组名称不能为空"); return; } group.GroupName = txtGroupName.Text; try { groupBLL.InsertObject(group); dgvGroupList.DataSource = groupBLL.FindAllInfo(); MessageBox.Show("保存成功"); } catch (Exception ex) { MessageBox.Show("保存数据错误" + ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { group.GroupName = txtGroupName.Text; try { groupBll.UpdateByGroup(group); MessageBox.Show("修改成功"); DataGridView dgv = (DataGridView)(form.Controls["panel1"].Controls["groupBox5"].Controls["dgvGroupList"]); dgv.DataSource = groupBll.FindAllInfo(); this.Close(); } catch (Exception ex) { MessageBox.Show("修改分组名称错误:" + ex.Message); } }