20240125本部检查调整

This commit is contained in:
2024-01-25 17:24:20 +08:00
parent 6b5fb3a865
commit 2449c9fa32
14 changed files with 381 additions and 176 deletions
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using NPOI.SS.Formula;
using System.Collections.Generic;
using System.Linq;
namespace BLL
@@ -96,19 +97,34 @@ namespace BLL
/// <param name="checkNoticeId"></param>
public static void DeleteCheckNoticeByCheckNoticeId(string checkNoticeId)
{
Model.ProjectSupervision_CheckNotice checkNotice = Funs.DB.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
if (checkNotice != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var checkTeams = from x in Funs.DB.ProjectSupervision_CheckTeam where x.CheckNoticeId == checkNoticeId select x;
if (checkTeams.Count() > 0)
var checkNotice = db.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
if (checkNotice != null)
{
foreach (var item in checkTeams)
var checkTeams = from x in db.ProjectSupervision_CheckTeam where x.CheckNoticeId == checkNoticeId select x;
if (checkTeams.Count() > 0)
{
BLL.CheckTeamService.DeleteCheckTeamByCheckTeamId(item.CheckTeamId);
db.ProjectSupervision_CheckTeam.DeleteAllOnSubmit(checkTeams);
}
var getCheck1 = from x in db.ProjectSupervision_Check1 where x.CheckNoticeId == checkNoticeId select x;
if (getCheck1.Count() > 0)
{
db.ProjectSupervision_Check1.DeleteAllOnSubmit(getCheck1);
}
var getCheckTable1 = from x in db.ProjectSupervision_CheckTable1 where x.CheckNoticeId == checkNoticeId select x;
if (getCheckTable1.Count() > 0)
{
db.ProjectSupervision_CheckTable1.DeleteAllOnSubmit(getCheckTable1);
}
CheckReportService.DeleteCheckReportByCheckNoticeId(checkNoticeId);
ProjectSupervision_RectifyService.DeleteRectifyByCheckNoticeId(checkNoticeId);
db.ProjectSupervision_CheckNotice.DeleteOnSubmit(checkNotice);
db.SubmitChanges();
}
Funs.DB.ProjectSupervision_CheckNotice.DeleteOnSubmit(checkNotice);
Funs.DB.SubmitChanges();
}
}
@@ -119,44 +135,47 @@ namespace BLL
/// <returns></returns>
public static List<Model.ProjectSupervision_CheckNotice> GetCheckInfoList(string unitId, string userId, string roleId)
{
List<Model.ProjectSupervision_CheckNotice> checkInfoLists = new List<Model.ProjectSupervision_CheckNotice>();
var role = BLL.RoleService.GetRoleByRoleId(roleId);
if (userId == BLL.Const.sysglyId || (BLL.CommonService.IsMainUnitOrAdmin(unitId) && role != null))
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
checkInfoLists = (from x in Funs.DB.ProjectSupervision_CheckNotice orderby x.CheckStartTime select x).ToList();
}
else
{
var checkInfoIdList = (from x in Funs.DB.ProjectSupervision_CheckTeam
where x.UserId == userId && x.UnitId == unitId
select x.CheckNoticeId).Distinct().ToList();
if (checkInfoIdList.Count() > 0)
List<Model.ProjectSupervision_CheckNotice> checkInfoLists = new List<Model.ProjectSupervision_CheckNotice>();
var role = BLL.RoleService.GetRoleByRoleId(roleId);
if (userId == BLL.Const.sysglyId || (BLL.CommonService.IsMainUnitOrAdmin(unitId) && role != null))
{
checkInfoLists = (from x in Funs.DB.ProjectSupervision_CheckNotice
where checkInfoIdList.Contains(x.CheckNoticeId)
orderby x.CheckStartTime
select x).ToList();
checkInfoLists = (from x in db.ProjectSupervision_CheckNotice orderby x.CheckStartTime select x).ToList();
}
var checkInfoIdList1 = (from x in Funs.DB.ProjectSupervision_CheckNotice
where x.CompileMan == userId
orderby x.CheckStartTime
select x).ToList();
if (checkInfoIdList1.Count() > 0)
else
{
if (checkInfoLists.Count() > 0)
var checkInfoIdList = (from x in db.ProjectSupervision_CheckTeam
where x.UserId == userId && x.UnitId == unitId
select x.CheckNoticeId).Distinct().ToList();
if (checkInfoIdList.Count() > 0)
{
checkInfoLists.AddRange(checkInfoIdList1);
checkInfoLists = (from x in db.ProjectSupervision_CheckNotice
where checkInfoIdList.Contains(x.CheckNoticeId)
orderby x.CheckStartTime
select x).ToList();
}
else
{
checkInfoLists = checkInfoIdList1;
}
}
checkInfoLists = checkInfoLists.Distinct().ToList();
var checkInfoIdList1 = (from x in db.ProjectSupervision_CheckNotice
where x.CompileMan == userId
orderby x.CheckStartTime
select x).ToList();
if (checkInfoIdList1.Count() > 0)
{
if (checkInfoLists.Count() > 0)
{
checkInfoLists.AddRange(checkInfoIdList1);
}
else
{
checkInfoLists = checkInfoIdList1;
}
}
checkInfoLists = checkInfoLists.Distinct().ToList();
}
return checkInfoLists;
}
return checkInfoLists;
}
#region ID得到检查内容项
@@ -28,11 +28,14 @@ namespace BLL
/// <param name="checkReportId"></param>
public static void DeleteCheckReportItemByCheckReportId(string checkReportId)
{
var q = (from x in Funs.DB.ProjectSupervision_CheckReportItem where x.CheckReportId == checkReportId select x).ToList();
if (q != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Funs.DB.ProjectSupervision_CheckReportItem.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
var q = (from x in db.ProjectSupervision_CheckReportItem where x.CheckReportId == checkReportId select x).ToList();
if (q != null)
{
db.ProjectSupervision_CheckReportItem.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -61,11 +61,15 @@ namespace BLL
/// <param name="checkNoticeId"></param>
public static void DeleteCheckReportByCheckNoticeId(string checkNoticeId)
{
Model.ProjectSupervision_CheckReport checkReport = Funs.DB.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
if (checkReport != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Funs.DB.ProjectSupervision_CheckReport.DeleteOnSubmit(checkReport);
Funs.DB.SubmitChanges();
Model.ProjectSupervision_CheckReport checkReport = db.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
if (checkReport != null)
{
CheckReportItemService.DeleteCheckReportItemByCheckReportId(checkReport.CheckReportId);
db.ProjectSupervision_CheckReport.DeleteOnSubmit(checkReport);
db.SubmitChanges();
}
}
}
}
@@ -36,11 +36,14 @@ namespace BLL
public static void DeleteRectifyItemByRectifyId(string rectifyId)
{
var q = (from x in Funs.DB.ProjectSupervision_RectifyItem where x.RectifyId == rectifyId select x).ToList();
if (q != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Funs.DB.ProjectSupervision_RectifyItem.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
var q = (from x in db.ProjectSupervision_RectifyItem where x.RectifyId == rectifyId select x).ToList();
if (q != null)
{
db.ProjectSupervision_RectifyItem.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
@@ -75,13 +75,16 @@ namespace BLL
/// <param name="checkNoticeId"></param>
public static void DeleteRectifyByCheckNoticeId(string checkNoticeId)
{
Model.ProjectSupervision_Rectify newRectify = Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
if (newRectify != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Funs.DB.ProjectSupervision_Rectify.DeleteOnSubmit(newRectify);
Funs.DB.SubmitChanges();
var newRectify = db.ProjectSupervision_Rectify.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
if (newRectify != null)
{
ProjectSupervision_RectifyItemService.DeleteRectifyItemByRectifyId(newRectify.RectifyId);
db.ProjectSupervision_Rectify.DeleteOnSubmit(newRectify);
db.SubmitChanges();
}
}
}
}
}
+1 -1
View File
@@ -14435,7 +14435,7 @@
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:2828/</IISUrl>
<IISUrl>http://localhost:14574/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
+36 -5
View File
@@ -17,15 +17,16 @@
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" AllowCellEditing="true" ClicksToEdit="1"
ForceFit="true" EnableCollapse="true" EnableColumnLines="true" EnableColumnMove="true" runat="server" BoxFlex="1"
DataKeyNames="RectifyItemId,IsRectify" DataIDField="RectifyItemId" AllowSorting="true" SortField="RectifyItemId"
SortDirection="ASC" EnableTextSelection="True" MinHeight="240px" PageSize="500"
DataKeyNames="RectifyItemId" DataIDField="RectifyItemId" AllowSorting="true" SortField="RectifyCode"
SortDirection="DESC" EnableTextSelection="True" MinHeight="240px" PageSize="500"
EnableRowDoubleClickEvent="true" OnRowCommand="Grid1_RowCommand">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Left" runat="server">
<Items>
<f:RadioButtonList ID="rbStates" runat="server" Label="状态" LabelAlign="Right" Width="400px" AutoPostBack="true" OnSelectedIndexChanged="rbStates_SelectedIndexChanged">
<f:RadioItem Text="待整改" Value="1" Selected="true" />
<f:RadioItem Text="已完成" Value="3" />
<f:RadioButtonList ID="rbStates" runat="server" Label="状态"
LabelAlign="Right" Width="400px" AutoPostBack="true" OnSelectedIndexChanged="rbStates_SelectedIndexChanged">
<f:RadioItem Text="不合格" Value="0" Selected="true" />
<f:RadioItem Text="合格" Value="1" />
</f:RadioButtonList>
</Items>
</f:Toolbar>
@@ -34,6 +35,12 @@
<f:RenderField HeaderText="主键" ColumnID="RectifyItemId" DataField="RectifyItemId"
SortField="RectifyItemId" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Hidden="true">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="StatesName" DataField="StatesName" FieldType="string"
HeaderText="状态">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="RectifyCode" DataField="RectifyCode" FieldType="string"
HeaderText="整改单">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="WrongContent" DataField="WrongContent" FieldType="string"
HeaderText="具体位置及隐患内容">
@@ -52,6 +59,10 @@
<f:LinkButtonField ColumnID="ReAttachUrl" HeaderText="整改后" ConfirmTarget="Top" Width="80" CommandName="ReAttachUrl"
TextAlign="Center" ToolTip="整改照片" Text="整改后" />
</Columns>
<Listeners>
<f:Listener Event="dataload" Handler="onGridDataLoad" />
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
</f:Grid>
</Items>
</f:Panel>
@@ -59,6 +70,26 @@
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<Items>
<f:MenuButton ID="btnSubmit" EnablePostBack="true" runat="server"
Text="提交" Icon="TableEdit" OnClick="btnSubmit_Click">
</f:MenuButton>
</Items>
</f:Menu>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false,来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function onGridDataLoad(event) {
this.mergeColumns(['RectifyCode'], { depends: true });
}
</script>
</body>
</html>
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
namespace FineUIPro.Web.HSSE.Check
{
@@ -21,22 +22,16 @@ namespace FineUIPro.Web.HSSE.Check
/// </summary>
public void BindGrid()
{
string strSql = @"SELECT Item.RectifyItemId,
Item.RectifyId,
Item.WrongContent,
Item.Requirement,
Item.LimitTime,
Item.RectifyResults,
Item.IsRectify,
Rectify.States,
Rectify.ProjectId "
+ @" FROM ProjectSupervision_RectifyItem AS Item "
+ @" LEFT JOIN ProjectSupervision_Rectify AS Rectify ON Rectify.RectifyId=Item.RectifyId";
string strSql = @"SELECT (CASE WHEN Rectify.States=1 THEN '待整改' WHEN Rectify.States=2 THEN '待确认' WHEN Rectify.States=3 THEN '已完成' ELSE '待签发' END) AS StatesName,
Rectify.RectifyCode,Item.RectifyItemId,Item.RectifyId,Item.WrongContent,Item.Requirement,Item.LimitTime,Item.RectifyResults,Item.IsRectify,Rectify.States,Rectify.ProjectId
FROM ProjectSupervision_RectifyItem AS Item
LEFT JOIN ProjectSupervision_Rectify AS Rectify ON Rectify.RectifyId=Item.RectifyId
WHERE Rectify.States !='0' AND Rectify.States IS NOT NULL ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " WHERE Rectify.ProjectId = @ProjectId";
strSql += " AND Rectify.States = @States";
strSql += " AND Rectify.ProjectId = @ProjectId";
strSql += " AND Item.IsRectify = @IsRectify";
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@States", this.rbStates.SelectedValue));
listStr.Add(new SqlParameter("@IsRectify", this.rbStates.SelectedValue));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
var table = this.GetPagedDataTable(Grid1, tb);
@@ -52,6 +47,14 @@ namespace FineUIPro.Web.HSSE.Check
protected void rbStates_SelectedIndexChanged(object sender, EventArgs e)
{
BindGrid();
if (this.rbStates.SelectedValue == "1")
{
this.btnSubmit.Hidden = true;
}
else
{
this.btnSubmit.Hidden = false;
}
}
/// <summary>
@@ -95,5 +98,34 @@ namespace FineUIPro.Web.HSSE.Check
}
}
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString().Split(',')[0];
var getV = Funs.DB.ProjectSupervision_RectifyItem.FirstOrDefault(x => x.RectifyItemId == rowID);
if (getV != null)
{
var getR = Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(x => x.RectifyId == getV.RectifyId);
if (getR != null && getR.States != Const.State_3)
{
getR.States = BLL.Const.State_2;
Funs.DB.SubmitChanges();
}
}
}
BindGrid();
ShowNotify("数据已提交成功!");
}
}
}
}
+31 -11
View File
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Check {
public partial class OfficeCheck {
namespace FineUIPro.Web.HSSE.Check
{
public partial class OfficeCheck
{
/// <summary>
/// form1 控件。
/// </summary>
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// rbStates 控件。
/// </summary>
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rbStates;
/// <summary>
/// WindowAtt 控件。
/// </summary>
@@ -74,5 +76,23 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnSubmit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnSubmit;
}
}
@@ -187,6 +187,18 @@ namespace FineUIPro.Web.OfficeCheck.Check
/// </summary>
private void PageInfoLoad()
{
this.drpSubjectUnit.Text = string.Empty;
this.txtSubjectUnitMan.Text = string.Empty;
this.txtSubjectUnitTel.Text = string.Empty;
this.txtSubjectUnitAdd.Text = string.Empty;
this.txtCheckStartTime.Text = string.Empty;
this.txtCheckEndTime.Text = string.Empty;
this.txtCompileMan.Text = string.Empty;
this.txtCompileDate.Text = string.Empty;
this.lblResult.Text = string.Empty;
this.lblCheckReportResult.Text = string.Empty;
this.lblCheckResult.Text = string.Empty;
var checkInfo = BLL.CheckNoticeService.GetCheckNoticeById(this.CheckNoticeId);
if (checkInfo != null)
{
@@ -208,41 +220,50 @@ namespace FineUIPro.Web.OfficeCheck.Check
var checkTable = BLL.CheckTable1Service.GetCheckTable1ByCheckNoticeId(this.CheckNoticeId);
if (checkTable != null)
{
// this.lblSubjectUnitId.Text = BLL.ProjectService.GetProjectNameByProjectId(checkTable.SubjectProjectId);
// this.lblCheckDate.Text = string.Format("{0:yyyy-MM-dd}", checkTable.CheckDate);
// this.lblSubjectUnitId.Text = BLL.ProjectService.GetProjectNameByProjectId(checkTable.SubjectProjectId);
// this.lblCheckDate.Text = string.Format("{0:yyyy-MM-dd}", checkTable.CheckDate);
this.lblResult.Text = "评定得分:" + checkTable.TotalLastScore + ";评定结果:" + checkTable.EvaluationResult;
}
//检查报告
var checkReport = BLL.CheckReportService.GetCheckReportByCheckNoticeId(this.CheckNoticeId);
if (checkReport != null)
{
// this.lblCheckObject.Text = BLL.ProjectService.GetProjectNameByProjectId(checkInfo.SubjectProjectId);
// this.lblCheckStartTime.Text = string.Format("{0:yyyy-MM-dd}", checkInfo.CheckStartTime);
// this.lblCheckObject.Text = BLL.ProjectService.GetProjectNameByProjectId(checkInfo.SubjectProjectId);
// this.lblCheckStartTime.Text = string.Format("{0:yyyy-MM-dd}", checkInfo.CheckStartTime);
this.lblCheckReportResult.Text = checkReport.CheckResult;
}
//隐患整改
var rectify = BLL.ProjectSupervision_RectifyService.GetRectifyByCheckNoticeId(this.CheckNoticeId);
if (rectify != null)
{
// this.lblUnitId.Text = BLL.ProjectService.GetProjectNameByProjectId(rectify.ProjectId);
// this.lblCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", rectify.CheckedDate);
string stateText = "【待提交】";
if (rectify.States == Const.State_2)
{
stateText = "【待复查确认】";
}
else if (rectify.States == Const.State_1)
{
stateText = "【待项目整改】";
}
else if (rectify.States == Const.State_0)
{
stateText = "【待签发】";
}
else if (rectify.States == Const.State_3)
{
stateText = "【整改完成】";
}
// this.lblUnitId.Text = BLL.ProjectService.GetProjectNameByProjectId(rectify.ProjectId);
// this.lblCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", rectify.CheckedDate);
var item = BLL.ProjectSupervision_RectifyItemService.GetRectifyItemByRectifyId(rectify.RectifyId);
if (item != null)
{
this.lblCheckResult.Text = "隐患:" + item.Count() + "条";
this.lblCheckResult.Text = "隐患:" + item.Count() + "条。单据状态:" + stateText;
}
}
}
else
{
this.drpSubjectUnit.Text = string.Empty;
this.txtSubjectUnitMan.Text = string.Empty;
this.txtSubjectUnitTel.Text = string.Empty;
this.txtSubjectUnitAdd.Text = string.Empty;
this.txtCheckStartTime.Text = string.Empty;
this.txtCheckEndTime.Text = string.Empty;
this.txtCompileMan.Text = string.Empty;
this.txtCompileDate.Text = string.Empty;
this.CheckNoticeId = string.Empty;
}
}
@@ -357,6 +378,14 @@ namespace FineUIPro.Web.OfficeCheck.Check
protected void btnCheck2_Click(object sender, EventArgs e)
{
string window = String.Format("RectifyEdit.aspx?CheckNoticeId={0}", this.CheckNoticeId, "编辑 - ");
var getCheckNotice = CheckNoticeService.GetCheckNoticeById(this.CheckNoticeId);
var getRectify = ProjectSupervision_RectifyService.GetRectifyByCheckNoticeId(this.CheckNoticeId);
if (getRectify != null && getRectify.States != "0" && !string.IsNullOrEmpty(getRectify.States))
{
window = String.Format("RectifyEdit.aspx?CheckNoticeId={0}&type=1", this.CheckNoticeId, "编辑 - ");
PageContext.RegisterStartupScript(Window2.GetShowReference(window));
}
PageContext.RegisterStartupScript(Window2.GetShowReference(window));
}
@@ -162,11 +162,11 @@
</Items>
</f:Panel>
<f:Window ID="Window1" Title="检查通知维护" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Self" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Target="Parent" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Width="900px" Height="500px">
</f:Window>
<f:Window ID="WindowTeam" Title="维护检查工作组" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Self" EnableResize="true" runat="server" OnClose="WindowTeam_Close" IsModal="true"
Target="Parent" EnableResize="true" runat="server" OnClose="WindowTeam_Close" IsModal="true"
Width="900px" Height="500px">
</f:Window>
<%--<f:Window ID="Window3" Title="查看" ShowHeader="false" Hidden="true" EnableIFrame="true" EnableMaximize="true"
@@ -19,7 +19,7 @@
<Rows>
<f:FormRow runat="server">
<Items>
<f:TextBox ID="txtRectifyNoticesCode" runat="server" Label="编号" MaxLength="70" >
<f:TextBox ID="txtRectifyNoticesCode" runat="server" Label="编号" MaxLength="70" Required="true" ShowRedStar="true">
</f:TextBox>
<f:DropDownList ID="drpProjectId" runat="server" Label="受检项目"
LabelAlign="Right" EnableEdit="true">
@@ -51,10 +51,15 @@
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField ID="hdRectifyNoticesId" runat="server"></f:HiddenField>
<f:Button ID="btnSave" OnClick="btnSave_Click" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1" >
<f:Button ID="btnSave" OnClick="btnSave_Click" Icon="SystemSave" runat="server"
Text="保存" ValidateForms="SimpleForm1" >
</f:Button>
<f:Button ID="btnSubmit" OnClick="btnSubmit_Click" Icon="SystemSaveNew" runat="server" ToolTip="签发" ValidateForms="SimpleForm1" >
<f:Button ID="btnSubmit" OnClick="btnSubmit_Click" Icon="SystemSaveNew" runat="server"
Text="签发" ValidateForms="SimpleForm1" >
</f:Button>
<f:Button ID="btnSure" OnClick="btnSure_Click" Icon="Accept" runat="server" Hidden="true"
Text="复查确认" >
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
@@ -138,7 +143,7 @@
<Rows>
<f:FormRow runat="server" ID="next">
<Items>
<f:DropDownList ID="drpSignPerson" runat="server" Label="项目安全经理" LabelWidth="110px"
<f:DropDownList ID="drpSignPerson" runat="server" Label="整改责任人:项目安全经理" LabelWidth="200px"
LabelAlign="Right" EnableEdit="true" ShowRedStar="true">
</f:DropDownList>
<f:Label runat="server"></f:Label>
@@ -1,6 +1,8 @@
using BLL;
using FineUIPro.Web.DataShow;
using Model;
using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data;
@@ -42,57 +44,89 @@ namespace FineUIPro.Web.OfficeCheck.Check
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//受检项目
BLL.ProjectService.InitAllProjectDropDownList(this.drpProjectId, true);
///安全经理
BLL.Person_PersonsService.InitFlowOperateControlUserDropDownList(this.drpSignPerson, this.CurrUser.LoginProjectId, Const.UnitId_SEDIN, true);
///检察人员
BLL.Person_PersonsService.InitFlowOperateControlUserDropDownList(this.drpCheckMan, this.CurrUser.LoginProjectId, null, true);
{
string type = Request.Params["type"];
if (type == "1")
{
this.btnSave.Hidden = true;
this.btnAdd.Hidden = true;
this.btnSubmit.Hidden = true;
this.Grid1.Columns[8].Hidden = true;
}
this.CheckNoticeId = Request.Params["CheckNoticeId"];
if (!string.IsNullOrEmpty(this.CheckNoticeId))
var getRectify = ProjectSupervision_RectifyService.GetRectifyByCheckNoticeId(this.CheckNoticeId);
if (getRectify != null)
{
Model.ProjectSupervision_Rectify RectifyNotices = ProjectSupervision_RectifyService.GetRectifyByCheckNoticeId(this.CheckNoticeId);
if (RectifyNotices != null)
SetDrop(getRectify.ProjectId);
this.hdRectifyNoticesId.Text = getRectify.RectifyId;
if (!string.IsNullOrEmpty(getRectify.ProjectId))
{
this.hdRectifyNoticesId.Text = RectifyNotices.RectifyId;
if (!string.IsNullOrEmpty(RectifyNotices.ProjectId))
{
this.drpProjectId.SelectedValue = RectifyNotices.ProjectId;
}
if (!string.IsNullOrEmpty(RectifyNotices.CheckManIds))
{
this.drpCheckMan.SelectedValueArray = RectifyNotices.CheckManIds.Split(',');
}
this.txtCheckPerson.Text = RectifyNotices.CheckManNames;
this.txtRectifyNoticesCode.Text = RectifyNotices.RectifyCode;
this.txtCheckedDate.Text = RectifyNotices.CheckedDate.ToString();
if (!string.IsNullOrEmpty(RectifyNotices.HiddenHazardType))
{
this.drpHiddenHazardType.SelectedValue = RectifyNotices.HiddenHazardType;
}
if (!string.IsNullOrEmpty(RectifyNotices.SignPerson))
{
this.drpSignPerson.SelectedValue = RectifyNotices.SignPerson;
}
BindGrid();
this.drpProjectId.SelectedValue = getRectify.ProjectId;
}
else
if (!string.IsNullOrEmpty(getRectify.CheckManIds))
{
this.txtCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.drpCheckMan.SelectedValueArray = getRectify.CheckManIds.Split(',');
}
this.txtCheckPerson.Text = getRectify.CheckManNames;
this.txtRectifyNoticesCode.Text = getRectify.RectifyCode;
this.txtCheckedDate.Text = getRectify.CheckedDate.ToString();
if (!string.IsNullOrEmpty(getRectify.HiddenHazardType))
{
this.drpHiddenHazardType.SelectedValue = getRectify.HiddenHazardType;
}
if (!string.IsNullOrEmpty(getRectify.SignPerson))
{
this.drpSignPerson.SelectedValue = getRectify.SignPerson;
}
BindGrid();
if (getRectify.States == Const.State_1 || getRectify.States == Const.State_2)
{
this.btnSure.Hidden = false;
}
rectifyItemLists.Clear();
}
else
{
var getCheckNotice = CheckNoticeService.GetCheckNoticeById(this.CheckNoticeId);
if (getCheckNotice != null)
{
SetDrop(getCheckNotice.SubjectProjectId);
if (!string.IsNullOrEmpty(getCheckNotice.SubjectProjectId))
{
this.drpProjectId.SelectedValue = getCheckNotice.SubjectProjectId;
}
if (!string.IsNullOrEmpty(getCheckNotice.CheckTeamLeader))
{
this.drpCheckMan.SelectedValueArray = getCheckNotice.CheckTeamLeader.Split(',');
}
var getTeam = CheckTeamService.GetCheckTeamListByCheckNoticeId(this.CheckNoticeId);
foreach (var item in getTeam)
{
this.txtCheckPerson.Text += item.UserName + "、";
}
string perfix = DateTime.Now.Year.ToString()+ DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + "-";
this.txtRectifyNoticesCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode3", "dbo.ProjectSupervision_Rectify", "RectifyCode", perfix);
}
this.txtCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
}
rectifyItemLists.Clear();
}
}
private void SetDrop(string projectId)
{
//受检项目
BLL.ProjectService.InitAllProjectDropDownList(this.drpProjectId, true);
this.drpProjectId.SelectedValue = projectId;
///安全经理
BLL.Person_PersonsService.InitFlowOperateControlUserDropDownList(this.drpSignPerson, projectId, Const.UnitId_SEDIN, true);
///检察人员
BLL.Person_PersonsService.InitUserUnitIdDepartIdDropDownList(this.drpCheckMan, Const.UnitId_SEDIN, string.Empty, true);
}
/// <summary>
/// 绑定明细
/// </summary>
@@ -442,6 +476,17 @@ namespace FineUIPro.Web.OfficeCheck.Check
}
this.drpCheckMan.SelectedValueArray = str.ToArray();
}
#endregion
#endregion
protected void btnSure_Click(object sender, EventArgs e)
{
var getRectify = ProjectSupervision_RectifyService.GetRectifyByCheckNoticeId(this.CheckNoticeId);
if (getRectify != null)
{
saveNoticesItemDetail();//增加明细
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
}
}
}
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.OfficeCheck.Check {
public partial class RectifyEdit {
namespace FineUIPro.Web.OfficeCheck.Check
{
public partial class RectifyEdit
{
/// <summary>
/// form1 控件。
/// </summary>
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel4 控件。
/// </summary>
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel4;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtRectifyNoticesCode 控件。
/// </summary>
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRectifyNoticesCode;
/// <summary>
/// drpProjectId 控件。
/// </summary>
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpProjectId;
/// <summary>
/// drpCheckMan 控件。
/// </summary>
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCheckMan;
/// <summary>
/// txtCheckPerson 控件。
/// </summary>
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCheckPerson;
/// <summary>
/// txtCheckedDate 控件。
/// </summary>
@@ -92,7 +94,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtCheckedDate;
/// <summary>
/// drpHiddenHazardType 控件。
/// </summary>
@@ -101,7 +103,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpHiddenHazardType;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdRectifyNoticesId 控件。
/// </summary>
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdRectifyNoticesId;
/// <summary>
/// btnSave 控件。
/// </summary>
@@ -128,7 +130,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnSubmit 控件。
/// </summary>
@@ -137,7 +139,16 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSubmit;
/// <summary>
/// btnSure 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSure;
/// <summary>
/// Form2 控件。
/// </summary>
@@ -146,7 +157,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form Form2;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -155,7 +166,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// toolAdd 控件。
/// </summary>
@@ -164,7 +175,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar toolAdd;
/// <summary>
/// btnAdd 控件。
/// </summary>
@@ -173,7 +184,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAdd;
/// <summary>
/// tWrongContent 控件。
/// </summary>
@@ -182,7 +193,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox tWrongContent;
/// <summary>
/// tRequirement 控件。
/// </summary>
@@ -191,7 +202,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox tRequirement;
/// <summary>
/// txtLimitTimes 控件。
/// </summary>
@@ -200,7 +211,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtLimitTimes;
/// <summary>
/// txtRectifyResults 控件。
/// </summary>
@@ -209,7 +220,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRectifyResults;
/// <summary>
/// drpIsRectify 控件。
/// </summary>
@@ -218,7 +229,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList drpIsRectify;
/// <summary>
/// hdIsRectify 控件。
/// </summary>
@@ -227,7 +238,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdIsRectify;
/// <summary>
/// del 控件。
/// </summary>
@@ -236,7 +247,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.LinkButtonField del;
/// <summary>
/// Form3 控件。
/// </summary>
@@ -245,7 +256,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form Form3;
/// <summary>
/// next 控件。
/// </summary>
@@ -254,7 +265,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow next;
/// <summary>
/// drpSignPerson 控件。
/// </summary>
@@ -263,7 +274,7 @@ namespace FineUIPro.Web.OfficeCheck.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpSignPerson;
/// <summary>
/// WindowAtt 控件。
/// </summary>