private void btnTinhLuong_Click(object sender, EventArgs e) { NhanVien nhanVien; string msnv = this.txtBoxMSNV.Text; string hoTen = this.txtBoxHoTenNV.Text; bool isNhanVienKinhDoanh = this.rdBtnNVKD.Checked; if (isNhanVienKinhDoanh) { int luongCoBan = int.Parse(this.txtBoxLCB.Text); int soLuongHopDong = int.Parse(this.txtBoxSLHD.Text); nhanVien = new NhanVienKinhDoanh(msnv, hoTen, luongCoBan, soLuongHopDong); } else { int soLuongSanPham = int.Parse(this.txtBoxSLSP.Text); nhanVien = new NhanVienSanXuat(msnv, hoTen, soLuongSanPham); } this.lblLuongNhanVien.Text = nhanVien.TinhLuong().ToString(); }
private void btnTinhLuong_Click(object sender, EventArgs e) { NhanVien nv; string maNV = this.txtBoxMSNV.Text; string hoTen = this.txtBoxHoTenNV.Text; bool isNhanVienKinhDoanh = this.rdBtnNVKD.Checked; if (isNhanVienKinhDoanh) { int luongCB = int.Parse(this.txtBoxLCB.Text); int soLuongHD = int.Parse(this.txtBoxSLHD.Text); nv = new NhanVienKinhDoanh(maNV, hoTen, luongCB, soLuongHD); } else { int soLuongSP = int.Parse(this.txtBoxSLSP.Text); nv = new NhanVienSanXuat(maNV, hoTen, soLuongSP); } lblLuongNhanVien.Text = nv.TinhLuong().ToString(); }