Exemple #1
0
        private void btn_cidsearch_Click(object sender, EventArgs e)
        {
            label_avg.Text = "";
            label_min.Text = "";
            label_num.Text = "";
            label_max.Text = "";
            string cid = cbox_cid.Text.Trim();

            if (cid == "")
            {
                this.info_data.DataSource = Ad_ChooseManage.Query("select * from choices where cid in (select cid from costea where tid = '" + tid + "')").Tables["choices"];
            }
            else
            {
                this.info_data.DataSource = Ad_ChooseManage.Query("select * from choices where cid = '" + cid + "' and '" + cid + "' in ( select cid from costea where tid = '" + tid + "')").Tables["choices"];
                if (this.info_data.RowCount == 0)
                {
                    label_avg.Text = "0";
                    label_min.Text = "0";
                    label_num.Text = "0";
                    label_max.Text = "0";
                }
                statistics_1(cid);
            }
        }
        public Ad_AddRecord(Ad_ChooseManage parent)
        {
            InitializeComponent();
            pform = parent;

            string sql1 = "select distinct cterm from choices";

            if (Ad_ChooseManage.ExecuteSql(sql1) != 0)
            {
                this.cbox_term.DataSource = Ad_ChooseManage.Query(sql1).Tables["choices"];
                cbox_term.DisplayMember   = "cterm";
            }
        }
Exemple #3
0
        private void btn_sidsearch_Click(object sender, EventArgs e)
        {
            label_avg.Text = "";
            label_min.Text = "";
            label_num.Text = "";
            label_max.Text = "";
            string sid = tbox_sid.Text.Trim();

            if (sid == "")
            {
                this.info_data.DataSource = Ad_ChooseManage.Query("select * from choices where cid in ( select cid from costea where tid = '" + tid + "')").Tables["choices"];
            }
            else
            {
                this.info_data.DataSource = Ad_ChooseManage.Query("select * from choices where sid = '" + sid + "' and cid in ( select cid from costea where tid = '" + tid + "')").Tables["choices"];
            }
        }
        public Ad_UpdateRecord(Ad_ChooseManage parent, string sid, string cid, string cterm, string csore, string istrue)
        {
            InitializeComponent();
            pform            = parent;
            tbox_sid.Text    = sid;
            tbox_cid.Text    = cid;
            cbox_term.Text   = cterm;
            tbox_score.Text  = csore;
            cbox_repeat.Text = istrue;
            oldsid           = sid;
            oldcid           = cid;

            string sql1 = "select distinct cterm from choices";

            if (Ad_ChooseManage.ExecuteSql(sql1) != 0)
            {
                this.cbox_term.DataSource = Ad_ChooseManage.Query(sql1).Tables["choices"];
                cbox_term.DisplayMember   = "cterm";
            }
        }
Exemple #5
0
        public Stu_Search(LoginIn_Stu parent, string id)
        {
            InitializeComponent();
            pform = parent;
            sid   = id;
            string sql = "select distinct cid from choices where sid = '" + sid + "'";


            if (Ad_ChooseManage.ExecuteSql(sql) != 0)
            {
                this.cbox_cid.DataSource = Ad_ChooseManage.Query(sql).Tables["choices"];
                cbox_cid.DisplayMember   = "cid";
            }

            string sql1 = "select distinct cterm from choices where sid = '" + sid + "'";


            if (Ad_ChooseManage.ExecuteSql(sql1) != 0)
            {
                this.cbox_term.DataSource = Ad_ChooseManage.Query(sql1).Tables["choices"];
                cbox_term.DisplayMember   = "cterm";
            }
        }