using System; using System.Collections.Generic; using System.Linq; using System.Data; using System.Data.SqlClient; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BLL; namespace FineUIPro.Web.common { public partial class ShowPerson : PageBase { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindDropDownBox(); } } protected void btnSave_Click(object sender, EventArgs e) { string userId = string.Empty; string[] userIds = DropDownBox1.Values; foreach (var item in userIds) { userId += item + ","; } if (!string.IsNullOrEmpty(userId)) { userId = userId.Substring(0, userId.LastIndexOf(",")); } PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(userId) + ActiveWindow.GetHideReference()); } private void BindDropDownBox() { string strSql = @"select u.UserId,u.UserName from Sys_User u left join Project_User pu on u.UserId=pu.UserId where u.UnitId='a8d4c65c-b282-4cba-871d-2d086e37e2a6' and pu.ProjectId='" + this.CurrUser.LoginProjectId + "'"; DataTable tb = SQLHelper.GetDataTableRunText(strSql, null); RadioButtonList1.DataSource = tb; this.RadioButtonList1.DataTextField = "UserName"; this.RadioButtonList1.DataValueField = "UserId"; RadioButtonList1.DataBind(); } } }