public static void StartSendEmailMonitor() { if (m_emailSMTPRepository == null) { m_controller = new NotasFiscaisController(); m_emailSMTPRepository = new EmailSMTPRepository(); m_emailLOGRepository = new EmailLogEnvioRepository(); m_autoEventThreadSendEmailFaturamento = new AutoResetEvent(false); ParameterizedThreadStart l_ParamThreadStart = new ParameterizedThreadStart(CheckIfItsTimeToSendEmail); m_threadCheckIfIsTimeToSendEmail = new Thread(l_ParamThreadStart); RouteData routeData = new RouteData(); routeData.Values.Add("controller", "NotasFiscaisController"); ControllerContext fakeControllerContext = new ControllerContext(new HttpContextWrapper(HttpContext.Current), routeData, m_controller); m_threadCheckIfIsTimeToSendEmail.Start(fakeControllerContext); } }
public static bool empresaValida(int IdEmpresa, SqlConnection sqlCon) { return(NotasFiscaisController.checaExistencia(new string[] { $"{Empresas.ALIAS}.Id = {IdEmpresa}" }, $"dbo.Empresas {Empresas.ALIAS}", sqlCon)); }
public static bool produtoValido(int id, SqlConnection sqlCon) { return(NotasFiscaisController.checaExistencia(new string[] { $"{Produtos.ALIAS}.Id = {id}" }, $"dbo.Produtos {Produtos.ALIAS}", sqlCon)); }
public static bool nfValida(int id, SqlConnection sqlCon) { return(NotasFiscaisController.checaExistencia(new string[] { $"{NotasFiscais.ALIAS}.Id = {id}" }, $"dbo.NotasFiscais {NotasFiscais.ALIAS}", sqlCon)); }