/// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public bool ProcessEmailAlertData()
        {
            List<rsp_GetSiteListResult> lstSites = null;
            string sSendMail = string.Empty;

            using (DataHelper context = new DataHelper(DatabaseHelper.GetConnectionString()))
            {
                context.GetSetting(0, "SendMailFromEnterprise", "false", ref sSendMail);

                if (Convert.ToBoolean(sSendMail))
                {
                    lstSites = context.GetSiteList().ToList();

                    LogManager.WriteLog("Count" + lstSites.Count.ToString(), LogManager.enumLogLevel.Info);
                    if (lstSites != null && lstSites.Count > 0)
                    {
                        foreach (rsp_GetSiteListResult site in lstSites)
                        {
                            LogManager.WriteLog("Spawning New Thread", LogManager.enumLogLevel.Info);
                            LogManager.WriteLog("SITE CODE :" + site.SITE_CODE, LogManager.enumLogLevel.Info);
                            workerThread = new Thread((ProcessWorkerThread)) { Name = site.SITE_CODE };
                            workerThread.Start(site.SITE_CODE);
                            // workerThread.Start("1002");
                            workerThread.Priority = ThreadPriority.Normal;
                        }
                        // ProcessWorkerThread("1002");
                    }
                }
                else
                    ProcessWorkerThread(string.Empty);
            }
            return true;
        }
Пример #2
0
        /// <summary>
        /// get setting value from setting table.
        /// </summary>
        /// <param name="SettingName"></param>
        /// <returns></returns>
        public static string GetSetting(string SettingName)
        {
            string strSetting = string.Empty;

            try
            {

                using (DataHelper context = new DataHelper(DatabaseHelper.GetConnectionString()))
                {
                    context.GetSetting(0, SettingName, string.Empty, ref strSetting);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
            return strSetting;
        }