Exemple #1
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && (e.ColumnIndex == 4 || e.ColumnIndex == 5))
     {
         if (e.ColumnIndex == 5)
         {
             tblChamCong.Rows[e.RowIndex].Delete();
         }
         tblChamCong.ghi();
     }
 }
        private void btnThem_Click(object sender, EventArgs e)
        {
            DataRow r = tblCHAMCONG.NewRow();

            r["MaNV"]  = lbDSNV.SelectedValue;
            r["Ngay"]  = dateNCCong.Value.ToShortDateString();
            r["SoGio"] = numSoGio.Value;

            tblCHAMCONG.Rows.Add(r);
            tblCHAMCONG.ghi();
        }
Exemple #3
0
        private void btnthem_Click(object sender, EventArgs e)
        {
            DataRow r = tblChamCong.NewRow();

            r["MaNV"]  = listnhanvien.SelectedValue;
            r["Ngay"]  = dtNgay.Value.ToShortDateString();
            r["SoGio"] = numSoGio.Value;
            tblChamCong.Rows.Add(r);

            tblChamCong.ghi();
        }