private void Bind() { List <M_Exam_Type> dt = bqt.SelectAll(); if (dt != null && dt.Count > 0) { ddType.Items.Clear(); foreach (M_Exam_Type item in dt) { ListItem li = new ListItem(); li.Text = item.t_name; li.Value = item.t_id.ToString(); ddType.Items.Add(li); } } }
/// <summary> /// 绑定题型 /// </summary> private void BindType() { B_Exam_Type bqt = new B_Exam_Type(); List <M_Exam_Type> mqts = bqt.SelectAll(); if (mqts != null && mqts.Count > 0) { this.ddlType.Items.Clear(); for (int i = 0; i < mqts.Count; i++) { if (mqts[i].t_type == 1 || mqts[i].t_type == 2 || mqts[i].t_type == 3) { ListItem li = new ListItem(); li.Text = mqts[i].t_name; li.Value = mqts[i].t_id.ToString(); ddlType.Items.Add(li); } } } }