private void ShowInfo(int RID) { CHSS.BLL.CRole bll = new CHSS.BLL.CRole(); CHSS.Model.CRole model = bll.GetModel(RID); this.txtRID.Text = model.RID.ToString(); this.txtRoleNumber.Text = model.RoleNumber; this.txtRoleName.Text = model.RoleName; this.txtRoleDescription.Text = model.RoleDescription; RValue = model.RoleValue.ToCharArray(); DataSet ds = new CHSS.BLL.CModule().GetAllList(); MyRepeater.DataSource = ds; MyRepeater.DataBind(); //int recordCount = new CHSS.BLL.CModule().GetRecordCount(""); //for (int i = 0; i < recordCount; i++) //{ // CheckBoxList checkBoxItem = (CheckBoxList)(MainDiv.FindControl("CheckBoxList" + (i + 1).ToString())); // for (int j = 0; j < checkBoxItem.Items.Count; j++) // { // checkBoxItem.Items[j].Selected = RValue[i * 4 + j] == '1' ? true : false; // //if (RValue[i * 4 + j] == '1') // // checkBoxItem.Items[j].Selected = true; // //else // // checkBoxItem.Items[j].Selected = false; // } //} }
protected void Page_Load(object sender, EventArgs e) { // Get the questions for a specific category and add them to the repeater var questionsCateg = Request.QueryString["category"]; MyRepeater.DataSource = GetQuestions(questionsCateg); MyRepeater.DataBind(); // Initialize the counter with number of questions multiplied by time allowed for each question if (counter == null) { counter = secondPerQuestion * GetQuestions(questionsCateg).Count; } }
private void ShowInfo(int RID) { CHSS.BLL.CRole bll = new CHSS.BLL.CRole(); CHSS.Model.CRole model = bll.GetModel(RID); this.txtRID.Text = model.RID.ToString(); this.txtRoleNumber.Text = model.RoleNumber; this.txtRoleName.Text = model.RoleName; this.txtRoleDescription.Text = model.RoleDescription; RValue = model.RoleValue.ToCharArray(); DataSet ds = new CHSS.BLL.CModule().GetAllList(); MyRepeater.DataSource = ds; MyRepeater.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { // Create a connection to the "pubs" database located // on the local computer. var cs = WebConfigurationManager.ConnectionStrings["MyDB"].ConnectionString; SqlConnection myConnection = new SqlConnection(cs); // Connect to the SQL database using a SQL SELECT query to get // all the data from the "Titles" table. SqlDataAdapter myCommand = new SqlDataAdapter("SELECT p.*, c.Name 'Category' FROM Products p JOIN Categories c ON p.CategoryId = c.Id WHERE p.Id <> 2", myConnection); // Create and fill a DataSet. DataSet ds = new DataSet(); myCommand.Fill(ds); // Bind MyRepeater to the DataSet. MyRepeater is the ID of the // Repeater control in the HTML section of the page. MyRepeater.DataSource = ds; MyRepeater.DataBind(); }
protected void Onloadsql() { SQLConnection RetrieveUpdates = new SQLConnection(); SelectQueryBuilder Query = new SelectQueryBuilder(); DataSet ds = new DataSet(); RetrieveUpdates.connection_string = "Server=hq-ict-12580s;Database=dmtreporting_dev;User Id=perfportal;Password=rouser;"; Query.TopRecords = 3; Query.SelectColumns("*"); //Select Statement Query.SelectFromTable("PerfPortal_LatestUpdates"); Query.AddOrderBy("LU_Created", Sorting.Descending); var _statement = Query.BuildQuery(); RetrieveUpdates.Sql = _statement; ds = RetrieveUpdates.GetConnection; MyRepeater.DataSource = ds; MyRepeater.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try //--判断是否具有权限,若无权限回退到上一页 { char[] AuthorityKey = Session["roleValue"].ToString().ToCharArray(); if (AuthorityKey[0] == '0') { Response.Write("<script>alert('无此权限');document.execCommand('stop');window.stop();window.history.back();</script>"); } } catch { Response.Write("<script>alert('无此权限');document.execCommand('stop');window.stop();window.history.back();</script>"); } //--END if (!IsPostBack) { DataSet ds = new CHSS.BLL.CModule().GetAllList(); MyRepeater.DataSource = ds; MyRepeater.DataBind(); } }