public frmRoleNV() { InitializeComponent(); RoleBUS role = new RoleBUS(); grvRole.DataSource = role.getData(); grvRole.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; }
private void btnSua_Click(object sender, EventArgs e) { RoleBUS role = new RoleBUS(); RoleNV rolenv = new RoleNV(txtRoleID.Text, txtTenRole.Text, txtMoTa.Text); if (role.edit(rolenv) == 1) { MessageBox.Show("Sua thanh cong!"); grvRole.DataSource = role.getData(); } }
public frmRoleNV() { InitializeComponent(); RoleBUS role = new RoleBUS(); grvRole.DataSource = role.getData(); grvRole.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; if (txtTenRole.Text == "" && txtRoleID.Text == "") { btnDisable(); } }
private void btnThem_Click(object sender, EventArgs e) { RoleBUS role = new RoleBUS(); RoleNV rolenv = new RoleNV(txtRoleID.Text, txtTenRole.Text, txtMoTa.Text); if (role.CheckID(txtRoleID.Text) == true) { MessageBox.Show("Mã Role đã tồn tại!"); } else { role.addData(rolenv); grvRole.DataSource = role.getData(); } }