2026-01-22 20:41:07 +08:00
|
|
|
|
using BLL;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Web;
|
|
|
|
|
|
using System.Web.UI;
|
|
|
|
|
|
using System.Web.UI.WebControls;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.JGZL
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class IndustrialPipelineInstallationSummary : PageBase
|
|
|
|
|
|
{
|
|
|
|
|
|
#region 加载页面
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载页面
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
this.drpProjectId.DataTextField = "ProjectCode";
|
|
|
|
|
|
this.drpProjectId.DataValueField = "ProjectId";
|
|
|
|
|
|
this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1");
|
|
|
|
|
|
this.drpProjectId.DataBind();
|
|
|
|
|
|
Funs.FineUIPleaseSelect(this.drpProjectId);
|
|
|
|
|
|
|
2026-01-23 10:45:21 +08:00
|
|
|
|
this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId;
|
2026-01-22 20:41:07 +08:00
|
|
|
|
this.InitTreeMenu();//加载树
|
2026-01-23 10:45:21 +08:00
|
|
|
|
this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue;
|
|
|
|
|
|
this.BindGrid();
|
2026-01-22 20:41:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 加载树项目
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载树
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void InitTreeMenu()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.tvControlItem.Nodes.Clear();
|
|
|
|
|
|
TreeNode rootNode = new TreeNode();
|
|
|
|
|
|
rootNode.Text = "项目";
|
|
|
|
|
|
rootNode.ToolTip = "项目";
|
|
|
|
|
|
rootNode.NodeID = "0";
|
|
|
|
|
|
rootNode.Expanded = true;
|
|
|
|
|
|
this.tvControlItem.Nodes.Add(rootNode);
|
|
|
|
|
|
|
|
|
|
|
|
List<Model.Base_Project> projects = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1");
|
|
|
|
|
|
if (this.drpProjectId.SelectedValue != BLL.Const._Null)
|
|
|
|
|
|
{
|
|
|
|
|
|
projects = projects.Where(e => e.ProjectId == this.drpProjectId.SelectedValue).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
foreach (var item in projects)
|
|
|
|
|
|
{
|
|
|
|
|
|
TreeNode rootProjectNode = new TreeNode();//定义根节点
|
|
|
|
|
|
rootProjectNode.Text = item.ProjectCode;
|
|
|
|
|
|
rootProjectNode.NodeID = item.ProjectId;
|
|
|
|
|
|
rootProjectNode.EnableClickEvent = true;
|
|
|
|
|
|
rootProjectNode.Expanded = true;
|
|
|
|
|
|
rootProjectNode.ToolTip = item.ProjectName;
|
|
|
|
|
|
rootProjectNode.CommandName = "项目名称";
|
|
|
|
|
|
rootNode.Nodes.Add(rootProjectNode);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 点击TreeView
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 点击TreeView
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.tvControlItem.SelectedNodeID != "0")
|
|
|
|
|
|
{
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 数据绑定
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 数据绑定
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void BindGrid()
|
|
|
|
|
|
{
|
|
|
|
|
|
//string projectIds = BLL.Base_ProjectService.GetStrOnProjectIds(this.CurrUser.UserId, "1");
|
|
|
|
|
|
string strSql = @"SELECT tbb.CertificateCode,tbb.DeliveryUnit,tbb.DeliveryUnitCode,tba.*
|
|
|
|
|
|
FROM JGZL_IndustrialPipelineInstallationSummary AS tba
|
|
|
|
|
|
LEFT JOIN JGZL_IndustrialPipelineInstallationQualityCertificate AS tbb ON tbb.CertificateId=tba.CertificateId
|
|
|
|
|
|
WHERE 1=1 ";
|
|
|
|
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
|
|
|
|
|
|
{
|
|
|
|
|
|
strSql += " AND tba.ProjectId = @ProjectId";
|
|
|
|
|
|
listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID));
|
|
|
|
|
|
}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// strSql += " AND CHARINDEX(ProjectId,@ProjectId)>0 ";
|
|
|
|
|
|
// listStr.Add(new SqlParameter("@ProjectId", projectIds));
|
|
|
|
|
|
//}
|
|
|
|
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
|
|
|
|
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
|
|
|
|
// 2.获取当前分页数据
|
|
|
|
|
|
Grid1.RecordCount = tb.Rows.Count;
|
|
|
|
|
|
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
|
|
|
|
|
var table = this.GetPagedDataTable(Grid1, tb);
|
|
|
|
|
|
Grid1.DataSource = table;
|
|
|
|
|
|
Grid1.DataBind();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 分页排序
|
|
|
|
|
|
#region 页索引改变事件
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 页索引改变事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 排序
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 排序
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 分页选择下拉改变事件
|
|
|
|
|
|
/// <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();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 查询
|
|
|
|
|
|
///<summary>
|
|
|
|
|
|
///查询
|
|
|
|
|
|
///</summary>
|
|
|
|
|
|
///<param name="sender"></param>
|
|
|
|
|
|
///<param name="e"></param>
|
|
|
|
|
|
protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2026-02-09 09:37:27 +08:00
|
|
|
|
this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue;
|
2026-01-22 20:41:07 +08:00
|
|
|
|
this.InitTreeMenu();
|
2026-02-09 09:37:27 +08:00
|
|
|
|
BindGrid();
|
2026-01-22 20:41:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void TextBox_TextChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 打印
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 打印
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void btnPrint_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string projectId = this.tvControlItem.SelectedNodeID;
|
|
|
|
|
|
|
|
|
|
|
|
if (projectId != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
string initTemplatePath = "";
|
|
|
|
|
|
string rootPath = Server.MapPath("~/");
|
|
|
|
|
|
BLL.Common.FastReportService.ResetData();
|
|
|
|
|
|
|
2026-01-26 16:26:49 +08:00
|
|
|
|
string strSql = @"SELECT * from JGZL_IndustrialPipelineInstallationSummary where ProjectId = @ProjectId ";
|
2026-01-22 20:41:07 +08:00
|
|
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
|
|
|
|
listStr.Add(new SqlParameter("@ProjectId", projectId));
|
|
|
|
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
|
|
|
|
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
|
|
|
|
|
|
|
|
|
|
DataTable dt = new DataTable();
|
|
|
|
|
|
dt.TableName = "Data";
|
|
|
|
|
|
dt.Columns.Add("Num");
|
2026-01-26 16:26:49 +08:00
|
|
|
|
dt.Columns.Add("PipelineCode");
|
|
|
|
|
|
dt.Columns.Add("PipelineLevel");
|
|
|
|
|
|
dt.Columns.Add("DesignPressure");
|
|
|
|
|
|
dt.Columns.Add("DesignTemperature");
|
|
|
|
|
|
dt.Columns.Add("OperatingTemperature");
|
|
|
|
|
|
dt.Columns.Add("Medium");
|
|
|
|
|
|
dt.Columns.Add("Material");
|
|
|
|
|
|
dt.Columns.Add("Specifications");
|
|
|
|
|
|
dt.Columns.Add("Length");
|
|
|
|
|
|
dt.Columns.Add("LayingMethod");
|
|
|
|
|
|
dt.Columns.Add("WeldsNum");
|
|
|
|
|
|
dt.Columns.Add("LosslessRatio");
|
|
|
|
|
|
dt.Columns.Add("VoltageResistantTestMedium");
|
|
|
|
|
|
dt.Columns.Add("VoltageResistantTestPressure");
|
|
|
|
|
|
dt.Columns.Add("VoltageResistantTestDate");
|
|
|
|
|
|
dt.Columns.Add("LeakageTestMedium");
|
|
|
|
|
|
dt.Columns.Add("LeakageTestPressure");
|
|
|
|
|
|
dt.Columns.Add("LeakageTestDate");
|
|
|
|
|
|
dt.Columns.Add("CleaningMethod");
|
|
|
|
|
|
dt.Columns.Add("CorrosionControlMethod");
|
|
|
|
|
|
dt.Columns.Add("InsulationMethod");
|
2026-02-09 15:40:52 +08:00
|
|
|
|
dt.Columns.Add("PipelineStartPoint");
|
|
|
|
|
|
dt.Columns.Add("PipelineEndPoint");
|
|
|
|
|
|
dt.Columns.Add("Remark");
|
2026-01-22 20:41:07 +08:00
|
|
|
|
|
|
|
|
|
|
DataRow[] rows = tb.DefaultView.ToTable().Select();
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
foreach (var row in rows)
|
|
|
|
|
|
{
|
|
|
|
|
|
var newRow = dt.NewRow();
|
|
|
|
|
|
newRow["Num"] = (i + 1).ToString();
|
2026-01-26 16:26:49 +08:00
|
|
|
|
newRow["PipelineCode"] = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(row["PipelineCode"].ToString()).ISO_IsoNo;
|
|
|
|
|
|
newRow["PipelineLevel"] = row["PipelineLevel"].ToString();
|
|
|
|
|
|
newRow["DesignPressure"] = row["DesignPressure"].ToString();
|
|
|
|
|
|
newRow["DesignTemperature"] = row["DesignTemperature"].ToString();
|
|
|
|
|
|
newRow["OperatingTemperature"] = row["OperatingTemperature"].ToString();
|
|
|
|
|
|
newRow["Medium"] = row["Medium"].ToString();
|
|
|
|
|
|
newRow["Material"] = row["Material"].ToString();
|
|
|
|
|
|
newRow["Specifications"] = row["Specifications"].ToString();
|
|
|
|
|
|
newRow["Length"] = row["Length"].ToString();
|
|
|
|
|
|
newRow["LayingMethod"] = row["LayingMethod"].ToString();
|
|
|
|
|
|
newRow["WeldsNum"] = row["WeldsNum"].ToString();
|
|
|
|
|
|
newRow["LosslessRatio"] = row["LosslessRatio"].ToString();
|
|
|
|
|
|
newRow["VoltageResistantTestMedium"] = row["VoltageResistantTestMedium"].ToString();
|
|
|
|
|
|
newRow["VoltageResistantTestPressure"] = row["VoltageResistantTestPressure"].ToString();
|
|
|
|
|
|
string VoltageResistantTestDate = string.Format("{0:yyyy.MM.dd}", row["VoltageResistantTestDate"]);
|
|
|
|
|
|
newRow["VoltageResistantTestDate"] = VoltageResistantTestDate;
|
|
|
|
|
|
newRow["LeakageTestMedium"] = row["LeakageTestMedium"].ToString();
|
|
|
|
|
|
newRow["LeakageTestPressure"] = row["LeakageTestPressure"].ToString();
|
|
|
|
|
|
string LeakageTestDate = string.Format("{0:yyyy.MM.dd}", row["LeakageTestDate"]);
|
|
|
|
|
|
newRow["LeakageTestDate"] = LeakageTestDate;
|
|
|
|
|
|
newRow["CleaningMethod"] = row["CleaningMethod"].ToString();
|
|
|
|
|
|
newRow["CorrosionControlMethod"] = row["CorrosionControlMethod"].ToString();
|
|
|
|
|
|
newRow["InsulationMethod"] = row["InsulationMethod"].ToString();
|
2026-02-09 15:40:52 +08:00
|
|
|
|
newRow["PipelineStartPoint"] = row["PipelineStartPoint"].ToString();
|
|
|
|
|
|
newRow["PipelineEndPoint"] = row["PipelineEndPoint"].ToString();
|
|
|
|
|
|
newRow["Remark"] = row["Remark"].ToString();
|
2026-01-22 20:41:07 +08:00
|
|
|
|
dt.Rows.Add(newRow);
|
|
|
|
|
|
i++;
|
|
|
|
|
|
}
|
|
|
|
|
|
BLL.Common.FastReportService.AddFastreportTable(dt);
|
|
|
|
|
|
|
2026-01-26 16:26:49 +08:00
|
|
|
|
string certificateCode = string.Empty;
|
|
|
|
|
|
string deliveryUnit = string.Empty;
|
|
|
|
|
|
string deliveryUnitCode = string.Empty;
|
|
|
|
|
|
string certificateId = rows[0]["CertificateId"].ToString();
|
|
|
|
|
|
var certificate = BLL.IndustrialPipelineInstallationQualityCertificateService.GetIndustrialPipelineInstallationQualityCertificateById(certificateId);
|
|
|
|
|
|
if (certificate!=null)
|
|
|
|
|
|
{
|
|
|
|
|
|
certificateCode = certificate.CertificateCode;
|
|
|
|
|
|
deliveryUnit=certificate.DeliveryUnit;
|
|
|
|
|
|
deliveryUnitCode = certificate.DeliveryUnitCode;
|
|
|
|
|
|
}
|
2026-01-22 20:41:07 +08:00
|
|
|
|
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
2026-01-26 16:26:49 +08:00
|
|
|
|
keyValuePairs.Add("CertificateCode", certificateCode);
|
|
|
|
|
|
keyValuePairs.Add("DeliveryUnit", deliveryUnit);
|
|
|
|
|
|
keyValuePairs.Add("DeliveryUnitCode", deliveryUnitCode);
|
2026-01-22 20:41:07 +08:00
|
|
|
|
BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs);
|
|
|
|
|
|
|
2026-01-26 16:26:49 +08:00
|
|
|
|
initTemplatePath = "File\\Fastreport\\JGZL\\压力管道安装汇总表.frx";
|
2026-01-22 20:41:07 +08:00
|
|
|
|
if (File.Exists(rootPath + initTemplatePath))
|
|
|
|
|
|
{
|
|
|
|
|
|
PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 维护
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 增加
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void btnAdd_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
|
|
|
|
|
|
{
|
|
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("IndustrialPipelineInstallationSummaryEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - ")));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 双击编辑
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_IndustrialPipelineInstallationSummaryMenuId, BLL.Const.BtnModify))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
|
|
|
|
|
|
{
|
|
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("IndustrialPipelineInstallationSummaryEdit.aspx?summaryId={0}", this.Grid1.SelectedRowID, "编辑 - ")));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 右键编辑
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_IndustrialPipelineInstallationSummaryMenuId, BLL.Const.BtnModify))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Grid1.SelectedRowIndexArray.Length == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("IndustrialPipelineInstallationSummaryEdit.aspx?summaryId={0}", Grid1.SelectedRowID, "维护 - ")));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 右键删除
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_IndustrialPipelineInstallationSummaryMenuId, Const.BtnDelete))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Grid1.SelectedRowIndexArray.Length == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isShow = true;
|
|
|
|
|
|
if (Grid1.SelectedRowIndexArray.Length > 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
isShow = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
bool isDelete = false;
|
|
|
|
|
|
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
|
|
|
|
|
{
|
|
|
|
|
|
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
|
|
|
|
|
if (judgementDelete(rowID, isShow))
|
|
|
|
|
|
{
|
|
|
|
|
|
isDelete = true;
|
|
|
|
|
|
BLL.IndustrialPipelineInstallationSummaryService.DeleteIndustrialPipelineInstallationSummaryById(rowID);
|
|
|
|
|
|
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除工业管道安装汇总表");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (isDelete)
|
|
|
|
|
|
{
|
|
|
|
|
|
ShowNotify("删除成功!", MessageBoxIcon.Success);
|
|
|
|
|
|
}
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 判断是否可删除
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 判断是否可以删除
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private bool judgementDelete(string id, bool isShow)
|
|
|
|
|
|
{
|
|
|
|
|
|
string content = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(content))
|
|
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (isShow)
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop(content, MessageBoxIcon.Error);
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 关闭弹出窗口及刷新页面
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 关闭弹出窗口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.InitTreeMenu();//加载树
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|