Пример #1
0
 private void menu_Upgrade_RC(Object sender, EventArgs e)
 {
     MPPFORM.ListBoxFilterForm lbf = new MPPFORM.ListBoxFilterForm();
     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 order by si_id ", 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]));
         }
         conn.Close();
     }
     if (lbf.ShowDialog() == DialogResult.OK)
     {
         string[] s_ar = lbf.lb.SelectedItem.ToString().Split(':');
         string si_id=s_ar[0];
         string item=s_ar[1];
         string rcx = s_ar[2];
         SportDayLib.Form_Input_RC f_RC = new Form_Input_RC(si_id, item,rcx,new Form_Input_RC_ACT_ForAdmin());
         f_RC.MdiParent = this;
         f_RC.Show();
     }
 }
Пример #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            int temp_int;
            if (!int.TryParse(button6.Text,out temp_int)) return; 
            MPPFORM.ListBoxFilterForm lbf = new MPPFORM.ListBoxFilterForm();
            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 where si_id= "+button6.Text, 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]));
                }
                conn.Close();
            }
            if (lbf.ShowDialog() == DialogResult.OK)
            {
                string[] s_ar = lbf.lb.SelectedItem.ToString().Split(':');
                string si_id = s_ar[0];
                string item = s_ar[1];
                string rcx = s_ar[2];
                SportDayLib.Form_Input_RC f_RC = new Form_Input_RC(si_id, item, rcx, new Form_Input_RC_ACT_ForAdmin());
                f_RC.MdiParent = Basic_HTB_Info.cfg.MDIparent;
                f_RC.Show();
            }

        }