예제 #1
0
파일: Program.cs 프로젝트: amalapannuru/RFC
        static void Main(string[] args)
        {
            // Code that runs on application startup
            ConnectionStringSettings cs = new ConnectionStringSettings("dbconnstring", HP.Rfg.lib.utility.getParameter("dbconnstring"), "System.Data.SqlClient");
            string poolSize = HP.Rfg.lib.utility.getParameter("dbpoolsize");
            int poolSizeInt = 5;
            int.TryParse(poolSize, out poolSizeInt);
            string pathToTempDir = utility.getParameter("path_to_temp");
            
            HP.Rfg.Control.RFGActivator.StartApplication(cs, HP.Rfg.lib.utility.getParameter("smtp"), poolSizeInt, pathToTempDir);

            MessageCallback_Console msg = new MessageCallback_Console();

            try
            {
                BatchJobs.Process(pathToTempDir, msg);

                System.Environment.Exit(0);
            }
            catch (Exception ex)
            {
                msg.AppendLine(ex.Message + "\n" + ex.StackTrace + "\n");
                System.Environment.Exit(-1);
            }
            finally
            {
                HP.Rfg.Control.RFGActivator.StopApplication();
            }
            //}
        }
예제 #2
0
파일: Program.cs 프로젝트: amalapannuru/RFC
        static void Main(string[] args)
        {
            // Code that runs on application startup
            ConnectionStringSettings cs = new ConnectionStringSettings("dbconnstring", HP.Rfg.lib.utility.getParameter("dbconnstring"), "System.Data.SqlClient");
            string poolSize = HP.Rfg.lib.utility.getParameter("dbpoolsize");
            int poolSizeInt = 5;
            int.TryParse(poolSize, out poolSizeInt);
            string pathToTempDir = utility.getParameter("path_to_temp");
            
            HP.Rfg.Control.RFGActivator.StartApplication(cs, HP.Rfg.lib.utility.getParameter("smtp"), poolSizeInt, pathToTempDir);

            MessageCallback_Console msg = new MessageCallback_Console();

            //WebClient dailyTaskPage = new WebClient();
            //Byte[] include_stream = mda_include.DownloadData(source);
                
            //string pathToTempDir = utility.getParameter("path_to_temp");
            ////string platform = "";
            ////platform = ePeRFGen.lib.utility.getParameter("platform");

            ////if (platform == "localhost" | platform == "admin_production")
            ////{
            try
            {
                //    //not possible right now because DTS package can not be changed
                //    //if(Request.QueryString["requestor"] != null)
                //    //{
                //    //start task expiration emails
                //    send_expiration_emails();
                //    msg.Append("expiration emails sent\n");

                //    //start task scheduled reporting
                //    queue_scheduled_reports();
                //    msg.Append("scheduled reports sent\n");

                //    //start task crm_responses
                //    process_crm_records();
                //    msg.Append("crm records processed\n");

                //    //start task cid_responses
                //    //process_cid_records();
                //    //}

                (new DailyTasksRoutine()).processDailyTasks(pathToTempDir, false, msg);

                System.Environment.Exit(0);
            }
            catch (Exception ex)
            {
                msg.AppendLine(ex.Message + System.Environment.NewLine + ex.StackTrace + System.Environment.NewLine); //PR629404
                System.Environment.Exit(-1);
            }
            finally
            {
                HP.Rfg.Control.RFGActivator.StopApplication();
            }
            //}
        }