void RequestToDB_HT_LuuTruMau() { if (!setting.HT_ThongTinLuuTruMau) { return; } try { List <HT_LuuTruMau> ltms = bnhtDB.GetAllLuuTruMau(); foreach (var bn in ltms) { if (bn.FlagNeedSync && bnhtDB.CheckPatientApprove(bn.MaBN)) { var message = new MailMessage(smtpSetting.MailAddressSend, smtpSetting.MailAddressReceive, Utilities.Header_HT_LuuTruMau, bn.CreateFileDataXML().ToString()); //if (bn.FilePath != null) // AttachmentFile(ref message, "Lưu trữ mẫu " + bn.MaBN + " " + bn.NgayTao.ToString("dd-MM-yyyy"), bn.FilePath); mailClient.Send(message); bnhtDB.ResetInforSync_LuuTruMau(bn.Id); } } } catch (Exception ex) { throw ex; } }