Пример #1
0
        public Form_Input_RC(string si_id, string item, string rcx, iForm_Input_RC_ACT Act)
            : base()
        {
            InitializeComponent();
            iAct = Act;
            this.Text = String.Format("{0}:{1}",si_id,item);
            sport_item = item;
            sport_id = si_id;
            sport_rcx = rcx;
            temp_Out_Html_filename = Basic_HTB_Info.cfg.output_result_html + "\\" + String.Format("{0}_{1}.htm", sport_id, sport_item);
            conn = new OdbcConnection(Basic_HTB_Info.Conn_Str);
            conn.Open();
            this.lbl_GR.Text = iAct.Get_GR_STR(si_id, conn);
            if (!Basic_HTB_Info.signflag_sql.Contains(rcx)) throw new Exception(rcx);
            feildnames = Basic_HTB_Info.signflag_sql[rcx].ToString();
            c_feildnames = Basic_HTB_Info.Get_Signflag_s(rcx);
            Basic_HTB_Info.Adjust_FieldName(ref feildnames,ref c_feildnames,ref col_span);
            string[] s_ar = c_feildnames.Split(',');
            int col_cnt = s_ar.Length;
            int row_cnt = iAct.Get_Item_Cnt(si_id, conn) + 1;
 
            this.tablePanel.ColumnCount = col_cnt;
            this.tablePanel.RowCount = row_cnt;
            iAct.Set_TablePanelStyle(tablePanel);
            iAct.Set_TablePanelColumnHead(tablePanel, s_ar);
            iAct.Set_TablePanel_TextBox_ForData(tablePanel, feildnames, si_id, conn);
            foreach (Control c in tablePanel.Controls)
            {
                if (c.Name.Contains("rank") || c.Name.Contains("rc") || c.Name.Contains("grk") || c.Name.Contains("note"))
                {
                    TextBox tb = (TextBox)c; tb.TextChanged += new EventHandler(tb_TextChanged); tb.KeyUp += new KeyEventHandler(tb_KeyUp);
                }
            }
        }
        public Form_Input_Field_RC_Admin(string si_id, string item, string rcx, iForm_Input_RC_ACT Act)
            : base()
        {
            InitializeComponent();
            psi_id = si_id;
            pitem = item;
            prcx = rcx;

            this.Text = String.Format("{0}:{1}:{2}", si_id, item,rcx);
            conn = new OdbcConnection(Basic_HTB_Info.Conn_Str);
            conn.Open();
            iAct = Act;
            this.lbl_GR.Text = iAct.Get_GR_STR(si_id, conn);
            string feildnames = null;
            string c_feildnames=null;
            if (pitem.Contains("跳高"))
            {
                feildnames = "frc_id,rcx,rank,s_number,number,classno,name,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13,h14,h15,h16,rc,note";
                c_feildnames="名次,次序,比賽號,姓名,班級,";
                c_feildnames += "h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13,h14,h15,h16,";
                c_feildnames+="成績,備註";
            }
            else
            {
                feildnames = "frc_id,rcx,rank,s_number,number,classno,name,h1,h2,h3,b3,h4,h5,b5,h6,rc,note";
                c_feildnames="名\n次,次\n序,比賽\n號,姓名,班級,一,二,三,B3,四,五,B5,六,成績,備註";
            }
            string[] s_ar = c_feildnames.Split(',');
            int col_cnt = s_ar.Length;
            int row_cnt = iAct.Get_Item_Cnt(si_id, conn) + 1;
            this.tablePanel.ColumnCount = col_cnt;
            this.tablePanel.RowCount = row_cnt;
            iAct.Set_TablePanelStyle(tablePanel);
            iAct.Set_TablePanelColumnHead(tablePanel, s_ar);
            iAct.Set_TablePanel_TextBox_ForData(tablePanel, feildnames, si_id,conn);
            foreach (Control c in tablePanel.Controls)
            {
                if (iAct.Editable_Control(c))
                {
                    TextBox tb = (TextBox)c;
                    tb.TextChanged += new EventHandler(tb_TextChanged);
                    tb.KeyUp += new KeyEventHandler(tb_KeyUp);
                }
            }
        }
Пример #3
0
        public Form_Input_RC_Client(string si_id,string item,string rcx,iForm_Input_RC_ACT Act):base()
        {
            InitializeComponent();
            psi_id = si_id;
            pitem = item;
            prcx = rcx;

            this.Text = String.Format("{0}:{1}", si_id, item);
            conn = new OdbcConnection(Basic_HTB_Info.Conn_Str);
            conn.Open();
            iAct = Act;
            this.lbl_GR.Text = iAct.Get_GR_STR(si_id, conn);
     
            if (!Basic_HTB_Info.signflag_sql.Contains(rcx)) throw new Exception(rcx);
            
            string feildnames = Basic_HTB_Info.signflag_sql[rcx].ToString();
            string c_feildnames = Basic_HTB_Info.Get_Signflag_s(rcx);

            string span_sr=null;
            Basic_HTB_Info.Adjust_FieldName(ref feildnames, ref c_feildnames,ref span_sr);

            string[] s_ar = c_feildnames.Split(',');
            
            int col_cnt = s_ar.Length;
            int row_cnt = iAct.Get_Item_Cnt(si_id, conn) + 1;
            this.tablePanel.ColumnCount = col_cnt;
            this.tablePanel.RowCount = row_cnt;
            iAct.Set_TablePanelStyle(tablePanel);
            iAct.Set_TablePanelColumnHead(tablePanel, s_ar);
            iAct.Set_TablePanel_TextBox_ForData(tablePanel, feildnames, si_id,conn);

            foreach (Control c in tablePanel.Controls)
            {
                if (iAct.Editable_Control(c))
                {
                    TextBox tb = (TextBox)c;
                    tb.TextChanged += new EventHandler(tb_TextChanged);
                    tb.KeyUp += new KeyEventHandler(tb_KeyUp);
                }

            }
        }