/// <summary> /// 选项绑定 /// </summary> /// <param name="gv">GridView</param> /// <param name="Status_id">Status_id</param> /// <param name="PapersID">PapersID</param> private void PapersOptionsListBind(GridView gv, int Status_id, int PapersID) { BLL.PapersTitleList bll = new BLL.PapersTitleList(); List <Model.PapersTitleList> list = new List <Model.PapersTitleList>(); list = bll.GetList("单选", PapersID, Status_id, false); gv.DataSource = list; gv.DataBind(); }
/// <summary> /// 题目绑定 /// </summary> /// <param name="Type">类型(单选/多选/不定项选/判断)</param> /// <param name="PapersID">试卷ID</param> /// <param name="gv">GridView</param> /// <param name="lb">Label</param> /// <param name="div">HtmlGenericControl</param> private void gvBind(string Type, int PapersID, GridView gv, Label lb, HtmlGenericControl div) { lb.Text = SetNum(Type, PapersID); if (lb.Text != "") { BLL.PapersTitleList bll = new BLL.PapersTitleList(); List <Model.PapersTitleList> list = new List <Model.PapersTitleList>(); list = bll.GetList(Type, PapersID, nbool); gv.DataSource = list; gv.DataBind(); } else { div.Visible = false; } }
/// <summary> /// 获取所有题目 /// </summary> public string GetTitles(int PapersID, int Status_id) { BLL.PapersTitleList bll = new BLL.PapersTitleList(); List <Model.PapersTitleList> list = new List <Model.PapersTitleList>(); StringBuilder strHtml = new StringBuilder(); list = bll.GetList("单选", PapersID, Status_id, false); int i = 0; foreach (Model.PapersTitleList item in list) { i++; strHtml.Append("<div id='tit_" + item.ID + "' class='survey_one'>"); strHtml.Append("<p><span class='order_head'>" + item.Num + "</span>" + item.Title + "</p>"); strHtml.Append("<div class='survey_select'>"); strHtml.Append(GetOptions(PapersID, item.ID)); strHtml.Append("</div></div>"); } //<dib><> return(strHtml.ToString()); }