public bool Delete(HoKhau cd) { List <CongDan> congDans = CongDanDAL.GetInstance().ReadAllBySoHoKhau(cd.SoHoKhau); foreach (CongDan congDan in congDans) { congDan.EmptyHoKhau(); CongDanDAL.GetInstance().Update(congDan); } return(HoKhauDAL.GetInstance().Delete(cd)); }
public bool Update(CongDan cd) { bool result = CongDanDAL.GetInstance().Update(cd); if (result) { HoKhau hk = HoKhauDAL.GetInstance().ReadByMaChuHo(cd.Ma); if (hk != null) { cd.SetChuHo(hk); HoKhauDAL.GetInstance().Update(hk); } } return(result); }
public List <CongDan> ReadAllByKeyWord(string key) { return(CongDanDAL.GetInstance().ReadAllByKeyWord(key)); }
public List <CongDan> ReadAllByMaHoKhau(string soSo) { return(CongDanDAL.GetInstance().ReadAllBySoHoKhau(soSo)); }
public CongDan Read(int ma) { return(CongDanDAL.GetInstance().Read(ma)); }
public List <CongDan> ReadAll() { return(CongDanDAL.GetInstance().ReadAll()); }
public bool Delete(CongDan cd) { return(CongDanDAL.GetInstance().Delete(cd)); }
public bool Add(CongDan cd) { return(CongDanDAL.GetInstance().Add(cd)); }