示例#1
0
        void RequestToDB_HT_ThongTinNguoiQuanHeBN()
        {
            if (!setting.HT_ThongTinVoBN)
            {
                return;
            }

            try
            {
                List <HT_ThongTinNguoiQuanHeBN> nqhs = bnhtDB.GetAllNguoiQuanHeBN();
                foreach (var bn in nqhs)
                {
                    if (bn.FlagNeedSync && bnhtDB.CheckPatientApprove(bn.MaBN))
                    {
                        var message = new MailMessage(smtpSetting.MailAddressSend, smtpSetting.MailAddressReceive, Utilities.Header_HT_NguoiQuanHe, bn.CreateFileDataXML().ToString());
                        //if (bn.FilePath != null)
                        //    AttachmentFile(ref message, "Người quan hệ bệnh nhân " + bn.MaBN + " " + bn.NgayTao.ToString("dd-MM-yyyy"), bn.FilePath);

                        mailClient.Send(message);
                        bnhtDB.ResetInforSync_VoBN(bn.Id);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }