private void Form_Input_RC_Client_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (Basic_HTB_Info.cfg.temp_dir != null)
            {
                string html_filename = Basic_HTB_Info.cfg.temp_dir + "\\" + String.Format("{0}_{1}.htm", psi_id, pitem);

                RC_Html_Print h_o = new RC_Html_Print(psi_id, pitem, prcx, conn, html_filename,new RC_S_GR());
                try
                {
                    String url = "ftp://" + Basic_HTB_Info.cfg.DB_HOST + "/" + String.Format("{0}_{1}.htm", psi_id, pitem);
                    MPPNET.MPPFtp.ftp_up_file(url, h_o.html_filename, "sportday", "701100", Encoding.GetEncoding(950));
                }
                catch (Exception ftp_e)
                {
                    MessageBox.Show(ftp_e.Message+":多於一個用戶登入;");
                }
                Form_RC_OUT_RESULT out_r = new Form_RC_OUT_RESULT(h_o.html_filename);
                out_r.MdiParent = this.MdiParent;
                out_r.Show();
                
            }
            
            if (conn != null)
            {
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                    conn.Dispose();
                }
            }
        }
Example #2
0
        private void DownXls_S_ITEM_NAME(String extra_filename)
        {

            FolderBrowserDialog fbd = new FolderBrowserDialog();
            fbd.SelectedPath = Basic_HTB_Info.cfg.TempdataKey("path1");
            if (fbd.ShowDialog() == DialogResult.OK)
            {
                Basic_HTB_Info.cfg.tempdata["path1"] = fbd.SelectedPath;
                MPPFORM.ListBoxForm lbf = new MPPFORM.ListBoxForm();
                using (OdbcConnection conn = new OdbcConnection(Basic_HTB_Info.Conn_Str))
                {
                    conn.Open();
                    OdbcDataReader dr = new OdbcCommand("select si_id,s_item,rcx from sport_item;", conn).ExecuteReader();
                    while (dr.Read())
                    {
                        if (dr[1].ToString().Contains("跳") || dr[1].ToString().Contains("球")) continue;
                        lbf.lb.Items.Add(String.Format("{0}:{1}:{2}", dr[0], dr[1], dr[2]));
                    }
                    if (lbf.ShowDialog() == DialogResult.OK)
                    {
                        foreach (string s in lbf.lb.CheckedItems)
                        {
                            string[] s_ar = s.Split(':');
                            string si_id = s_ar[0];
                            string item = s_ar[1];
                            string rcx = s_ar[2];
                            string f_name = String.Format("{0}\\{1}.{2}", fbd.SelectedPath, item,extra_filename);
                            RC_Html_Print rc_html_p = new RC_Html_Print(si_id, item, rcx, conn, f_name,new RC_S_GR());
                        }
                    }
                    conn.Close();
                }
            }
        }
Example #3
0
        private void btn_Print_RC_HTML_FORM_CLICK(object sender, EventArgs e)
        {
            string html_filename = Basic_HTB_Info.baseFilePath + "\\temp\\" + String.Format("{0}_{1}.htm", sport_id, sport_item);

            RC_Html_Print h_o = new RC_Html_Print(sport_id, sport_item, sport_rcx, conn, html_filename,new RC_S_GR());
            Form_RC_OUT_RESULT out_r = new Form_RC_OUT_RESULT(h_o.html_filename);          
            out_r.MdiParent = this.MdiParent;
            out_r.Show();
              FileInfo info = new FileInfo(html_filename);
              if (info.Exists)
              {
                  if(MessageBox.Show("是否公布名單?","",MessageBoxButtons.YesNo)==DialogResult.Yes)
                  {
                      info.CopyTo(Basic_HTB_Info.cfg.report_to_public + string.Format("\\{0}名單.htm", sport_item), true);
                      String tempfilename = Basic_HTB_Info.cfg.report_to_public + string.Format("\\{0}名單.xls", sport_item);
                      RC_Html_Print rc_html_p = new RC_Html_Print(sport_id, sport_item, sport_rcx, conn, tempfilename, new RC_S_GR());
                  }
              }
        }