Example #1
0
        void RequestToDB_HT_TinhDichDo()
        {
            if (!setting.HT_ThongTinTinhDichDo)
            {
                return;
            }

            try
            {
                List <HT_TinhDichDo> tdds = bnhtDB.GetAllTinhDichDo();
                foreach (var bn in tdds)
                {
                    if (bn.FlagNeedSync && bnhtDB.CheckPatientApprove(bn.MaBN))
                    {
                        var message = new MailMessage(smtpSetting.MailAddressSend, smtpSetting.MailAddressReceive, Utilities.Header_HT_TinhDichDo, bn.CreateFileDataXML().ToString());
                        //if (bn.FilePath != null)
                        //    AttachmentFile(ref message, "Tinh dịch đồ " + bn.MaBN + " " + bn.NgayTao.ToString("dd-MM-yyyy"), bn.FilePath);

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