void RequestToDB_HT_DacTrungNH() { if (!setting.HT_ThongTinDacTrungNH) { return; } try { List <HT_DacTrungNguoiHien> dthts = bnhtDB.GetAllDacTrung(); foreach (var dt in dthts) { if (dt.FlagNeedSync && bnhtDB.CheckPatientApprove(dt.MaBN)) { var message = new MailMessage(smtpSetting.MailAddressSend, smtpSetting.MailAddressReceive, Utilities.Header_HT_DacTrungNguoiHien, dt.CreateFileDataXML().ToString()); //if (dt.FilePath != null) // AttachmentFile(ref message, "Đặc trưng bệnh nhân " + dt.MaBN + " " + dt.NgayTao.ToString("dd-MM-yyyy"), dt.FilePath); mailClient.Send(message); bnhtDB.ResetInforSync_DacTrung(dt.Id); } } } catch (Exception ex) { throw ex; } }