private void xlThem() { CNhanVien nv = new CNhanVien (txtMa.Text, txtTen.Text, bool.Parse(radioGioiTinh.EditValue.ToString()), txtDiaChi.Text, txtDienThoai.Text, txtDiDong.Text, (deNgaySinh.Text == "" ? DateTime.Now : DateTime.Parse(deNgaySinh.Text)), (gleBoPhan.Text == "" ? "" : gleBoPhan.EditValue.ToString()), (gleQuanLy.Text == "" ? "" : gleQuanLy.EditValue.ToString()), txtChucVu.Text, txtEmail.Text, checkConQL.Checked); nv.completeObject(); BUS_NhanVien.ThemNV(nv); sendNV?.Invoke(); Action.Module = "Nhân Viên"; Action.ActionName = "Sửa"; Action.Reference = txtMa.Text; Action.LuuThongTin(); this.Close(); }
private void xlSua() { editNV.MaNV = txtMa.Text; editNV.TenNV = txtTen.Text; editNV.GioiTinh = bool.Parse(radioGioiTinh.EditValue.ToString()); editNV.DiaChi = txtDiaChi.Text; editNV.DienThoai = txtDienThoai.Text; editNV.DiDong = txtDiDong.Text; editNV.NgaySinh = (deNgaySinh.Text == "" ? DateTime.Now : DateTime.Parse(deNgaySinh.Text)); editNV.BoPhan = (gleBoPhan.Text == "" ? "" : gleBoPhan.EditValue.ToString()); editNV.QuanLy = (gleQuanLy.Text == "" ? "" : gleQuanLy.EditValue.ToString()); editNV.ChucVu = txtChucVu.Text; editNV.Email = txtEmail.Text; editNV.ConQL = checkConQL.Checked; editNV.completeObject(); BUS_NhanVien.SuaNV(editNV); sendNV?.Invoke(); Action.Module = "Nhân Viên"; Action.ActionName = "Thêm"; Action.Reference = txtMa.Text; Action.LuuThongTin(); Close(); }