public C100SendMailControl() { string sMsg; InitializeComponent(); m_Wnd = (umail.MainWindow)Application.Current.MainWindow; m_libCmn = m_Wnd.GetClassLibCommon(); m_libUsbProtect = new LibUsbProtect(); int ret = m_libUsbProtect.ProtectMail(); if (ret != Constants.USBPROTECTNO) { sMsg = "プロテクトが確認できません。"; MessageBox.Show(sMsg); m_Wnd.ExitMainWindow(); return; } InitControl(); }
private void SendMailLoop() { ObjSendRecord objSendRecord; int ret; int cnt; string sMsg; string sYear; string sMonth; string sDay; string sHour; string sMinute; string sSecond; string sDate; string sTime; int max, idx; if (m_bCheckUnisSystem == true && m_bCheckTerminal == true) { ret = m_libUsbProtect.ProtectMail(); if (ret != Constants.USBPROTECTNO) { sMsg = "プロテクトが確認できません。"; MessageBox.Show(sMsg); ExitControl(); m_Wnd.ExitMainWindow(); return; } cnt = m_Wnd.GetMailElementUserCount(); if (m_Wnd.GetStatusDisplay() == true) { txtStat.Text = "UMailシステム動作中 登録者数" + cnt + "人"; } DateTime dt = DateTime.Now; sYear = dt.ToString("yyyy"); sMonth = dt.ToString("MM"); sDay = dt.ToString("dd"); sHour = dt.ToString("HH"); sMinute = dt.ToString("mm"); sSecond = dt.ToString("ss"); m_nTimeCount++; txtDate.Text = sYear + "年" + sMonth + "月" + sDay + "日"; m_nCrthhmmss = sHour + "時" + sMinute + "分" + sSecond + "秒"; sDate = sYear + sMonth + sDay; sTime = sHour + sMinute + sSecond; m_Wnd.ODBCOpenUnisDB(); objSendRecord = m_Wnd.ODBCSelecttEnter(); m_Wnd.ODBCCloseUnisDB(); max = objSendRecord.m_lstRecord.Count; for (idx = 0; idx < max; idx++) { m_Wnd.SendMailLoop(objSendRecord.m_lstRecord[idx]); } if (objSendRecord.m_bRet == true) { m_Wnd.SetBaseDate(sDate); m_Wnd.SetBaseTime(sTime); } } }