private void button2_Click(object sender, EventArgs e)
        {
            string ds_n = "0";

            using (OdbcCommand cmd = new OdbcCommand(string.Format("select ds_n from field_item where fi_id={0}", psi_id), conn))
            {
                OdbcDataReader dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    ds_n = dr.GetString(0);
                }
            }


            String tempfilename=tempOutput();
            Form_RC_OUT_RESULT out_r = new Form_RC_OUT_RESULT(tempfilename);
            out_r.MdiParent = this.MdiParent;
            out_r.Show();
            FileInfo info = new FileInfo(tempfilename);
            FileInfo info_xls = new FileInfo(tempfilename.Replace(".htm",".xls"));
            if (info.Exists)
            {
                if (MessageBox.Show("是否公布名單?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    /////////////////
                    using (OdbcCommand cmd = new OdbcCommand(string.Format("update field_item set lock_item=1 where fi_id={0}", psi_id), conn))
                    {
                        
                        info.CopyTo(Basic_HTB_Info.cfg.report_to_public + string.Format("\\{0}賽果.htm", pitem), true);
                        if (info_xls.Exists)
                        {
                            info_xls.CopyTo(Basic_HTB_Info.cfg.report_to_public + string.Format("\\{0}賽果.xls", pitem), true);
                        }
                        if (html_blankformat_filename != null)
                        {
                            FileInfo info_blnak = new FileInfo(html_blankformat_filename);
                            info_blnak.CopyTo(Basic_HTB_Info.cfg.blanktable_to_public + string.Format("\\{0}.dat", pitem), true);
                        }
                        else
                        {
                            MessageBox.Show("檔案不存在");
                        }

                        ////////////////
                      
                            try
                            {
                                MessageBox.Show(
                                   WebPost.postfile(ds_n, pitem, Basic_HTB_Info.cfg.report_to_public + string.Format("\\{0}賽果.htm", pitem)));
                            }
                            catch (Exception ex) { }
                      

                        MessageBox.Show(String.Format("{0}加鎖 更新{1}筆!", pitem, cmd.ExecuteNonQuery()));
                    }
                    ///////////////////

                   
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string html_filename = Basic_HTB_Info.baseFilePath + "\\temp\\" + String.Format("{0}_{1}.htm", psi_id, pitem);
            Field_Html_Print h_o = null;
            Field_Html_Print h_o_xls = null;
            if (prcx == "RCFJH") 
            {
                h_o = new FieldJH_Html_Print(psi_id, pitem, prcx, conn, html_filename,new RC_F_GR(),false);
                h_o_xls = new FieldJH_Html_Print(psi_id, pitem, prcx, conn, html_filename.Replace(".htm",".xls"), new RC_F_GR(), false);
            }
            else
            {
                h_o=new Field_Html_Print(psi_id, pitem, prcx, conn, html_filename,new RC_F_GR(),false);
                h_o_xls = new Field_Html_Print(psi_id, pitem, prcx, conn, html_filename.Replace(".htm",".xls"), new RC_F_GR(), false);
            }
            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);
            FileInfo info_xls = new FileInfo(html_filename.Replace(".htm",".xls"));
            if (info.Exists)
            {
                if (MessageBox.Show("是否公布名單?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    info.CopyTo(Basic_HTB_Info.cfg.report_to_public + string.Format("\\{0}名單.htm", pitem), true);
                    info_xls.CopyTo(Basic_HTB_Info.cfg.report_to_public + string.Format("\\{0}名單.xls", pitem), true);
                }
                // MessageBox.Show("檔案CopyTo Temp");
            }

        }
        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 #4
0
 private void btn_RC_Html_Output_Click(object sender, EventArgs e)
 {
     RC_Html_Output h_o_xls = new RC_Html_Output(sport_id, sport_item, sport_rcx, conn, temp_Out_Html_filename.Replace(".htm",".xls"), new RC_S_GR());
     
     RC_Html_Output h_o = new RC_Html_Output(sport_id, sport_item, sport_rcx, conn, temp_Out_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();
     RC_Html_Output_BlankTable h_o_blanktable = new RC_Html_Output_BlankTable(sport_id, sport_item, sport_rcx, conn, temp_Out_Html_filename, new RC_S_GR());
 }
Example #5
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());
                  }
              }
        }
Example #6
0
 /// <summary>
 /// 輸出賽果,并輸出進級名單(Porm_Names_List)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn_RC_Prom_Html_Output_Click(object sender, EventArgs e)
 {
     MPPFORM.ListBoxFilterForm lbf = new MPPFORM.ListBoxFilterForm();
     string title_item = sport_item.Split('(')[0];
     MessageBox.Show(title_item);
     using (OdbcDataReader dr = new OdbcCommand(String.Format("select si_id,s_item,rcx from sport_item where s_item like '{0}%' and lock_item is null ;", title_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 && lbf.lb.SelectedIndex>-1)
     {
         string[] s_ar=lbf.lb.SelectedItem.ToString().Split(':');
         if(s_ar.Length==3)
         {
             RC_Prom_Html_Output rp_o_xls = new RC_Prom_Html_Output(this.sport_id, this.sport_item, this.sport_rcx, s_ar[0], s_ar[1], s_ar[2], conn, out Porm_Names_List, temp_Out_Html_filename.Replace(".htm",".xls"), new RC_S_GR());
             RC_Prom_Html_Output rp_o = new RC_Prom_Html_Output(this.sport_id, this.sport_item, this.sport_rcx, s_ar[0], s_ar[1], s_ar[2], conn, out Porm_Names_List, temp_Out_Html_filename,new RC_S_GR());
             Form_RC_OUT_RESULT out_r = new Form_RC_OUT_RESULT(rp_o.html_filename);
             out_r.MdiParent = this.MdiParent;
             out_r.Show();
         }
     }
 }