private void btnLuu_Click(object sender, EventArgs e) { RoleBUS role = new RoleBUS(); RoleNV roleID = role.getRoleID(cbbVaiTro.Text); // MessageBox.Show(roleID); nvBUS nvBus = new nvBUS(); NhanVien nv = new NhanVien(roleID.RoleId, txtMaNV.Text, txtUser.Text, txtPass.Text, txtTenNV.Text, txtCMND.Text, txtNgaySinh.Text, txtDiaChi.Text, txtEmail.Text, txtCaLamViec.Text); if (check == true) { if (nvBus.CheckUsername(txtUser.Text)) { MessageBox.Show(txtUser.Text + " đã tồn tại!!!"); } else { nvBus.addData(nv); disnable(); clear(); check = false; } } else { nvBus.edit(nv); disnable(); clear(); check = false; } grvNV.DataSource = nvBus.getData(); }
public IActionResult GetRolesByUserId(Account account) { RoleBUS roleBUS = new RoleBUS(); var result = roleBUS.GetRolesByUserId(account); return(Ok(result)); }
public IActionResult GetPaging(BaseCondition <Role> condition) { RoleBUS roleBUS = new RoleBUS(); var result = roleBUS.GetPaging(condition); return(Ok(result)); }
public IActionResult UpdateRole(Role role) { RoleBUS roleBUS = new RoleBUS(); var result = roleBUS.EditRole(role); return(Ok(result)); }
public IActionResult UserGroupGetSearchWithPaging([FromBody] BaseCondition <Role> condition) { RoleBUS roleBUS = new RoleBUS(); ReturnResult <Role> result = roleBUS.UserGroupGetSearchWithPaging(condition); return(Ok(result)); }
private void btnLuu_Click(object sender, EventArgs e) { RoleBUS role = new RoleBUS(); string roleID = role.getRoleID(cbbVaiTro.Text); // MessageBox.Show(roleID); nvBUS nvBus = new nvBUS(); NhanVien nv = new NhanVien(); nv.roleID = roleID; nv.idNV = txtMaNV.Text; nv.username = txtUser.Text; nv.password = txtPass.Text; nv.tenNV = txtTenNV.Text; nv.cmnd = txtCMND.Text; nv.ngaysinh = txtNgaySinh.Text; nv.diachi = txtDiaChi.Text; nv.email = txtEmail.Text; nv.calamviec = txtCaLamViec.Text; if (check == true) { nvBus.addData(nv); disnable(); clear(); check = false; } else { nvBus.edit(nv); disnable(); clear(); check = false; } grvNV.DataSource = nvBus.getData(); }
public frmRoleNV() { InitializeComponent(); RoleBUS role = new RoleBUS(); grvRole.DataSource = role.getData(); grvRole.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; }
private void btnSua_Click(object sender, EventArgs e) { enable(); RoleBUS role = new RoleBUS(); cbbVaiTro.DataSource = role.Getlist(); cbbVaiTro.DisplayMember = "roleName"; }
private void btnTim_Click(object sender, EventArgs e) { RoleBUS roleBus = new RoleBUS(); RoleNV roleNV = roleBus.getRole(txtRoleID.Text); txtRoleID.Text = roleNV.RoleId; txtTenRole.Text = roleNV.RoleName; txtMoTa.Text = roleNV.Description; }
private void btnThem_Click(object sender, EventArgs e) { enable(); clear(); RoleBUS role = new RoleBUS(); cbbVaiTro.DataSource = role.Getlist(); cbbVaiTro.DisplayMember = "roleName"; check = true; btnLuu.Enabled = true; }
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(); } }
public IActionResult GetAllRole() { try { RoleBUS roleBUS = new RoleBUS(); var result = roleBUS.GetAllRole(); return(Ok(result)); } catch (Exception ex) { throw; } }
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(); } }
private void btnTim_Click(object sender, EventArgs e) { RoleBUS roleBus = new RoleBUS(); RoleNV roleNV = roleBus.getRole(txtRoleID.Text); if (roleNV == null) { MessageBox.Show(txtRoleID.Text + " không tồn tại!!!"); } else { txtRoleID.Text = roleNV.RoleId; txtTenRole.Text = roleNV.RoleName; txtMoTa.Text = roleNV.Description; } }
public IActionResult GetRoleByID(int id) { RoleBUS roleBUS = new RoleBUS(); return(Ok(roleBUS.GetRoleByID(id))); }
public IActionResult DeleteRole([FromQuery] int id) { RoleBUS roleBUS = new RoleBUS(); return(Ok(roleBUS.DeleteRole(id))); }
public IActionResult GetRoleByUserName(string id) { RoleBUS roleBUS = new RoleBUS(); return(Ok(roleBUS.GetRoleByUserName(id))); }