示例#1
0
        public FrmOpt10005Caller()
        {
            InitializeComponent();

            _clsDataAccessUtil = new ClsDataAccessUtil();

            ClsAxKH.AxKH_10005_OnReceived += new ClsAxKH.OnReceivedEventHandler(Opt10005_OnReceived);

            Func <DataTable> funcGetStockData = () =>
            {
                RichQuery oRichQuery = new RichQuery();
                return(oRichQuery.p_ScodeQuery("1", "", "", false).Tables[0].Copy());
            };

            _dtStockCode = funcGetStockData();

            foreach (DataRow dr in _dtStockCode.Rows)
            {
                if (ClsAxKH.GetMasterCodeName(dr["STOCK_CODE"].ToString().Trim()) == "")
                {
                    continue;
                }

                _StockQueue.Enqueue(dr["STOCK_CODE"].ToString());
            }

            proBar10005.Maximum = _dtStockCode.Rows.Count;

            if (System.DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
            {
                _stdDate = DateTime.Today.AddDays(-1).ToString("yyyyMMdd");
            }
            else if (System.DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
            {
                _stdDate = DateTime.Today.AddDays(-2).ToString("yyyyMMdd");
            }
            else
            {
                int i = Int32.Parse(System.DateTime.Now.ToString("HH") + System.DateTime.Now.ToString("ss"));

                if (i > 1600)
                {
                    _stdDate = CDateTime.FormatDate(System.DateTime.Now.Date.ToShortDateString());
                }
                else if (System.DateTime.Now.DayOfWeek == DayOfWeek.Monday)
                {
                    _stdDate = DateTime.Today.AddDays(-3).ToString("yyyyMMdd");
                }
                else
                {
                    _stdDate = DateTime.Today.AddDays(-1).ToString("yyyyMMdd");
                }
            }
        }
示例#2
0
        public FrmOpt10001Caller(DataTable UserDt, bool AutoStart = false, bool chk100Click = false)
        {
            InitializeComponent();

            _clsDataAccessUtil = new ClsDataAccessUtil();

            ClsAxKH.AxKH_10001_OnReceived += new ClsAxKH.OnReceivedEventHandler(Opt10001_OnReceived);

            Func <DataTable> funcGetStockData = () =>
            {
                if (UserDt != null)
                {
                    return(UserDt.Copy());
                }
                else
                {
                    RichQuery oRichQuery = new RichQuery();
                    return(oRichQuery.p_ScodeQuery("1", "", "", false).Tables[0].Copy());
                }
            };

            _dtStockCode = funcGetStockData();

            foreach (DataRow dr in _dtStockCode.Rows)
            {
                if (ClsAxKH.GetMasterCodeName(dr["STOCK_CODE"].ToString().Trim()) == "")
                {
                    continue;
                }

                _StockQueue.Enqueue(dr["STOCK_CODE"].ToString());
            }

            proBar10001.Maximum = _dtStockCode.Rows.Count;

            chk100.Checked = chk100Click;

            _AutoStart = AutoStart;

            if (AutoStart == true)
            {
                string text         = "";
                string errorMessage = null;
                text = "OPT10001 작업 Start";
                ClsTelegramBot.SendMessage(text, out errorMessage);
                OnGetStockCode();
            }
        }
示例#3
0
        public FrmOpt10081Caller(DataTable UserDt, bool AutoStart = false, bool chk100Click = false)
        {
            InitializeComponent();

            _clsDataAccessUtil = new ClsDataAccessUtil();

            ClsAxKH.AxKH_10081_OnReceived += new ClsAxKH.OnReceivedEventHandler(Opt10081_OnReceived);

            Func <DataTable> funcGetStockData = () =>
            {
                if (UserDt != null)
                {
                    return(UserDt.Copy());
                }
                else
                {
                    RichQuery oRichQuery = new RichQuery();
                    return(oRichQuery.p_ScodeQuery("1", "", "", false).Tables[0].Copy());
                }
            };

            _dtStockCode = funcGetStockData();

            foreach (DataRow dr in _dtStockCode.Rows)
            {
                if (ClsAxKH.GetMasterCodeName(dr["STOCK_CODE"].ToString().Trim()) == "")
                {
                    continue;
                }

                _StockQueue.Enqueue(dr["STOCK_CODE"].ToString());
            }

            proBar10081.Maximum = _dtStockCode.Rows.Count;

            _stdDate = _clsCollectOptDataFunc.GetAvailableDate();

            dtpStdDate.Value = _clsUtil.StringToDateTime(_stdDate);

            chk100.Checked = chk100Click;

            _AutoStart = AutoStart;

            if (AutoStart == true)
            {
                btn10081_Click(null, new EventArgs());
            }
        }
示例#4
0
        public FrmOpt90002Caller()
        {
            InitializeComponent();

            _clsDataAccessUtil = new ClsDataAccessUtil();

            ClsAxKH.AxKH_90002_OnReceived += new ClsAxKH.OnReceivedEventHandler(Opt90002_OnReceived);

            //Func<DataTable> funcGetStockData = () =>
            //{
            //    RichQuery oRichQuery = new RichQuery();
            //    return oRichQuery.p_ScodeQuery("1", "", "", false).Tables[0].Copy();
            //};

            //_dtStockCode = funcGetStockData();

            Func <DataTable> funcGetKthGp = () =>
            {
                KiwoomQuery kiwoom = new KiwoomQuery();
                return(kiwoom.p_KthgpQuery("1", "", "", false).Tables[0].Copy());
            };

            _dtKthgp = funcGetKthGp();

            proBar90002.Maximum = _dtKthgp.Rows.Count;

            foreach (DataRow dr in _dtKthgp.Rows)
            {
                _StockQueue.Enqueue(dr["KTH_CODE"].ToString());
            }


            //_dt = new DataTable();
            ///// 999 - 코스피, 코스닥
            //_dt = _clsGetKoaStudioMethod.GetCodeListByMarketCallBackDataTable("0").Copy();
        }
示例#5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dt">작업할 종목들</param>
        /// <param name="stdDate">기준일로부터 최근 3개월</param>
        public FrmOptDayJobCaller(DataTable dt, String stdDate)
        {
            InitializeComponent();
            _stdDate           = stdDate;
            _clsDataAccessUtil = new ClsDataAccessUtil();

            ClsAxKH.AxKH_10015_OnReceived += new ClsAxKH.OnReceivedEventHandler(Opt10015_OnReceived);
            ClsAxKH.AxKH_10081_OnReceived += new ClsAxKH.OnReceivedEventHandler(Opt10081_OnReceived);

            if (dt == null)
            {
                Func <DataTable> funcGetStockData = () =>
                {
                    RichQuery oRichQuery = new RichQuery();
                    return(oRichQuery.p_ScodeQuery("1", "", "", false).Tables[0].Copy());
                };

                _dtStockCode = funcGetStockData();
            }
            else
            {
                Func <DataTable> funcGetStockData = () =>
                {
                    RichQuery oRichQuery = new RichQuery();
                    return(oRichQuery.p_ScodeQuery("1", "", "", false).Tables[0].Copy());
                };

                _dtStockCode = dt.Copy();
                dt           = null;
            }

            foreach (DataRow dr in _dtStockCode.Rows)
            {
                if (ClsAxKH.GetMasterCodeName(dr["STOCK_CODE"].ToString().Trim()) == "")
                {
                    continue;
                }

                _StockQueue.Enqueue(dr["STOCK_CODE"].ToString());
            }

            proBar10015.Maximum = _dtStockCode.Rows.Count;
            proBar10060.Maximum = _dtStockCode.Rows.Count;
            proBar10081.Maximum = _dtStockCode.Rows.Count;

            if (_stdDate == "")
            {
                if (System.DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
                {
                    _stdDate = DateTime.Today.AddDays(-1).ToString("yyyyMMdd");
                }
                else if (System.DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
                {
                    _stdDate = DateTime.Today.AddDays(-2).ToString("yyyyMMdd");
                }
                else
                {
                    int i = Int32.Parse(System.DateTime.Now.ToString("HH") + System.DateTime.Now.ToString("ss"));

                    if (i > 1600)
                    {
                        _stdDate = CDateTime.FormatDate(System.DateTime.Now.Date.ToShortDateString());
                    }
                    else if (System.DateTime.Now.DayOfWeek == DayOfWeek.Monday)
                    {
                        _stdDate = DateTime.Today.AddDays(-3).ToString("yyyyMMdd");
                    }
                    else
                    {
                        _stdDate = DateTime.Today.AddDays(-1).ToString("yyyyMMdd");
                    }
                }
            }

            string  reDate  = "";
            ClsUtil clsUtil = new ClsUtil();

            reDate = clsUtil.Mid(_stdDate, 1, 4) + "-" + clsUtil.Mid(_stdDate, 5, 2) + clsUtil.Mid(_stdDate, 7, 2);

            DateTime dtDate = Convert.ToDateTime(reDate);

            _minDate = dtDate.AddDays(Convert.ToInt32(DayOfWeek.Monday) - Convert.ToInt32(dtDate.DayOfWeek)).ToString("yyyyMMdd");

            proBar10015.Value = _StockQueue.Count;
            proBar10081.Value = _StockQueue.Count;
            proBar10060.Value = _StockQueue.Count;

            OnGetStockCode();

            BtnStart.Text = "작업 중";
        }