예제 #1
0
        static void Main(string[] args)
        {
            MyEnum workType;
            StockQuery query = new StockQuery();

            if (args.Length > 0)
            {
                Logger("---------------START---------------");
                if (Enum.TryParse(args[0], true, out workType) == true)
                {
                    switch (workType)
                    {
                        case MyEnum.Stage1:
                            StockUtility util = new StockUtility();

                            Logger("Reset");
                            util.Reset();

                            //Logger("QueryBroker");
                            //query.QueryBroker();

                            //Logger("QueryBrokerBranch");
                            //query.QueryBrokerBranch();

                            //Logger("QueryCompany");
                            //query.QueryCompany();

                            Logger("QueryDaliyWork");
                            query.QueryDaliyWork();

                            Logger("QueryStockWarrant");
                            query.QueryStockWarrant();
                            break;

                        case MyEnum.Stage1A:
                            Logger("QueryDaliyWork");
                            query.QueryDaliyWork();

                            Logger("QueryStockWarrant");
                            query.QueryStockWarrant();
                            break;

                        case MyEnum.Stage2:
                        case MyEnum.Stage2A:
                            DetailQuery();
                            break;

                        case MyEnum.Stage3:
                        case MyEnum.Stage3A:
                            Logger("QueryOTC");
                            query.QueryOTC();

                            Logger("QueryOTCWarrant");
                            query.QueryOTCWarrant(DateTime.Now);
                            break;

                        default:
                            break;
                    }
                }
                Logger("----------------END----------------");
            }
        }
예제 #2
0
 private void TestWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         TestWorker.ReportProgress(0, "Query Start");
         StockQuery query = new StockQuery();
         query.QueryOTC();
         query.QueryOTCWarrant(DateTime.Now);
         TestWorker.ReportProgress(0, "Query End");
     }
     catch (Exception ex)
     {
         TestWorker.ReportProgress(0, ex.Message);
     }
 }