コード例 #1
0
        public ObjRecordElement SetSendMailRecordElement(OdbcDataReader reader)
        {
            ObjRecordElement objRecordElement;
            string           sLUid;
            string           sLTid;
            int    nLTid;
            string sLUserType;
            string sLMode;

            objRecordElement              = new ObjRecordElement();
            sLTid                         = GetReaderString(reader, 2);
            nLTid                         = m_libCmn.StrToInt(sLTid);
            objRecordElement.m_nLTid      = nLTid;
            objRecordElement.m_sTName     = GetTerminalName(nLTid);
            sLUid                         = GetReaderString(reader, 3);
            objRecordElement.m_nLUid      = m_libCmn.StrToInt(sLUid);
            objRecordElement.m_sCName     = GetReaderString(reader, 4);
            objRecordElement.m_sCDate     = GetReaderString(reader, 0);
            objRecordElement.m_sCTime     = GetReaderString(reader, 1);
            sLUserType                    = GetReaderString(reader, 9);
            objRecordElement.m_nLUserType = m_libCmn.StrToInt(sLUserType);
            objRecordElement.m_sCUnique   = GetReaderString(reader, 5);
            sLMode                        = GetReaderString(reader, 10);
            objRecordElement.m_nLMode     = m_libCmn.StrToInt(sLMode);
            return(objRecordElement);
        }
コード例 #2
0
        // メールを送信
        public void SendMailLoop(ObjRecordElement record)
        {
            int    nLUid;
            int    nLTid;
            string sTName;
            string sCName;
            string sCDate;
            string sCTime;
            int    nLUserType;
            string sCUnique;
            int    nLMode;
            string sMsg;

            List <ObjMailElement>  listOME;
            List <ObjAdminElement> listOAE;
            int            max, idx;
            ObjMailElement ome;

            nLTid      = record.m_nLTid;
            sTName     = record.m_sTName;
            nLUid      = record.m_nLUid;
            sCName     = record.m_sCName;
            sCDate     = record.m_sCDate;
            sCTime     = record.m_sCTime;
            nLUserType = record.m_nLUserType;
            sCUnique   = record.m_sCUnique;
            nLMode     = record.m_nLMode;

            if (m_sBFDate == sCDate &&
                m_sBFTime == sCTime &&
                m_nBFId == nLUid)
            {
                return;
            }
            m_sBFDate = sCDate;
            m_sBFTime = sCTime;
            m_nBFId   = nLUid;

            if (nLUid == -1)
            {
                sMsg = sCDate.Substring(4, 2) + "月" + sCDate.Substring(6, 2) + "日 ";
                sMsg = sMsg + sCTime.Substring(0, 2) + "時" + sCTime.Substring(2, 2) + "分";
                sMsg = sMsg + " 認証失敗";
                if (m_objCrt != null)
                {
                    Type type = m_objCrt.GetType();
                    if (type == typeof(C100SendMailControl))
                    {
                        m_objSMC = (C100SendMailControl)m_objCrt;
                        m_objSMC.AddLstLog(sMsg);
                    }
                }
                return;
            }

            ome              = new ObjMailElement();
            ome.m_sCName     = sCName;
            ome.m_sCDateTime = sCDate + sCTime;
            ome.m_nLTid      = nLTid;
            ome.m_sTName     = sTName;
            SetLogInfo(ome, nLMode);

            if (nLMode == 1 || nLMode == 2 || nLMode == 3)
            {
                if (nLMode == 3)
                {
                    nLMode = m_nDefLMode;
                }
                else
                {
                    m_nDefLMode = nLMode;
                }
                listOME = GetMailElementList();
                max     = listOME.Count;
                for (idx = 0; idx < max; idx++)
                {
                    if (listOME[idx].m_nLUid == nLUid)
                    {
                        listOME[idx].m_sCDateTime = sCDate + sCTime;
                        listOME[idx].m_nLTid      = nLTid;
                        listOME[idx].m_sTName     = sTName;
                        try
                        {
                            SendMail(listOME[idx], nLMode);
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }
                if (GetAdminSend() == true)
                {
                    if (GetAdminSend() == true)
                    {
                        listOAE = GetAdminElementList();
                        max     = listOAE.Count;
                        for (idx = 0; idx < max; idx++)
                        {
                            ome.m_sSendName = listOAE[idx].m_sName;
                            ome.m_sSendMail = listOAE[idx].m_sMail;
                            try
                            {
                                SendMail(ome, nLMode);
                            }
                            catch (Exception ex)
                            {
                            }
                        }
                    }
                }
            }
        }