| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Data; | 
					
						
							|  |  |  |  | using System.Data.SqlClient; | 
					
						
							|  |  |  |  | using System.IO; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Text; | 
					
						
							|  |  |  |  | using System.Web.UI; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace FineUIPro.Web.HSSE.Technique | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class Emergency : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         #region 加载页面 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 加载页面 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Funs.DropDownPageSize(this.ddlPageSize); | 
					
						
							|  |  |  |  |                 ////权限按钮方法 | 
					
						
							|  |  |  |  |                 this.GetButtonPower(); | 
					
						
							|  |  |  |  |                 btnNew.OnClientClick = Window1.GetShowReference("EmergencyEdit.aspx") + "return false;"; | 
					
						
							|  |  |  |  |                 btnSelectColumns.OnClientClick = Window4.GetShowReference("EmergencySelectCloumn.aspx"); | 
					
						
							|  |  |  |  |                 ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); | 
					
						
							|  |  |  |  |                 // 绑定表格 | 
					
						
							|  |  |  |  |                 BindGrid(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 绑定数据 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         private void BindGrid() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             string strSql = @"SELECT EmergencyId,EmergencyTypeId,EmergencyCode,EmergencyName,Summary,AttachUrl,Remark,CompileMan
 | 
					
						
							|  |  |  |  |                                     , CompileDate, AuditMan, AuditDate, IsPass, UnitId, IsBuild, UpState, EmergencyTypeCode, EmergencyTypeName, AuditManName, AttachUrlName, IsBuildName | 
					
						
							|  |  |  |  |                                     FROM dbo.View_Technique_Emergency | 
					
						
							|  |  |  |  |                                     WHERE 1=1 ";
 | 
					
						
							|  |  |  |  |             List<SqlParameter> listStr = new List<SqlParameter>(); | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(this.EmergencyCode.Text.Trim())) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 strSql += " AND EmergencyCode LIKE @EmergencyCode"; | 
					
						
							|  |  |  |  |                 listStr.Add(new SqlParameter("@EmergencyCode", "%" + this.EmergencyCode.Text.Trim() + "%")); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(this.EmergencyName.Text.Trim())) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 strSql += " AND EmergencyName LIKE @EmergencyName"; | 
					
						
							|  |  |  |  |                 listStr.Add(new SqlParameter("@EmergencyName", "%" + this.EmergencyName.Text.Trim() + "%")); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(this.EmergencyTypeName.Text.Trim())) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 strSql += " AND EmergencyTypeName LIKE @EmergencyTypeName"; | 
					
						
							|  |  |  |  |                 listStr.Add(new SqlParameter("@EmergencyTypeName", "%" + this.EmergencyTypeName.Text.Trim() + "%")); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             SqlParameter[] parameter = listStr.ToArray(); | 
					
						
							|  |  |  |  |             DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             Grid1.RecordCount = tb.Rows.Count; | 
					
						
							|  |  |  |  |             var table = this.GetPagedDataTable(Grid1, tb); | 
					
						
							|  |  |  |  |             Grid1.DataSource = table; | 
					
						
							|  |  |  |  |             Grid1.DataBind(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 表头过滤 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 过滤表头 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Grid1_FilterChange(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据表头信息过滤列表数据 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sourceObj"></param> | 
					
						
							|  |  |  |  |         /// <param name="fillteredOperator"></param> | 
					
						
							|  |  |  |  |         /// <param name="fillteredObj"></param> | 
					
						
							|  |  |  |  |         /// <param name="column"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         private bool FilterDataRowItemImplement(object sourceObj, string fillteredOperator, object fillteredObj, string column) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             bool valid = false; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             if (column == "EmergencyName") | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 string sourceValue = sourceObj.ToString(); | 
					
						
							|  |  |  |  |                 string fillteredValue = fillteredObj.ToString(); | 
					
						
							|  |  |  |  |                 if (fillteredOperator == "equal") | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     if (sourceValue == fillteredValue) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         valid = true; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else if (fillteredOperator == "contain") | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     if (sourceValue.Contains(fillteredValue)) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         valid = true; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             return valid; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 分页、排序、关闭窗口 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 分页 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Grid1.PageIndex = e.NewPageIndex; | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 分页显示条数下拉框 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 排序 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Grid1.SortDirection = e.SortDirection; | 
					
						
							|  |  |  |  |             Grid1.SortField = e.SortField; | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 关闭窗口 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Window1_Close(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 编辑 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 右键编辑事件 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnMenuEdit_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.EditData(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 编辑数据方法 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         private void EditData() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (Grid1.SelectedRowIndexArray.Length == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             string EmergencyId = Grid1.SelectedRowID; | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EmergencyEdit.aspx?EmergencyId={0}", EmergencyId, "编辑 - "))); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 删除 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 右键删除事件 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnMenuDelete_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.DeleteData(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 删除方法 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         private void DeleteData() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (Grid1.SelectedRowIndexArray.Length > 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 foreach (int rowIndex in Grid1.SelectedRowIndexArray) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     string rowID = Grid1.DataKeys[rowIndex][0].ToString(); | 
					
						
							|  |  |  |  |                     var getV = BLL.EmergencyService.GetEmergencyListById(rowID); | 
					
						
							|  |  |  |  |                     if (getV != null) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         BLL.LogService.AddSys_Log(this.CurrUser, getV.EmergencyCode, getV.EmergencyId, BLL.Const.EmergencyMenuId, Const.BtnDelete); | 
					
						
							|  |  |  |  |                         BLL.EmergencyService.DeleteEmergencyListById(rowID); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 BindGrid(); | 
					
						
							|  |  |  |  |                 ShowNotify("删除数据成功!"); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region Grid行双击事件 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Grid行双击事件 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.EditData(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 导出 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 关闭导出窗口 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Window4_Close(object sender, WindowCloseEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Response.ClearContent(); | 
					
						
							|  |  |  |  |             Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls"); | 
					
						
							|  |  |  |  |             Response.ContentType = "application/excel"; | 
					
						
							|  |  |  |  |             Response.ContentEncoding = System.Text.Encoding.UTF8; | 
					
						
							|  |  |  |  |             Response.Write(GetGridTableHtml(Grid1, e.CloseArgument.Split('#'))); | 
					
						
							|  |  |  |  |             Response.End(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 导出 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="grid"></param> | 
					
						
							|  |  |  |  |         /// <param name="columns"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         private string GetGridTableHtml(Grid grid, string[] columns) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             StringBuilder sb = new StringBuilder(); | 
					
						
							|  |  |  |  |             sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>"); | 
					
						
							|  |  |  |  |             List<string> columnHeaderTexts = new List<string>(columns); | 
					
						
							|  |  |  |  |             List<int> columnIndexs = new List<int>(); | 
					
						
							|  |  |  |  |             sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">"); | 
					
						
							|  |  |  |  |             sb.Append("<tr>"); | 
					
						
							|  |  |  |  |             foreach (GridColumn column in grid.Columns) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (columnHeaderTexts.Contains(column.HeaderText)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     sb.AppendFormat("<td>{0}</td>", column.HeaderText); | 
					
						
							|  |  |  |  |                     columnIndexs.Add(column.ColumnIndex); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             sb.Append("</tr>"); | 
					
						
							|  |  |  |  |             foreach (GridRow row in grid.Rows) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 sb.Append("<tr>"); | 
					
						
							|  |  |  |  |                 int columnIndex = 0; | 
					
						
							|  |  |  |  |                 foreach (object value in row.Values) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     if (columnIndexs.Contains(columnIndex)) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         string html = value.ToString(); | 
					
						
							|  |  |  |  |                         if (html.StartsWith(Grid.TEMPLATE_PLACEHOLDER_PREFIX)) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             // 模板列                             | 
					
						
							|  |  |  |  |                             string templateID = html.Substring(Grid.TEMPLATE_PLACEHOLDER_PREFIX.Length); | 
					
						
							|  |  |  |  |                             Control templateCtrl = row.FindControl(templateID); | 
					
						
							|  |  |  |  |                             html = GetRenderedHtmlSource(templateCtrl); | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         //else | 
					
						
							|  |  |  |  |                         //{ | 
					
						
							|  |  |  |  |                         //    // 处理CheckBox              | 
					
						
							|  |  |  |  |                         //    if (html.Contains("f-grid-static-checkbox")) | 
					
						
							|  |  |  |  |                         //    { | 
					
						
							|  |  |  |  |                         //        if (!html.Contains("f-checked")) | 
					
						
							|  |  |  |  |                         //        { | 
					
						
							|  |  |  |  |                         //            html = "×"; | 
					
						
							|  |  |  |  |                         //        } | 
					
						
							|  |  |  |  |                         //        else | 
					
						
							|  |  |  |  |                         //        { | 
					
						
							|  |  |  |  |                         //            html = "√"; | 
					
						
							|  |  |  |  |                         //        } | 
					
						
							|  |  |  |  |                         //    } | 
					
						
							|  |  |  |  |                         //    // 处理图片                            | 
					
						
							|  |  |  |  |                         //    if (html.Contains("<img")) | 
					
						
							|  |  |  |  |                         //    { | 
					
						
							|  |  |  |  |                         //        string prefix = Request.Url.AbsoluteUri.Replace(Request.Url.AbsolutePath, "");  | 
					
						
							|  |  |  |  |                         //        html = html.Replace("src=\"", "src=\"" + prefix); | 
					
						
							|  |  |  |  |                         //    } | 
					
						
							|  |  |  |  |                         //} | 
					
						
							|  |  |  |  |                         sb.AppendFormat("<td>{0}</td>", html); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     columnIndex++; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 sb.Append("</tr>"); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             sb.Append("</table>"); | 
					
						
							|  |  |  |  |             return sb.ToString(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary>         | 
					
						
							|  |  |  |  |         /// 获取控件渲染后的HTML源代码         | 
					
						
							|  |  |  |  |         /// </summary>         | 
					
						
							|  |  |  |  |         /// <param name="ctrl"></param>         | 
					
						
							|  |  |  |  |         /// <returns></returns>         | 
					
						
							|  |  |  |  |         private string GetRenderedHtmlSource(Control ctrl) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (ctrl != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 using (StringWriter sw = new StringWriter()) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     using (HtmlTextWriter htw = new HtmlTextWriter(sw)) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         ctrl.RenderControl(htw); | 
					
						
							|  |  |  |  |                         return sw.ToString(); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             return String.Empty; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 输入框查询事件 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 查询 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void TextBox_TextChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.BindGrid(); | 
					
						
							|  |  |  |  |             BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, string.Empty, BLL.Const.EmergencyMenuId, Const.BtnQuery); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 获取按钮权限 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取按钮权限 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="button"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         private void GetButtonPower() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.EmergencyMenuId); | 
					
						
							|  |  |  |  |             if (buttonList.Count() > 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (buttonList.Contains(BLL.Const.BtnAdd)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     this.btnNew.Hidden = false; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (buttonList.Contains(BLL.Const.BtnModify)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     this.btnMenuEdit.Hidden = false; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (buttonList.Contains(BLL.Const.BtnDelete)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     this.btnMenuDelete.Hidden = false; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (buttonList.Contains(BLL.Const.BtnOut)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     this.btnSelectColumns.Hidden = false; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							| 
									
										
										
										
											2021-12-07 18:42:00 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 从集团获取 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnGet_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var returnValue = CNCECHSSEWebService.getTechnique_Emergency(); | 
					
						
							|  |  |  |  |             if (returnValue.code == 1) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 ShowNotify(returnValue.message, MessageBoxIcon.Success); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Alert.ShowInTop(returnValue.message, MessageBoxIcon.Success); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | } |