protected void lbRole_Fill(string qrSobese) { sdsAuthorization.ConnectionString = DBconnection.connection.ConnectionString.ToString(); sdsAuthorization.SelectCommand = qrSobese; sdsAuthorization.DataSourceMode = SqlDataSourceMode.DataReader; ListBox1.DataSource = sdsAuthorization; ListBox1.DataTextField = "Доступ"; ListBox1.DataValueField = "ID_Role"; ListBox1.DataBind(); }
protected void Button3_Click(object sender, EventArgs e) { for (Int16 nume = 0; nume < listnombres.Count; nume++) { MessageBox.Show(listnombres[nume].ToString()); } ListBox1.DataSource = listnombres; //vuelca el arraylist directamente a la listbox ListBox1.DataBind(); //necesario para que haga efectiva la operación de volcado }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ListBox1.DataSource = ktg.list(Convert.ToInt32(0)); ListBox1.DataTextField = "kategoriAdi"; ListBox1.DataValueField = "kategoriId"; ListBox1.DataBind(); } }
protected void ConfigureHeaderTemplates() { ListBox1.HeaderTemplate = new HeaderTemplate("CUSTOMERS"); ListBox2.HeaderTemplate = new HeaderTemplate((ListBox1.SelectedText != String.Empty ? ListBox1.SelectedText : "")); ListBox3.HeaderTemplate = new HeaderTemplate((ListBox2.SelectedText != String.Empty ? "Order #" + ListBox2.SelectedText : "")); ListBox1.DataBind(); ListBox2.DataBind(); ListBox3.DataBind(); }
protected void lbRole_Fill(string qrSobese) { sdsZakaz.ConnectionString = DBconnection.connection.ConnectionString.ToString(); sdsZakaz.SelectCommand = qrSobese; sdsZakaz.DataSourceMode = SqlDataSourceMode.DataReader; ListBox1.DataSource = sdsZakaz; //ListBox1.DataTextField = "Логин"; ListBox1.DataValueField = "FIO"; ListBox1.DataBind(); }
private void CargarUsuarios() { DataSet ds = new DataSet(); ds = logica.CargarUsuarios(); ListBox1.DataSource = ds.Tables[0]; ListBox1.DataTextField = ds.Tables[0].Columns["Usuario"].ColumnName.ToString(); ListBox1.DataValueField = ds.Tables[0].Columns["ID"].ColumnName.ToString(); ListBox1.DataBind(); }
protected void Button3_Click(object sender, EventArgs e) { objprp.Empno = Convert.ToInt32(TextBox1.Text); objprp.Empname = TextBox2.Text; objprp.Empad = TextBox3.Text; objprp.Empsal = Convert.ToInt32(TextBox4.Text); obj.update_rec(objprp); ListBox1.DataBind(); clear_rec(); }
protected void ListBox1_Load_Data() { FreightEasy.DataManager.FreightEasyData FEData = new FreightEasy.DataManager.FreightEasyData(); FEData.AddToDataSet("SetupSteps", "select * from setup_master order by seq_id"); DataTable tmpDt = FEData.Tables["SetupSteps"]; ListBox1.DataSource = tmpDt; ListBox1.DataTextField = tmpDt.Columns["title"].ToString(); ListBox1.DataValueField = tmpDt.Columns["page_id"].ToString(); ListBox1.DataBind(); }
private void BindNoGroupList() { QueryParam qp = new QueryParam(); int RecordCount = 0; qp.Where = " WHERE 1=1 AND U_SGroupID=0"; ArrayList lst = BusinessFacade.sys_UserList(qp, out RecordCount); ListBox1.DataSource = lst; ListBox1.DataBind(); }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { string Dutyid = DropDownList1.SelectedItem.Value.ToString(); string sql = "select Name,username from Employee where dutyid=" + Dutyid + ""; ListBox1.DataSource = OperateDB.ExecuteDataSet(sql); ListBox1.DataTextField = "Name"; ListBox1.DataValueField = "username"; ListBox1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Labelbanji.Text = BanjiInfo.GetBanjiName(int.Parse(Request.QueryString["banjiid"])); Labelzuoyename.Text = ZuoyeInfo.getZuoyeName(int.Parse(Request.QueryString["zuoyeid"])); DataTable studt = BanjiInfo.GetStudentNameAndUsername(int.Parse(Request.QueryString["banjiid"])); ListBox1.DataSource = studt; ListBox1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ListBox1.DataBind(); if (Manager.ContentProvider != null) { TextBox1.Text = Manager.ContentProvider.Get(); } } }
protected void Button1_Click(object sender, EventArgs e) { // get the old messages list var messages = (List <string>)ViewState["Messages"]; messages.Add(text1.Text); ListBox1.DataSource = messages; ListBox1.DataBind(); // store the new messages list ViewState["Messages"] = messages; }
public void show_data() { SqlDataAdapter adp = new SqlDataAdapter("select cityid,cityname from tbcity", ConfigurationManager.ConnectionStrings["demo"].ConnectionString); DataSet ds = new DataSet(); adp.Fill(ds); ListBox1.DataTextField = "cityname"; ListBox1.DataValueField = "cityid"; ListBox1.DataSource = ds; ListBox1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { ListaBitacora = GestorBitacora.ListarBitacora(); GridView1.DataSource = null; GridView1.DataSource = ListaBitacora; GridView1.DataBind(); ListBox1.DataSource = null; ListBox1.DataSource = ListaBitacora; ListBox1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { TextBox4.Text = Config.SeparationCharacter.ToString(); ListBox1.DataSource = ControllerManager.PriceImport.GetAll(); ListBox1.DataTextField = "ID"; ListBox1.DataValueField = "ID"; ListBox1.DataBind(); } }
protected void btnSearch_Click(object sender, EventArgs e) { String searchBy = dropDownSearch.SelectedValue.ToString(); String filterBy = txtBoxFilterBy.Text.ToString(); WorkflowsService wfservice = new WorkflowsService(); List <EmployeeSearchDTO> employeesearchDtos = wfservice.SearchEmployee(searchBy, filterBy); ListBox1.DataSource = employeesearchDtos; ListBox1.DataTextField = "id"; ListBox1.DataValueField = "name"; ListBox1.DataBind(); }
private void LoadRecords() { var cn = new SqlConnection(ConfigurationManager.ConnectionStrings["InterviewToolContext"].ConnectionString); cn.Open(); var cm = new SqlCommand("Select * from Fachgebiet", cn); ListBox1.DataSource = cm.ExecuteReader(); ListBox1.DataTextField = "Name"; ListBox1.DataValueField = "Id"; ListBox1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { lblname.Text = Session["name"].ToString(); odt = oadapter.selectonlineuser(Session["name"].ToString()); ListBox1.DataSource = odt; ListBox1.DataTextField = "Name"; ListBox1.DataValueField = "O_ID"; ListBox1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { ListBox1.SelectionMode = ListBox2.SelectionMode = ListSelectionMode.Multiple; if (!IsPostBack) { ListBox1.DataSource = carList; ListBox1.DataTextField = "Price"; ListBox1.DataValueField = "Price"; ListBox1.DataTextFormatString = "Price: {0:C}"; ListBox1.DataBind(); } }
protected void Timer1_Tick1(object sender, EventArgs e) { Label4.Text = "Numero de alumnos: " + Convert.ToString(Application.Contents["numAlumnos"]) + ", Numero de profesores: " + Convert.ToString(Application.Contents["numProfesores"]); ListBox1.Items.Clear(); ListBox1.DataSource = Application.Contents["alumnos"]; ListBox1.DataBind(); ListBox2.Items.Clear(); ListBox2.DataSource = Application.Contents["profesores"]; ListBox2.DataBind(); }
protected void Button2_Click(object sender, EventArgs e) { DataSet bulunanlar = DBIslemleri.YazarARAID(DropDownList1.SelectedValue); GridView1.DataSource = bulunanlar.Tables[0]; GridView1.DataBind(); DataSet Kitaplar = DBIslemleri.YazarIDAra(DropDownList1.SelectedValue); ListBox1.DataSource = Kitaplar; ListBox1.DataTextField = "Adi"; ListBox1.DataValueField = "KitapID"; ListBox1.DataBind(); }
protected void btnClear_click(Object sender, EventArgs e) { clsStaffCollection staff = new clsStaffCollection(); filterBox.Text = ""; ListBox1.DataSource = staff.StaffList; ListBox1.DataValueField = "EmployeeNo"; ListBox1.DataTextField = "first_name"; ListBox1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["mid"] == null || Int32.Parse(Session["mid"].ToString()) == 0) { Response.Redirect("~/Home.aspx"); } if (!Page.IsPostBack) { string uname = HttpContext.Current.User.Identity.Name.ToString(); AdminBLL.InRole(uname, "M200", "M212"); ListBox1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { List <String> names = new List <String>(); foreach (String key in Storage.jobs.Keys) { names.Add(key); } ListBox1.DataSource = names; ListBox1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { Page.Response.Write(Page.FindControl("Button1").ClientID + "<br />"); Recursion(Page); Page.Response.Write(Button1.EnableViewState + "<br />"); Page.Response.Write(Page.FindControl("Label1").Parent + "<br />"); //Button1.Visible = false; List <string> myList = new List <string>(); myList.Add("naynish"); myList.Add("tripti"); ListBox1.DataSource = myList; ListBox1.DataBind(); }
private void GetSelectedcourses(int uid) { da = new SqlDataAdapter("select scid,cname from tbl_scourses where uid=" + uid + " ", con); ds = new DataSet(); da.Fill(ds, "tbl_sc"); if (ds.Tables.Count > 0 && ds.Tables["tbl_sc"].Rows.Count > 0) { ListBox1.DataSource = ds.Tables[0].DefaultView; ListBox1.DataTextField = "cname"; ListBox1.DataValueField = "scid"; ListBox1.DataBind(); } }
protected void emptyList(object sender, EventArgs e) { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True"); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = "Update [User] set Require_Contact='false' where Require_Contact='true'"; cmd.ExecuteNonQuery(); con.Close(); ListBox1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!(Page.IsPostBack)) { CanteenService.IitemServiceClient item = new CanteenService.IitemServiceClient("BasicHttpBinding_IitemService"); DataSet li = item.GetItem(); ListBox1.DataSource = li.Tables[0].DefaultView; ListBox1.DataTextField = "Name"; ListBox1.DataValueField = "price"; ListBox1.DataBind(); disp_data(); } }
protected void Button3_Click(object sender, EventArgs e)//删除一个班 { //删除原则:教师自己建的班可以删,不能删除别的教师建的班 //只能删除没有学生,也没有指定任课的班 if (ListBox1.SelectedIndex >= 0) { bool xuesheng = false; //是否有学生 bool renke = false; //是否有任课信息 string banjiid = ListBox1.SelectedValue.Trim(); string banjiname = ListBox1.SelectedItem.Text.Trim(); SqlConnection conn = new SqlConnection(); conn.ConnectionString = ConfigurationManager.ConnectionStrings["kecheng2012ConnectionString"].ConnectionString; SqlCommand comm = conn.CreateCommand(); comm.CommandText = "select count(studentusername) from tb_banjistudent where banjiid=" + banjiid; conn.Open(); if (((int)(comm.ExecuteScalar())) <= 0)//是否有学生 { xuesheng = true; } comm.CommandText = "select count(teacherusername) from tb_teacherrenke where banjiid=" + banjiid; if (((int)(comm.ExecuteScalar())) <= 0) { renke = true; } if (xuesheng && renke) { comm.CommandText = "delete from tb_banji where banjiid=" + banjiid; comm.ExecuteNonQuery(); ListBox1.DataBind(); Labelfankui.Text = "删除班级:" + banjiname + " 成功!"; } else { string yuanyin = ""; if (!xuesheng) { yuanyin += "该班有学生!"; } if (!renke) { yuanyin += "已有教师任该班的课!"; } Labelfankui.Text = "删除班级:" + banjiname + " 失败!" + yuanyin; } conn.Close(); } else { Labelfankui.Text = "请选择班级!"; } }