数据穿透
This commit is contained in:
@@ -113,10 +113,15 @@
|
||||
</f:Toolbar>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<%--<f:DropDownList ID="drpProblemTypes" Hidden="true" runat="server" Label="检查类型" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"
|
||||
<f:DropDownList ID="drpProblemTypes" Hidden="true" runat="server" Label="检查类型" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"
|
||||
LabelWidth="100px" LabelAlign="Right" Width="200px">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList runat="server" EnableSimulateTree="True" Hidden="true" LabelAlign="Right" Label="巡检周期" ID="drpckType" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
|
||||
<f:DropDownList runat="server" EnableSimulateTree="True" LabelWidth="80px" LabelAlign="Right" Label="来源" ID="drpDataSource" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
|
||||
<f:ListItem Text="-请选择-" Value="null"/>
|
||||
<f:ListItem Text="本单位" Value="0"/>
|
||||
<f:ListItem Text="总包" Value="1"/>
|
||||
</f:DropDownList>
|
||||
<%--<f:DropDownList runat="server" EnableSimulateTree="True" Hidden="true" LabelAlign="Right" Label="巡检周期" ID="drpckType" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
|
||||
<f:ListItem Text="-请选择-" Value="null"/>
|
||||
<f:ListItem Text="日检" Value="D"/>
|
||||
<f:ListItem Text="周检" Value="W"/>
|
||||
@@ -131,6 +136,8 @@
|
||||
<f:RadioItem Text="无图" Value="0" Selected="true" />
|
||||
<f:RadioItem Text="有图" Value="1" />
|
||||
</f:RadioButtonList>
|
||||
<f:Button ID="btnPull" runat="server" OnClick="btnPull_Click" ToolTip="获取" Text="获取">
|
||||
</f:Button>
|
||||
<f:Button ID="btnNew" Icon="Add" runat="server" OnClick="btnNew_Click" ToolTip="新增" Text="新增" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp" Text="导出"
|
||||
@@ -148,7 +155,7 @@
|
||||
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="120px" ColumnID="PUnitName" DataField="PUnitName"
|
||||
<%--<f:RenderField Width="120px" ColumnID="PUnitName" DataField="PUnitName"
|
||||
SortField="PUnitName" FieldType="String" HeaderText="所属单位" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
@@ -156,9 +163,14 @@
|
||||
<f:RenderField Width="120px" ColumnID="ProjectName" DataField="ProjectName"
|
||||
SortField="ProjectName" FieldType="String" HeaderText="项目名称" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
</f:RenderField>--%>
|
||||
|
||||
<f:TemplateField ColumnID="DataSource" Width="120px" HeaderText="来源" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbDataSource" runat="server" Text='<%# ConvertDataSource(Eval("DataSource")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField ColumnID="ProblemTypes" Width="120px" HeaderText="检查类型" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -95,14 +95,14 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
|
||||
HSSE_Hazard_HazardRegisterService.InitStatesDropDownList(this.drpStates, true);
|
||||
|
||||
/* ListItem[] ProblemTypes = new ListItem[2];
|
||||
ListItem[] ProblemTypes = new ListItem[2];
|
||||
ProblemTypes[0] = new ListItem("日常巡检", "1");
|
||||
ProblemTypes[1] = new ListItem("专项巡检", "2");
|
||||
this.drpProblemTypes.DataValueField = "Value";
|
||||
this.drpProblemTypes.DataTextField = "Text";
|
||||
this.drpProblemTypes.DataSource = ProblemTypes;
|
||||
this.drpProblemTypes.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpProblemTypes);*/
|
||||
Funs.FineUIPleaseSelect(this.drpProblemTypes);
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
}
|
||||
@@ -132,7 +132,7 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
|
||||
if (!string.IsNullOrEmpty(this.ProjectId) || !string.IsNullOrEmpty(this.UnintId))
|
||||
{
|
||||
string strSql = "SELECT * FROM View_Hazard_HazardRegister WHERE ProblemTypes ='1' ";
|
||||
string strSql = "SELECT * FROM View_Hazard_HazardRegister WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(ProjectId))
|
||||
{
|
||||
@@ -156,8 +156,8 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.dpRiskLevel.SelectedValue.Trim()))
|
||||
{
|
||||
strSql += " AND Risk_Level = @Risk_Level";
|
||||
listStr.Add(new SqlParameter("@Risk_Level", this.dpRiskLevel.SelectedText));
|
||||
strSql += " AND Risk_Level LIKE @Risk_Level";
|
||||
listStr.Add(new SqlParameter("@Risk_Level", "%" + this.dpRiskLevel.SelectedText + "%"));
|
||||
}
|
||||
//if (this.ckType.SelectedValue != "0")
|
||||
//{
|
||||
@@ -202,6 +202,26 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
strSql += " AND States LIKE @States";
|
||||
listStr.Add(new SqlParameter("@States", "%" + this.drpStates.SelectedValue + "%"));
|
||||
}
|
||||
|
||||
if (this.drpProblemTypes.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND ProblemTypes = @ProblemTypes";
|
||||
listStr.Add(new SqlParameter("@ProblemTypes", this.drpProblemTypes.SelectedValue));
|
||||
}
|
||||
if (this.drpDataSource.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
if (this.drpDataSource.SelectedValue == "0")
|
||||
{
|
||||
strSql += " AND DataSource != @DataSource";
|
||||
listStr.Add(new SqlParameter("@DataSource", "1"));
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql += " AND DataSource = @DataSource";
|
||||
listStr.Add(new SqlParameter("@DataSource", this.drpDataSource.SelectedValue));
|
||||
}
|
||||
}
|
||||
|
||||
if (!CommonService.IsMainUnitOrAdmin(this.CurrUser.UserId))
|
||||
{
|
||||
strSql += " AND (ResponsibleUnit =@ResponsibleUnit OR SendUnitId=@SendUnitId)";
|
||||
@@ -381,14 +401,20 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
{
|
||||
if (registration.States == "1") //待整改
|
||||
{
|
||||
if (registration.ResponsibleMan == this.CurrUser.UserId) //当前人是责任人,可以进行整改操作
|
||||
if (registration.DataSource == "1")
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationRectify.aspx?HazardRegisterId={0}", RegistrationId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
}else
|
||||
{
|
||||
Alert.ShowInTop("您不是记录责任人,无法整改!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
if (registration.ResponsibleMan == this.CurrUser.UserId) //当前人是责任人,可以进行整改操作
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationRectify.aspx?HazardRegisterId={0}", RegistrationId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您不是记录责任人,无法整改!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -904,5 +930,33 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected string ConvertDataSource(object dataSource)
|
||||
{
|
||||
string data = "本单位";
|
||||
if (dataSource != null)
|
||||
{
|
||||
if (dataSource.ToString() == "1")
|
||||
{
|
||||
data = "总包";
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
#region 拉取总包检查
|
||||
/// <summary>
|
||||
/// 拉取总包检查
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnPull_Click(object sender, EventArgs e)
|
||||
{
|
||||
APIHazardRegisterSyncService.getHazardRegisterLists(this.ProjectId);
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+36
@@ -221,6 +221,24 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar3;
|
||||
|
||||
/// <summary>
|
||||
/// drpProblemTypes 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpProblemTypes;
|
||||
|
||||
/// <summary>
|
||||
/// drpDataSource 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpDataSource;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
@@ -248,6 +266,15 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rbOutType;
|
||||
|
||||
/// <summary>
|
||||
/// btnPull 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnPull;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
@@ -275,6 +302,15 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPageIndex;
|
||||
|
||||
/// <summary>
|
||||
/// lbDataSource 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbDataSource;
|
||||
|
||||
/// <summary>
|
||||
/// lbProblemTypes 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -125,6 +125,18 @@ namespace FineUIPro.Web.HiddenInspection
|
||||
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HSSE_HiddenRectificationListMenuId, BLL.Const.BtnSave))
|
||||
{
|
||||
SaveData(true);
|
||||
#region 推送到总包
|
||||
var register = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(this.HazardRegisterId);
|
||||
if (register != null)
|
||||
{
|
||||
if (register.DataSource == "1")
|
||||
{
|
||||
//推送到总包
|
||||
APIHazardRegisterSyncService.pushHazardRegisterLists(this.CurrUser.LoginProjectId, register.HazardRegisterId);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user