private void gv01_Bind() { BLL.TitleList bll = new BLL.TitleList(); List <Model.TitleList> list = new List <Model.TitleList>(); if (ViewState["PageCount"] == null) { ViewState["PageCount"] = 1; } if (rbl_Extent.SelectedValue.ToString() == "") { list = bll.GetList(Convert.ToInt32(ViewState["PageCount"]), PageSize, Request.QueryString["TitleType"], int.Parse(Request.QueryString["CourseID"])); } else { list = bll.GetList(Convert.ToInt32(ViewState["PageCount"]), PageSize, Request.QueryString["TitleType"], int.Parse(Request.QueryString["CourseID"]), rbl_Extent.SelectedValue.ToString()); } gv01.DataSource = list; gv01.DataBind(); if (list.Count > 0) { Total = list[0].RowTotal; labAlert.Visible = false; } else { labAlert.Visible = true; labAlert.Text = "没有任何资料!"; } PageCount(); Page_Status(); }
/// <summary> /// 添加到数据库 /// </summary> /// <param name="Type">类型</param> /// <param name="Count">条数</param> /// <param name="Score">每条分值</param> private void InsertDB(string Type, int Count, int Score) { string Extent = rbl_Extent.SelectedValue.ToString(); BLL.TitleList bll = new BLL.TitleList(); List <Model.TitleList> list = new List <Model.TitleList>(); list = bll.GetList(Type, int.Parse(lb_CourseID.Text), Count, Extent); if (PapersID > 0) { //Common.Function.Alert("啥也不做"); } else { //Common.Function.Alert("添加"); Papers(); } for (int i = 0; i < list.Count; i++) { Model.TitleList model = new Model.TitleList(); model.Title = list[i].Title; model.T_F = list[i].T_F; model.Analysis = list[i].Analysis; model.ID = list[i].ID; model.CourseID = list[i].CourseID; AddPapersTitleList(Type, PapersID, Score, model); } }
protected void LinkButton5_Click(object sender, EventArgs e) { if (gv_05.Rows.Count > 0) { } else { BLL.TitleList bll = new BLL.TitleList(); List <Model.TitleList> list = new List <Model.TitleList>(); //if (rbl_Extent.SelectedValue.ToString() == "") //{ list = bll.GetList("值选项", int.Parse(lb_CourseID.Text)); //} //else //{ // list = bll.GetList("值选项", CourseID, rbl_Extent.SelectedValue.ToString()); //} gv_05.DataSource = list; gv_05.DataBind(); } MultiView1.ActiveViewIndex = 4; TabTitle1.Attributes.Add("class", "menu_title"); TabTitle2.Attributes.Add("class", "menu_title"); TabTitle3.Attributes.Add("class", "menu_title"); TabTitle4.Attributes.Add("class", "menu_title"); TabTitle5.Attributes.Add("class", "menu_title_on"); }
private void gvBind() { BLL.TitleList bll = new BLL.TitleList(); List <Model.TitleList> list = new List <Model.TitleList>(); list = bll.GetList("单选", int.Parse(lb_CourseID.Text)); gv_01.DataSource = list; gv_01.DataBind(); }
/// <summary> /// 获取题目列表 /// </summary> /// <param name="context"></param> private void GetTitleList(HttpContext context) { int status_id = int.Parse(context.Request["status_id"].ToString()); //类别ID int CourseID = int.Parse(context.Request["CourseID"].ToString()); //课程ID BLL.TitleList bll = new BLL.TitleList(); DataTable dt = bll.GetList("单选", CourseID, status_id); string json = Common.Function.ToJson(dt); context.Response.Write(json); return; }
//add by wangke 2016-11-23 题目类别 protected void ddlProperty_SelectedIndexChanged(object sender, EventArgs e) { gv_01.DataSource = null; gv_01.DataBind(); int status_id = int.Parse(ddl_category.SelectedValue.ToString()); BLL.TitleList bll = new BLL.TitleList(); DataTable dt = bll.GetList("单选", int.Parse(lb_CourseID.Text), status_id); gv_01.DataSource = dt; gv_01.DataBind(); }