81 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			81 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using BLL; | |||
|  | using Newtonsoft.Json.Linq; | |||
|  | using NPOI.SS.Util; | |||
|  | using System; | |||
|  | using System.Collections.Generic; | |||
|  | using System.Data; | |||
|  | using System.Data.SqlClient; | |||
|  | using System.IO; | |||
|  | using System.Linq; | |||
|  | 
 | |||
|  | namespace FineUIPro.Web.Personal | |||
|  | { | |||
|  |     public partial class ShowTestRunPerformanceStandard : PageBase | |||
|  |     { | |||
|  |         #region 加载 | |||
|  |         protected void Page_Load(object sender, EventArgs e) | |||
|  |         { | |||
|  |             if (!IsPostBack) | |||
|  |             { | |||
|  |                 BindGrid(); | |||
|  |             } | |||
|  |         } | |||
|  |         #endregion | |||
|  | 
 | |||
|  |         #region 数据绑定 | |||
|  |         //加载列表 | |||
|  |         public void BindGrid() | |||
|  |         { | |||
|  |             string strSql = @"select * from Base_TestRunPerformanceStandard"; | |||
|  |             List<SqlParameter> listStr = new List<SqlParameter>(); | |||
|  |             SqlParameter[] parameter = listStr.ToArray(); | |||
|  |             DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); | |||
|  |             Grid1.RecordCount = tb.Rows.Count; | |||
|  |             //tb = GetFilteredTable(Grid1.FilteredData, tb); | |||
|  |             var table = this.GetPagedDataTable(Grid1, tb); | |||
|  |             Grid1.DataSource = table; | |||
|  |             Grid1.DataBind(); | |||
|  |         } | |||
|  |         #endregion | |||
|  | 
 | |||
|  |         #region 编辑 | |||
|  |         protected void btnMenuModify_Click(object sender, EventArgs e) | |||
|  |         { | |||
|  |             EditData(); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// Grid行双击事件 | |||
|  |         /// </summary> | |||
|  |         /// <param name="sender"></param> | |||
|  |         /// <param name="e"></param> | |||
|  |         protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) | |||
|  |         { | |||
|  |             EditData(); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 编辑 | |||
|  |         /// </summary> | |||
|  |         private void EditData() | |||
|  |         { | |||
|  |             if (Grid1.SelectedRowIndexArray.Length == 0) | |||
|  |             { | |||
|  |                 Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); | |||
|  |                 return; | |||
|  |             } | |||
|  |             string ids = string.Empty; | |||
|  |             foreach (string id in Grid1.SelectedRowIDArray) | |||
|  |             { | |||
|  |                 ids += id + ","; | |||
|  |             } | |||
|  |             if (!string.IsNullOrEmpty(ids)) | |||
|  |             { | |||
|  |                 ids = ids.Substring(0, ids.LastIndexOf(",")); | |||
|  |             } | |||
|  |             PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(ids) | |||
|  |                    + ActiveWindow.GetHidePostBackReference()); | |||
|  |         } | |||
|  |         #endregion | |||
|  |     } | |||
|  | } |