void RequestToDB_HT_ThongTinBenhNhan() { if (!setting.HT_ThongTinBN) { return; } try { List <HT_ThongTinNguoiHienTinh> ttnhts = bnhtDB.GetAllNguoiHienTinh(); foreach (var ttnh in ttnhts) { if (bnhtDB.CheckPatientApprove(ttnh.MaBN)) { if (ttnh.FlagNeedSync) { var message = new MailMessage(smtpSetting.MailAddressSend, smtpSetting.MailAddressReceive, Utilities.Header_HT_ThongTinNguoiHien, ttnh.CreateFileDataXML().ToString()); mailClient.Send(message); bnhtDB.ResetInforSync_ThongTinBN(ttnh.MaBN); } } } } catch (Exception ex) { throw ex; } }