using BLL; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace FineUIPro.Web.SubPackManage { public partial class SubPackTeamListSelect : PageBase { /// /// 单位 /// public string UnitWorkID { get { return (string)ViewState["UnitWorkID"]; } set { ViewState["UnitWorkID"] = value; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.UnitWorkID = Request.Params["UnitWorkID"]; this.HidFromType.Text= Request.Params["type"]; if (string.IsNullOrWhiteSpace(this.HidFromType.Text)) this.HidFromType.Text = "1"; BindGrid(); } } private void BindGrid() { string strSql = @"select a.SubPackTeamListDetailID BranchTeamListId,a.UnitWorkId UnitId, a.SubPackTeamListName BranchTeamListName,c.UnitName,a.ChargeContract,a.LicenseNumber,a.AptitudeCertNumber,a.EnrollAddress,a.AchievementCondition,a.FundCondition,a.Corporate,a.Remark,a.CorporateIDCard " + @"FROM View_SubPack_TeamList a " + @" left join Base_Unit c on a.UnitWorkId=c.UnitId " + @" WHERE a.ProjectId=@ProjectId AND a.UnitWorkId=@UnitId "; List listStr = new List(); listStr.Add(new SqlParameter("@UnitId", this.UnitWorkID)); listStr.Add(new SqlParameter("@ProjectId",this.CurrUser.LoginProjectId)); if (!string.IsNullOrWhiteSpace(ttbSearch.Text.Trim())) { strSql += " AND a.SubPackTeamListName like '%'+ @branchTeamListName + '%' "; listStr.Add(new SqlParameter("@branchTeamListName", ttbSearch.Text.Trim())); } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); Grid1.DataSource = tb; Grid1.DataBind(); } protected void ttbSearch_Trigger1Click(object sender, EventArgs e) { ttbSearch.Text = String.Empty; ttbSearch.ShowTrigger1 = false; BindGrid(); } protected void ttbSearch_Trigger2Click(object sender, EventArgs e) { ttbSearch.ShowTrigger1 = true; BindGrid(); } /// /// 关闭弹出窗 /// /// /// protected void Window1_Close(object sender, WindowCloseEventArgs e) { BindGrid(); } } }