コード例 #1
0
ファイル: MainForm.cs プロジェクト: eddylin2015/sportday
 private void DownXls_F_ITEM_Result(String extra_filename)
 {
     FolderBrowserDialog fbd = new FolderBrowserDialog();
     fbd.SelectedPath = Basic_HTB_Info.cfg.TempdataKey("path2");
     if (fbd.ShowDialog() == DialogResult.OK)
     {
         Basic_HTB_Info.cfg.tempdata["path2"] = 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 fi_id,f_item,rcx from field_item;", conn).ExecuteReader();
             while (dr.Read())
             {
                 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];
                     if (item.Contains("跳高"))
                     {
                         string f_name = String.Format("{0}\\{1}.{2}", fbd.SelectedPath, item, extra_filename);
                         FieldJH_Html_Output rc_html_p = new FieldJH_Html_Output(si_id, item, rcx, conn, f_name,new RC_F_GR(),false);
                     }
                     else
                     {
                         string f_name = String.Format("{0}\\{1}.{2}", fbd.SelectedPath, item, extra_filename);
                         Field_Html_Output rc_html_p = new Field_Html_Output(si_id, item, rcx, conn, f_name,new RC_F_GR(),false);
                     }
                 }
             }
             conn.Close();
         }
     }
 }
コード例 #2
0
        private String tempOutput()
        {
            string html_filename = Basic_HTB_Info.baseFilePath + "\\temp\\" + String.Format("{0}_{1}.htm", psi_id, pitem);
             html_blankformat_filename = Basic_HTB_Info.baseFilePath + "\\temp\\" + String.Format("{0}_{1}.htmblank", psi_id, pitem);
            Field_Html_Output h_o = null;
            Field_Html_Output h_o_xls = null;
            if (prcx == "RCFJH")
            {
                h_o = new FieldJH_Html_Output(psi_id, pitem, prcx, conn, html_filename,new RC_F_GR(),false);
                h_o_xls = new FieldJH_Html_Output(psi_id, pitem, prcx, conn, html_filename.Replace(".htm",".xls"), new RC_F_GR(), false);
                h_o = new FieldJH_Html_Output(psi_id, pitem, prcx, conn, html_blankformat_filename, new RC_F_GR(), true);
            }
            else
            {
                h_o = new Field_Html_Output(psi_id, pitem, prcx, conn, html_filename,new RC_F_GR(),false);
                h_o_xls = new Field_Html_Output(psi_id, pitem, prcx, conn, html_filename.Replace(".htm",".xls"), new RC_F_GR(), false);
                h_o = new Field_Html_Output(psi_id, pitem, prcx, conn, html_blankformat_filename, new RC_F_GR(),true);
            }
            return html_filename;


        }