Beispiel #1
0
 private void SWWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         SWWorker.ReportProgress(0, "Query Start");
         StockQuery query = new StockQuery();
         query.QueryStockWarrant();
         SWWorker.ReportProgress(0, "Query End");
     }
     catch (Exception ex)
     {
         SWWorker.ReportProgress(0, ex.Message);
     }
 }
Beispiel #2
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----------------");
            }
        }
Beispiel #3
0
 private void InitWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     StockQuery query = new StockQuery();
     switch ((int)e.Argument)
     {
         case 0:
             InitWorker.ReportProgress(0, "BasicData Start");
             query.QueryBroker();
             query.QueryBrokerBranch();
             query.QueryCompany();
             //
             query.QueryDaliyWork();
             query.QueryStockWarrant();
             InitWorker.ReportProgress(0, "BasicData Done");
             break;
         case 1:
             InitWorker.ReportProgress(0, "StockData Start");
             query.QueryDaliyWork();
             query.QueryStockWarrant();
             InitWorker.ReportProgress(0, "StockData Done");
             break;
         default:
             break;
     }
 }