public void dahoanthanh() { List <DuAn> lda = DuAnControllers.getListDuAnfromDB(); foreach (DuAn da in lda) { int flag = 0; if (da.CongViecDuAn != null) { string[] lcongviecda = da.CongViecDuAn.Trim().Split(','); List <CongViec> lstcv = new List <CongViec>(); foreach (var item in lcongviecda) { if (CongViecControllers.CheckCongViecHoanThanhfromDB(item) == false) { flag = 1; break; } else { lstcv.Add(CongViecControllers.getCongViecfromDB(item)); } } if (flag == 0) { da.NgayHoanThanh = checkmaxtime(lstcv); } DuAnControllers.updateDA(da); } } }