Example #1
0
        private void tsbthem_Click(object sender, EventArgs e)
        {
            NhanVien1 frm = new NhanVien1();

            frm.THEM = true;
            frm.MANV = DEM2.ToString();
            frm.ShowDialog();
            LoadData();
        }
Example #2
0
        private void tsbsua_Click(object sender, EventArgs e)
        {
            NhanVien1 frm = new NhanVien1();

            frm.THEM = false;
            if (DEM1 == 0)
            {
                MessageBox.Show("Bạn chưa chọn nhân viên để cập nhật thông tin mơi", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
            else
            {
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "MANV") != null)
                {
                    frm.MANV = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "MANV").ToString();
                }
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "HOTEN") != null)
                {
                    frm.HOTEN = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "HOTEN").ToString();
                }
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "DIACHI") != null)
                {
                    frm.DIACHI = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "DIACHI").ToString();
                }
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "SDT") != null)
                {
                    frm.DIENTHOAI = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "SDT").ToString();
                }
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "MABP") != null)
                {
                    frm.MABP = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "MABP").ToString();
                }
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "GIOITINH") != null)
                {
                    frm.GIOITINH = bool.Parse(gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "GIOITINH").ToString());
                }
                frm.ShowDialog();
            }

            LoadData();
        }