private void button1_Click(object sender, EventArgs e) { int UID = Global.GlobalUserId; dataGridView1.ReadOnly = true; dataGridView1.RowTemplate.Height = 40; dataGridView1.DataSource = nhanvien.showCaLamViecItMeLaoCong(UID); dataGridView1.AllowUserToAddRows = false; }
private void LeTan_Load(object sender, EventArgs e) { int UID = Global.GlobalUserId; int ca; string ten; string Ho; SqlCommand command2 = new SqlCommand("Select Fname From TTNV WHERE IdNhanVien =" + UID); DataTable table2 = nhanvien.getLaoCong(command2); ten = (string)table2.Rows[0]["Fname"]; SqlCommand command3 = new SqlCommand("Select Lname From TTNV WHERE IdNhanVien =" + UID); DataTable table3 = nhanvien.getLaoCong(command3); Ho = (string)table3.Rows[0]["Lname"]; SqlCommand command1 = new SqlCommand("Select CaLamViec From TTNV WHERE IdNhanVien =" + UID); DataTable table1 = nhanvien.getLaoCong(command1); ca = (int)table1.Rows[0]["CaLamViec"]; dataGridView2.ReadOnly = true; dataGridView2.RowTemplate.Height = 40; dataGridView2.DataSource = nhanvien.showCaLamViecItMeLaoCong(ca); dataGridView2.AllowUserToAddRows = false; dataGridView1.ReadOnly = true; dataGridView1.RowTemplate.Height = 40; dataGridView1.DataSource = nhanvien.showCaLamViecItMeLeTan(ca); dataGridView1.AllowUserToAddRows = false; label2.Text = "Xin Chào: " + ten + " " + Ho; }