Ejemplo n.º 1
0
 private void btnReset_Click(object sender, EventArgs e)
 {
     txtComment.Text = "Đang xóa toàn bộ dữ liệu giá cũ ...";
     txtComment.Refresh();
     WebLib.ResetPrice();
     txtComment.Text = "Đã xóa xong toàn bộ dữ liệu giá cũ!";
 }
Ejemplo n.º 2
0
        private void btnHSC_Click(object sender, EventArgs e)
        {
            txtComment.Text = "Đang xử lý nhập liệu từ HSC...";
            txtComment.Refresh();
            string sDir = @"D:\Stock\Data\HSC";

            WebLib.OverBidOffer(sDir);
            txtComment.Text = "Đã xử lý xong nhập liệu từ HSC!";
        }
Ejemplo n.º 3
0
        private void btniStock_Click(object sender, EventArgs e)
        {
            txtComment.Text = "Đang xử lý nhập giá CK từ iStock vào DB ...";
            txtComment.Refresh();
            string sDir = Application.StartupPath + @"\Data\iStock";

            WebLib.iStockPrice(sDir);
            txtComment.Text = "Đã xử lý xong nhập giá CK từ iStock vào DB!";
        }
Ejemplo n.º 4
0
        private void btnInputTVSI_Click(object sender, EventArgs e)
        {
            txtComment.Text = "Đang xử lý nhập thông tin tài chính từ tvsi.com.vn ...";
            txtComment.Refresh();
            string sDir = Application.StartupPath + @"\Data\Finance";

            WebLib.FinanceTVSI(sDir);
            txtComment.Text = "Đã xử lý xong nhập thông tin tài chính từ tvsi.com.vn!";
        }
Ejemplo n.º 5
0
        private void btnLiveHCM_Click(object sender, EventArgs e)
        {
            txtComment.Text = "Đang xử lý nhập giá CK HCM (hsx.org) và HN (hastc.org.vn) vào Live ...";
            txtComment.Refresh();
            string sDir = Application.StartupPath + @"\Data\Live\";

            WebLib.ExeLivePrice(sDir);
            txtComment.Text = "Đã xử lý xong nhập giá CK HCM (hsx.org) và HN (hastc.org.vn) vào Live!";
        }
Ejemplo n.º 6
0
        private void btnHN_Click(object sender, EventArgs e)
        {
            txtComment.Text = "Đang xử lý nhập thông tin các công ty của HN từ hastc.org.vn ...";
            txtComment.Refresh();
            string sDir = Application.StartupPath + @"\Data\HN";

            WebLib.HNCompany(sDir);
            txtComment.Text = "Đã xử lý xong nhập thông tin các công ty của HN từ hastc.org.vn!";
        }
Ejemplo n.º 7
0
        private void btnHCM_Click(object sender, EventArgs e)
        {
            txtComment.Text = "Đang xử lý nhập thông tin các công ty của HCM từ HSX...";
            txtComment.Refresh();
            string sDir = Application.StartupPath + @"\Data\HCM";

            WebLib.HCMCompany(sDir);
            txtComment.Text = "Đã xử lý xong nhập thông tin các công ty của HCM từ HSX!";
        }
Ejemplo n.º 8
0
        private void btnHSX_Click(object sender, EventArgs e)
        {
            txtComment.Text = "Đang xử lý nhập liệu từ HSX...";
            txtComment.Refresh();
            string sDir = @"D:\Stock\Data\HSX";

            //MessageBox.Show(sDir);
            WebLib.HSX(sDir);
            txtComment.Text = "Đã xử lý xong nhập liệu từ HSX!";
        }
