Beispiel #1
0
        private async void toolStripButtonEdit_Click(object sender, EventArgs e)
        {
            toolStripLabel1.Text = "";
            toolStrip1.Enabled   = false;
            dt.Rows.Clear();
            isEdit = true;
            SetButton();

            //Get key and id
            string key = GlobalUtility.GetKey();
            string id  = GlobalUtility.GetID();

            DateTime lastTrade = TradeDate.LastNTradeDateDT(1);
            string   aday      = (lastTrade.Year - 1911) + lastTrade.ToString("MMdd");

            //parse TWSE and OTC Incr html
            if (!await ParseHtml($"http://siis.twse.com.tw/server-java/t159sa04?step=1&id=9200pd{id}&TYPEK=sii&key={key}&cDATE={aday}&co_id=9200", true)
                & !await ParseHtml($"http://siis.twse.com.tw/server-java/t159sa04?step=1&id=9200pd{id}&TYPEK=otc&key={key}&cDATE={aday}&co_id=9200", false))
            {
                return;
            }

            //LoadData();
            GlobalUtility.LogInfo("Info", GlobalVar.globalParameter.userID + " 下載可增額列表");
            toolStrip1.Enabled = true;
        }
        private async void toolStripButtonEdit_Click(object sender, EventArgs e)
        {
            toolStripLabel1.Text = "";
            toolStrip1.Enabled   = false;
            dt.Rows.Clear();
            isEdit = true;
            SetButton();

            string key = null;

            //Get key and id
            try {
                key = GlobalUtility.GetKey();
            } catch (Exception ex) {
                MessageBox.Show($"GetKey from BSSDB failed {ex}");
                return;
            }
            string id = GlobalUtility.GetID();

            //parse TWSE and OTC 7-1 html
            if (!await ParseHtml($"http://siis.twse.com.tw/server-java/t150sa10?step=0&id=9200pd{id}&TYPEK=sii&key={key}", true)
                & !await ParseHtml($"http://siis.twse.com.tw/server-java/o_t150sa10?step=0&id=9200pd{id}&TYPEK=otc&key={key}", false))
            {
                return;
            }

            GlobalUtility.LogInfo("Info", GlobalVar.globalParameter.userID + " 下載7-1試算表");
            toolStrip1.Enabled = true;
        }
Beispiel #3
0
        string path;// = "C:\\WarrantDocuments";

        private async void FrmRename_Load(object sender, EventArgs e)
        {
            toolStripLabel1.Text = "";
            toolStrip1.Enabled   = false;

            //Get key and id
            string key = GlobalUtility.GetKey();
            string id  = GlobalUtility.GetID();

            if (!await ParseHtml($"http://siis.twse.com.tw/server-java/t150sa03?step=0&id=9200pd{id}&TYPEK=sii&key={key}", true)
                & !await ParseHtml($"http://siis.twse.com.tw/server-java/o_t150sa03?step=0&id=9200pd{id}&TYPEK=otc&key={key}", false))
            {
                return;
            }

            // Get document path
            DataTable dt = MSSQL.ExecSqlQry("SELECT FLGDAT_FLGDSC FROM EDAISYS.dbo.FLAGDATAS WHERE FLGDAT_FLGNAM = 'DOCUMENT_SETTING' and FLGDAT_FLGVAR='EXPORT_PATH'"
                                            , GlobalVar.loginSet.warrantSysKeySqlConnString);

            path = dt.Rows[0]["FLGDAT_FLGDSC"].ToString().TrimEnd('\\');

            toolStrip1.Enabled = true;
        }