Esempio n. 1
0
        /// <summary>
        /// 获取题目选项
        /// </summary>
        /// <returns></returns>
        public string GetOptions(int PapersID, int TitleID)
        {
            BLL.PapersOptionsList          bll  = new BLL.PapersOptionsList();
            List <Model.PapersOptionsList> list = new List <Model.PapersOptionsList>();

            list = bll.GetList(TitleID, PapersID, false);
            StringBuilder strHtml = new StringBuilder();
            int           i       = 0;

            foreach (Model.PapersOptionsList item in list)
            {
                i++;
                strHtml.Append("<span class='company_radio'>");

                if (GetselOption(PapersID, TitleID) == int.Parse(item.ID.ToString()))//判断该选项是否选中
                {
                    strHtml.Append("<img id='opt_" + TitleID + "_" + item.ID + "' src='/img/company_true.png' data_checked='1' />");
                }
                else
                {
                    strHtml.Append("<img id='opt_" + TitleID + "_" + item.ID + "' src='/img/company_false.png' data_checked='0' />");
                }


                strHtml.Append("" + item.Name + "</span>");
            }
            return(strHtml.ToString());
        }
Esempio n. 2
0
        /// <summary>
        /// 选项绑定
        /// </summary>
        /// <param name="gv">GridView</param>
        /// <param name="TitleListID">TitleListID</param>
        /// <param name="PapersID">PapersID</param>
        private void PapersOptionsListBind(GridView gv, int TitleListID, int PapersID)
        {
            BLL.PapersOptionsList          bll  = new BLL.PapersOptionsList();
            List <Model.PapersOptionsList> list = new List <Model.PapersOptionsList>();

            list          = bll.GetList(TitleListID, PapersID, nbool);
            gv.DataSource = list;
            gv.DataBind();
        }