Ejemplo n.º 1
0
 private void btUpdate_Click(object sender, EventArgs e)
 {
     if (Them)
     {
         try
         {
             NVNhanVien nvnv = new NVNhanVien();
             nvnv.ThemNV(BienToanCuc.MaNV, BienToanCuc.TenNV, BienToanCuc.HoNV, BienToanCuc.NgaySinh, BienToanCuc.GioiTinh, BienToanCuc.Pass, ref err);
             Loaddata();
             MessageBox.Show("Đã Thêm Xong");
         }
         catch
         {
             MessageBox.Show("Không Thêm Được");
         }
     }
     else
     {
         try
         {
             int        r     = dgvNV.CurrentCell.RowIndex;
             string     strGV = dgvNV.Rows[r].Cells[0].Value.ToString();
             NVNhanVien nvkh  = new NVNhanVien();
             nvkh.CapNhatKH(strGV, BienToanCuc.TenNV, BienToanCuc.HoNV, BienToanCuc.NgaySinh, BienToanCuc.GioiTinh, BienToanCuc.Pass, ref err);
             Loaddata();
         }
         catch
         {
             MessageBox.Show("Không Sửa Được");
         }
     }
 }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            NVNhanVien nv = new NVNhanVien();

            nv.ThemNV(txbMaNV.Text, txbTenNV.Text, txbHoNV.Text, dateTimePicker1.Text, cbGender.Text, txbPassword.Text, ref err);
            this.Hide();
        }