void RequestToDB_HT_NguoiVanDong() { if (!setting.HT_ThongTinNVD) { return; } try { List <HT_NguoiVanDong> nvds = bnhtDB.GetAllNguoiVanDong(); foreach (var bn in nvds) { if (bn.FlagNeedSync && bnhtDB.CheckPatientApprove(bn.MaBN)) { var message = new MailMessage(smtpSetting.MailAddressSend, smtpSetting.MailAddressReceive, Utilities.Header_HT_NguoiVanDong, bn.CreateFileDataXML().ToString()); //if (bn.FilePath != null) // AttachmentFile(ref message, "Người vận động " + bn.MaBN + " " + bn.NgayTao.ToString("dd-MM-yyyy"), bn.FilePath); mailClient.Send(message); bnhtDB.ResetInforSync_NVD(bn.Id); } } } catch (Exception ex) { throw ex; } }