Ejemplo n.º 9
0
 private void btnFinanceTVSI_Click(object sender, EventArgs e)
 {
     txtComment.AppendText("Đang lấy được dữ liệu tài chính từ tvsi.com.vn ...");
     txtComment.Refresh();
     // get info from hsc.com.vn
     if (!WebLib.GetFinanceAll("http://www.tvsi.com.vn/company.asp?MCK=", Application.StartupPath + @"\Data\Finance\"))
     {
         txtComment.AppendText("Không lấy được dữ liệu tài chính từ tvsi.com.vn!\n");
         txtComment.AppendText(Environment.NewLine);
         txtComment.AppendText("Hoàn tất!");
     }
     else
     {
         txtComment.AppendText("Lấy xong dữ liệu tài chính từ tvsi.com.vn!");
         txtComment.AppendText(Environment.NewLine);
         txtComment.AppendText("Hoàn tất!");
     }
 }
Ejemplo n.º 10
0
        /*---------------------------------
         * Description: Get live price and put them into Live DB
         * ----------------------------------- */
        public static void ExeLivePrice(string sPath)
        {
            int iInterest = 20;

            if (DateTime.Now.Hour > 8)
            {
                while (DateTime.Now.Hour <= 11)
                {
                    if ((DateTime.Now.Second % iInterest) == 0)
                    {
                        // Ha Noi
                        WebLib.HttpPostTime("http://www.hastc.org.vn/InfoShow/OnlineShareContinuousInterface.aspx", sPath, "HN");
                        // HCM
                        if (DateTime.Now.Hour < 10 && DateTime.Now.Minute < 31)
                        {
                            WebLib.HttpPostTime("http://www.hsx.vn/LS_HSX/HoSTC_Livesecurity.htm", sPath, "HCM");
                        }
                    }
                }
            }
        }
Ejemplo n.º 11
0
        private void btnDownload_Click(object sender, EventArgs e)
        {
            previousDays = (int)txtDays.result;
            string url, file;

            txtComment.Text = "Đang lấy dữ liệu hiện hành từ Internet...";
            txtComment.AppendText(Environment.NewLine);
            txtComment.Refresh();

            // get info from hsx.vn
            if (!WebLib.HttpPost("http://www.hsx.vn/hsx/Modules/Giaodich/Live3Price.aspx", Application.StartupPath + @"\Data\hsx\"))
            {
                txtComment.AppendText("Không lấy được dữ liệu từ hsx.vn!");
                txtComment.AppendText(Environment.NewLine);
            }
            else
            {
                txtComment.AppendText("Lấy xong dữ liệu từ hsx.vn!");
                txtComment.AppendText(Environment.NewLine);
            }

            // get EOD info from cafef
            //if (LibWeb.DownloadFile("http://images1.cafef.vn/data/" + DateTime.Now.AddDays(-1).ToString("yyyyMMdd") + "/CafeF.SolieuGD." + DateTime.Now.AddDays(-1).ToString("ddMMyyyy") + ".zip", @"D:\"))
            if (isAll)
            {
                //http://images1.cafef.vn/data/20140625/CafeF.SolieuGD.Upto25062014.zip
                url  = "http://images1.cafef.vn/data/" + DateTime.Now.AddDays(-previousDays).ToString("yyyyMMdd") + "/CafeF.SolieuGD.Upto" + DateTime.Now.AddDays(-previousDays).ToString("ddMMyyyy") + ".zip";
                file = "CafeF.SolieuGD.Upto" + DateTime.Now.AddDays(-previousDays).ToString("ddMMyyyy") + ".zip";
                DownloadFile(url, file);
            }
            else
            {
                for (int i = 0; i <= previousDays; i++)
                {
                    url  = "http://images1.cafef.vn/data/" + DateTime.Now.AddDays(-i).ToString("yyyyMMdd") + "/CafeF.SolieuGD." + DateTime.Now.AddDays(-i).ToString("ddMMyyyy") + ".zip";
                    file = "CafeF.SolieuGD." + DateTime.Now.AddDays(-i).ToString("ddMMyyyy") + ".zip";
                    DownloadFile(url, file);
                }
            }

            // get Index info from cafef
            if (isAll)
            {
                //http://images1.cafef.vn/data/20140625/CafeF.Index.Upto25062014.zip
                url  = "http://images1.cafef.vn/data/" + DateTime.Now.AddDays(-previousDays).ToString("yyyyMMdd") + "/CafeF.Index.Upto" + DateTime.Now.AddDays(-previousDays).ToString("ddMMyyyy") + ".zip";
                file = "CafeF.Index.Upto" + DateTime.Now.AddDays(-previousDays).ToString("ddMMyyyy") + ".zip";
                DownloadFile(url, file);
            }
            else
            {
                for (int i = 0; i <= previousDays; i++)
                {
                    url  = "http://images1.cafef.vn/data/" + DateTime.Now.AddDays(-i).ToString("yyyyMMdd") + "/CafeF.Index." + DateTime.Now.AddDays(-i).ToString("ddMMyyyy") + ".zip";
                    file = "CafeF.Index." + DateTime.Now.AddDays(-i).ToString("ddMMyyyy") + ".zip";
                    DownloadFile(url, file);
                }
            }


            // get info from hsc.com.vn
            if (!WebLib.HttpPost("http://hsc.com.vn/Market.aspx", Application.StartupPath + @"\Data\hsc\"))
            {
                txtComment.AppendText("Không lấy được dữ liệu từ hsc.com.vn!\n");
                txtComment.AppendText(Environment.NewLine);
                txtComment.AppendText("Hoàn tất!");
            }
            else
            {
                txtComment.AppendText("Lấy xong dữ liệu từ hsc.com.vn!");
                txtComment.AppendText(Environment.NewLine);
                txtComment.AppendText("Hoàn tất!");
            }
        }