2023-04-28

This commit is contained in:
李超 2023-04-28 14:56:47 +08:00
parent f2ab2d5b73
commit 5b740e7bda
35 changed files with 1321 additions and 519 deletions

Binary file not shown.

View File

@ -95,7 +95,7 @@ namespace BLL
Telephone = x.Telephone,
PhotoUrl = x.PhotoUrl,
DepartName = x.DepartName,
IsUsed = x.IsUsed == 1 ? true : false,
IsUsed = x.IsUsed .HasValue?x.IsUsed.Value.ToString():"",
IsUsedName = x.IsUsed == 0 ? "不启用" : "启用",
AuditorId = x.AuditorId,
AuditorName = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName,
@ -202,7 +202,7 @@ namespace BLL
Telephone = x.Telephone,
PhotoUrl = x.PhotoUrl,
DepartName = x.DepartName,
IsUsed = x.IsUsed==1?true:false,
IsUsed = x.IsUsed.HasValue?x.IsUsed.Value.ToString():"",
IsUsedName = x.IsUsed == 0 ? "不启用" : "启用",
AuditorId = x.AuditorId,
AuditorName = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName,
@ -400,7 +400,7 @@ namespace BLL
OutResult = x.OutResult,
Telephone = x.Telephone,
PhotoUrl = x.PhotoUrl,
IsUsed = x.IsUsed==1?true:false,
IsUsed = x.IsUsed.HasValue?x.IsUsed.ToString():"",
IsUsedName = (x.IsUsed == 1 ? "启用" : "未启用"),
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
@ -567,13 +567,19 @@ namespace BLL
/// <param name="workPostIds">培训岗位ID</param>
/// <param name="trainTypeId">培训类型ID</param>
/// <returns></returns>
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId)
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId,string InTime,string strParam)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
DateTime inDateTime=DateTime.Now;
if (!string.IsNullOrEmpty(InTime))
{
inDateTime = DateTime.Parse(InTime);
}
List<string> unitIdList = Funs.GetStrListByStr(unitIds, ',');
var getPersons = from x in db.View_SitePerson_Person
where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == 1
where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == 1 &&(string.IsNullOrEmpty(strParam)||x.PersonName.Contains(strParam)) && (string.IsNullOrEmpty(InTime) || x.InTime < inDateTime)
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now)
select new Model.PersonItem
{
@ -723,13 +729,9 @@ namespace BLL
{
newPerson.ViceCNProfessionalId = person.ViceCNProfessionalId;
}
if (person.IsUsed == true)
if (!string.IsNullOrEmpty(person.IsUsed))
{
newPerson.IsUsed = 1;
}
else
{
newPerson.IsUsed = 0;
newPerson.IsUsed = int.Parse(person.IsUsed);
}
newPerson.Password = PersonService.GetPersonPassWord(person.IdentityCard);
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
@ -808,7 +810,10 @@ namespace BLL
}
else
{
getPerson.IsUsed = person.IsUsed?1:0;
if (!string.IsNullOrEmpty(person.IsUsed))
{
getPerson.IsUsed = int.Parse(person.IsUsed);
}
getPerson.AuditorDate = DateTime.Now;
}
getPerson.AuditorId = person.AuditorId;

View File

@ -35,6 +35,7 @@ namespace BLL
TestScores = x.TestScores ?? 0,
TestType = x.TestType,
TemporaryUser = x.TemporaryUser,
Signature= x.Signature
}).ToList();
foreach(var item in getDataLists)
@ -90,6 +91,7 @@ namespace BLL
TestScores = x.TestScores ?? 0,
TestType = x.TestType,
TemporaryUser = x.TemporaryUser,
Signature= x.Signature
};
var res = getDataLists.FirstOrDefault();
if (res != null)
@ -845,5 +847,29 @@ namespace BLL
}
}
#endregion
/// <summary>
/// 修改考试记录信息
/// </summary>
/// <param name="Training"></param>
public static void updateTestRecord(Model.Training_TestRecord testRecord)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Training_TestRecord newTestRecord = db.Training_TestRecord.FirstOrDefault(e => e.TestRecordId == testRecord.TestRecordId);
if (newTestRecord != null)
{
newTestRecord.TestScores = testRecord.TestScores;
newTestRecord.TestEndTime = testRecord.TestEndTime;
newTestRecord.IsFiled = testRecord.IsFiled;
newTestRecord.Signature = testRecord.Signature;
newTestRecord.Fingerprint = testRecord.Fingerprint;
db.SubmitChanges();
}
}
}
}
}

View File

@ -1451,7 +1451,17 @@
sb.Append("<table width=\"100% \" cellspacing=\"0\" rules=\"all\" border=\"0\" style=\"border-collapse:collapse;font-size: 10.5pt;\">");
sb.Append("<tr style=\"height: 35px\">");
sb.AppendFormat("<td align=\"left\" style=\"width:25%; \">{0}</td> ", "姓名:" + testName);
if (!string.IsNullOrEmpty(getTestRecord.Signature))
{
sb.AppendFormat("<td align=\"left\" style=\"width:25%; \"><img width='100' height='100' src='" + (Funs.SGGLUrl + getTestRecord.Signature).Replace('\\', '/') + "'></img></td> ");
}
else
{
sb.AppendFormat("<td align=\"left\" style=\"width:25%; \"><img width='100' height='100' src='~/res/qiaming.png'></img></td> ");
//sb.AppendFormat("<td align=\"left\" style=\"width:25%; \">{0}</td> ", "姓名:" + testName);
}
sb.AppendFormat("<td align=\"left\" style=\"width:50%;\">{0}</td> ", "身份证号:" + idCard);
sb.AppendFormat("<td align=\"left\" style=\"width:25%;\">{0}</td> ", "分数:" + (getTestRecord.TestScores ?? 0).ToString());
sb.Append("</tr>");

View File

@ -58,7 +58,7 @@ namespace FineUIPro.Web.CQMS.Foreign
,[Memo]
,[CheckDate]
,[FileType]
FROM CQMS_Foreign_ITPListProject where 1=1 ";
FROM CQMS_Foreign_ITPListProject where ProjectId='"+this.CurrUser.LoginProjectId+"' ";
List<SqlParameter> listStr = new List<SqlParameter>();

View File

@ -1 +1,98 @@


错误信息开始=====>
错误类型:HttpException
错误信息:文件“/HSSE/AttachFile/webuploader.aspx”不存在。
错误堆栈:
在 System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
在 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
在 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
在 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
在 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
在 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
在 System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)
在 System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
出错时间:04/25/2023 18:54:47
出错文件:http://localhost:1295/HSSE/AttachFile/webuploader.aspx?toKeyId=&path=FileUpload/SafePersonQualityAttachUrl&menuId=750F5074-45B9-470E-AE1E-6204957421E6&type=-1
IP地址:::1
出错时间:04/25/2023 18:54:47
错误信息开始=====>
错误类型:SqlException
错误信息:参数化查询 '(@ProjectId nvarchar(4000))SELECT DISTINCT PersonQuality.SafePer' 需要参数 '@ProjectId',但未提供该参数。
错误堆栈:
在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
在 System.Data.SqlClient.SqlDataReader.get_MetaData()
在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
在 BLL.SQLHelper.GetDataTableRunText(String strSql, SqlParameter[] parameters) 位置 D:\project\vs\sggl_cd\SGGL\BLL\SQLHelper.cs:行号 311
在 FineUIPro.Web.HSSE.QualityAudit.SafePersonQuality.BindGrid() 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\QualityAudit\SafePersonQuality.aspx.cs:行号 102
在 FineUIPro.Web.HSSE.QualityAudit.SafePersonQuality.Page_Load(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\QualityAudit\SafePersonQuality.aspx.cs:行号 60
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
在 System.EventHandler.Invoke(Object sender, EventArgs e)
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:04/25/2023 19:01:25
出错文件:http://localhost:1295/HSSE/QualityAudit/SafePersonQuality.aspx
IP地址:::1
操作人员:JT
出错时间:04/25/2023 19:01:25
错误信息开始=====>
错误类型:NullReferenceException
错误信息:未将对象引用设置到对象的实例。
错误堆栈:
在 FineUIPro.Web.CQMS.Check.EditJointCheck.Page_Load(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\CQMS\Check\EditJointCheck.aspx.cs:行号 58
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
在 System.EventHandler.Invoke(Object sender, EventArgs e)
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:04/26/2023 15:31:55
出错文件:http://localhost:1295/CQMS/Check/EditJointCheck.aspx
IP地址:::1
操作人员:JT
出错时间:04/26/2023 15:31:55
错误信息开始=====>
错误类型:HttpCompileException
错误信息:d:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\Check\CheckSpecial.aspx(56): error CS1061: “ASP.hsse_check_checkspecial_aspx”不包含“drpType_SelectedIndexChanged”的定义并且找不到可接受类型为“ASP.hsse_check_checkspecial_aspx”的第一个参数的扩展方法“drpType_SelectedIndexChanged”(是否缺少 using 指令或程序集引用?)
错误堆栈:
在 System.Web.Compilation.AssemblyBuilder.Compile()
在 System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
在 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
在 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
在 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
在 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
在 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
在 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
在 System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)
在 System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
出错时间:04/27/2023 15:21:49
出错文件:http://localhost:1295/HSSE/Check/CheckSpecial.aspx
IP地址:::1
出错时间:04/27/2023 15:21:49

View File

@ -38,7 +38,7 @@
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="专项检查" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="CheckSpecialId" DataIDField="CheckSpecialId" AllowSorting="true" SortField="CheckTime"
runat="server" BoxFlex="1" DataKeyNames="CheckSpecialId" DataIDField="CheckSpecialId" AllowSorting="true" SortField="index"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="true" ForceFit="true"
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True"
@ -53,11 +53,10 @@
<f:RadioItem Text="已完成" Value="2" />
</f:RadioButtonList>
<f:ToolbarSeparator runat="server"></f:ToolbarSeparator>
<f:RadioButtonList runat="server" ID="rbType" Width="180px" AutoPostBack="true" OnSelectedIndexChanged="rbStates_SelectedIndexChanged">
<f:RadioItem Text="全部" Value="-1" Selected="true" />
<f:RadioItem Text="专项" Value="0" />
<f:RadioItem Text="联合" Value="1" />
</f:RadioButtonList>
<f:DropDownList ID="drpType" runat="server" Label="类型" Width="180px" LabelWidth="50px" AutoPostBack="true"
OnSelectedIndexChanged="drpType_SelectedIndexChanged"
EnableEdit="true">
</f:DropDownList>
<f:ToolbarSeparator runat="server"></f:ToolbarSeparator>
<f:DropDownList ID="drpSupCheckItemSet" runat="server" Label="类别" AutoPostBack="true"
OnSelectedIndexChanged="drpSupCheckItemSet_SelectedIndexChanged" Width="180px"
@ -84,7 +83,7 @@
<f:TemplateField ColumnID="tfNumber" Width="55px" HeaderText="序号" HeaderTextAlign="Center"
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
<asp:Label ID="labNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="200px" ColumnID="CheckSpecialCode" DataField="CheckSpecialCode"
@ -102,10 +101,15 @@
<f:RenderField Width="200px" ColumnID="CheckTime" DataField="CheckTime" SortField="CheckTime"
FieldType="Date" Renderer="Date" HeaderText="检查日期" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="StatesName" DataField="StatesName"
SortField="StatesName" FieldType="String" HeaderText="状态" TextAlign="Left"
HeaderTextAlign="Center">
</f:RenderField>
<f:TemplateField ColumnID="StatesName" Width="100px" HeaderText="状态" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="labStatesName" runat="server" Text='<%# ConvertState(Eval("CheckSpecialId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
</Columns>
<Listeners>
<f:Listener Event="dataload" Handler="onGridDataLoad" />
@ -127,13 +131,16 @@
</f:Panel>
<f:Window ID="Window1" Title="详细" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="1200px" Height="540px">
Width="1400px" Height="540px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<Items>
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Hidden="true"
Text="修改" Icon="Pencil" OnClick="btnMenuModify_Click">
</f:MenuButton>
<f:MenuButton ID="btnMenuClose" EnablePostBack="true" runat="server" Hidden="true"
Text="闭环" Icon="TabGo" OnClick="btnMenuClose_Click">
</f:MenuButton>
<f:MenuButton ID="btnPrinter" EnablePostBack="true" runat="server"
Text="导出" Icon="Printer" OnClick="btnPrinter_Click" EnableAjax="false" DisableControlBeforePostBack="false">
</f:MenuButton>

View File

@ -37,6 +37,16 @@ namespace FineUIPro.Web.HSSE.Check
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
ListItem[] item = new ListItem[5];
item[0] = new ListItem("请选择", "-1");
item[1] = new ListItem("专项检查", "0");
item[2] = new ListItem("安全周检", "1");
item[3] = new ListItem("安全月检", "2");
item[4] = new ListItem("节前节后安全检查", "3");
this.drpType.DataValueField = "Value";
this.drpType.DataTextField = "Text";
this.drpType.DataSource = item;
this.drpType.DataBind();
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.ProjectId)
{
@ -57,38 +67,40 @@ namespace FineUIPro.Web.HSSE.Check
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT CheckSpecial.CheckSpecialId,CodeRecords.Code AS CheckSpecialCode,"
+ @" CheckItemSet.CheckItemName,CheckSpecial.CheckTime,(CASE WHEN CheckSpecial.CheckType ='1' THEN '联合检查' ELSE '专项检查' END) AS CheckTypeName"
string strSql = @"SELECT 0 [index], CheckSpecial.CheckSpecialId,CodeRecords.Code AS CheckSpecialCode,"
+ @" CASE WHEN CheckSpecial.CheckType ='0' THEN CheckItemSet.CheckItemName else '综合大检查' end CheckItemName ,CheckSpecial.CheckTime,
(CASE WHEN CheckSpecial.CheckType ='1' THEN ''
WHEN CheckSpecial.CheckType ='2' THEN ''
WHEN CheckSpecial.CheckType ='3' THEN ''
WHEN CheckSpecial.CheckType ='0' THEN ''
ELSE '' END) AS CheckTypeName"
+ @" ,(CASE WHEN CheckSpecial.States='2' THEN '已完成' WHEN CheckSpecial.States='1' THEN '待整改' ELSE '待提交' END) AS StatesName"
+ @" FROM Check_CheckSpecial AS CheckSpecial "
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON CheckSpecial.CheckSpecialId=CodeRecords.DataId "
+ @" LEFT JOIN Technique_CheckItemSet AS CheckItemSet ON CheckItemSet.CheckItemSetId = CheckSpecial.CheckItemSetId where 1=1";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND CheckSpecial.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (this.rbStates.SelectedValue!="-1")
{
strSql += " AND CheckSpecial.States = @States";
listStr.Add(new SqlParameter("@States", this.rbStates.SelectedValue));
}
if (this.rbType.SelectedValue != "-1")
if (this.drpType.SelectedValue != "-1")
{
if (this.rbType.SelectedValue == "1")
{
strSql += " AND CheckSpecial.CheckType = @CheckType";
listStr.Add(new SqlParameter("@CheckType", this.rbType.SelectedValue));
}
else
{
strSql += " AND (CheckSpecial.CheckType = @CheckType OR CheckSpecial.CheckType IS NULL) ";
listStr.Add(new SqlParameter("@CheckType", this.rbType.SelectedValue));
}
listStr.Add(new SqlParameter("@CheckType", this.drpType.SelectedValue));
}
if (this.drpSupCheckItemSet.SelectedValue!=BLL.Const._Null)
if (this.drpSupCheckItemSet.SelectedValue != BLL.Const._Null)
{
strSql += " AND CheckSpecial.CheckItemSetId = @CheckItemSetId";
listStr.Add(new SqlParameter("@CheckItemSetId", this.drpSupCheckItemSet.SelectedValue ));
if (drpSupCheckItemSet.SelectedValue != "0"&& drpSupCheckItemSet.SelectedValue != "-1")
{
strSql += " AND CheckSpecial.CheckItemSetId = @CheckItemSetId";
listStr.Add(new SqlParameter("@CheckItemSetId", this.drpSupCheckItemSet.SelectedValue));
}
}
if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim()))
{
@ -103,7 +115,13 @@ namespace FineUIPro.Web.HSSE.Check
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
if (tb != null)
{
foreach (DataRow row in tb.Rows)
{
row["index"] = int.Parse(System.Text.RegularExpressions.Regex.Replace(row["CheckSpecialCode"].ToString(), @"[^0-9]+", ""));
}
}
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
@ -245,25 +263,33 @@ namespace FineUIPro.Web.HSSE.Check
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
try
{
return;
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectCheckSpecialMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuModify.Hidden = false;
this.btnMenuClose.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDel.Hidden = false;
}
}
}
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectCheckSpecialMenuId);
if (buttonList.Count() > 0)
catch (Exception e)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuModify.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDel.Hidden = false;
}
}
}
#endregion
@ -297,8 +323,32 @@ namespace FineUIPro.Web.HSSE.Check
this.BindGrid();
}
protected void drpSupCheckItemSet_SelectedIndexChanged(object sender, EventArgs e)
protected void drpType_SelectedIndexChanged(object sender, EventArgs e)
{
drpSupCheckItemSet.Items.Clear();
if (drpType.SelectedValue == "0")
{
Technique_CheckItemSetService.InitCheckItemSetDropDownList(this.drpSupCheckItemSet, "2", "0", true);
}
else
{
ListItem[] item = new ListItem[2];
item[0] = new ListItem("请选择", "-1");
item[1] = new ListItem("联合", "0");
this.drpSupCheckItemSet.DataValueField = "Value";
this.drpSupCheckItemSet.DataTextField = "Text";
this.drpSupCheckItemSet.DataSource = item;
this.drpSupCheckItemSet.DataBind();
}
this.drpSupCheckItemSet.SelectedIndex = 0;
this.BindGrid();
}
protected void drpSupCheckItemSet_SelectedIndexChanged(object sender, EventArgs e)
{
this.BindGrid();
}
@ -356,8 +406,9 @@ namespace FineUIPro.Web.HSSE.Check
string filePath = string.Empty;
initTemplatePath = "File\\Word\\HSSE\\专项检查.doc";
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".doc");
filePath = initTemplatePath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf");
string docfilename = Funs.GetNewFileName();
newUrl = uploadfilepath.Replace(".doc", docfilename + ".doc");
filePath = initTemplatePath.Replace(".doc", docfilename + ".pdf");
if (File.Exists(newUrl)) {
File.Delete(newUrl);
}
@ -467,7 +518,7 @@ namespace FineUIPro.Web.HSSE.Check
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 60;
builder.CellFormat.Width = 120;
builder.Write(string.IsNullOrEmpty(detail.UnitName) ? "" : detail.UnitName);
//问题描述
builder.InsertCell();
@ -475,7 +526,7 @@ namespace FineUIPro.Web.HSSE.Check
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 140;
builder.CellFormat.Width = 40;
builder.Write(string.IsNullOrEmpty(detail.Unqualified) ? "" : detail.Unqualified);
//问题类型
builder.InsertCell();
@ -483,7 +534,7 @@ namespace FineUIPro.Web.HSSE.Check
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 60;
builder.CellFormat.Width = 100;
builder.Write(string.IsNullOrEmpty(detail.CheckItemName)?"": detail.CheckItemName);
//处理结果
@ -501,7 +552,7 @@ namespace FineUIPro.Web.HSSE.Check
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 50;
builder.Write(string.IsNullOrEmpty(detail.HiddenHazardTypeName) ? "" : detail.HiddenHazardTypeName);
builder.Write(string.IsNullOrEmpty(detail.RiskLevel) ? "" : detail.RiskLevel);
builder.EndRow();
num++;
}
@ -527,5 +578,82 @@ namespace FineUIPro.Web.HSSE.Check
File.Delete(pdfUrl);
}
#endregion
#region
/// <summary>
/// 闭环按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuClose_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string CheckSpecialId = Grid1.SelectedRowID.Split(',')[0];
var checkSpecial = BLL.Check_CheckSpecialService.GetCheckSpecialByCheckSpecialId(CheckSpecialId);
if (checkSpecial != null)
{
var details = BLL.Check_CheckSpecialDetailService.GetCheckSpecialDetailByCheckSpecialId(CheckSpecialId);
foreach (var item in details)
{
item.CompleteStatus = true;
BLL.Check_CheckSpecialDetailService.UpdateCheckSpecialDetail(item);
}
checkSpecial.States = Const.State_2;
Check_CheckSpecialService.UpdateCheckSpecial(checkSpecial);
var hazardRegisters = from x in Funs.DB.HSSE_Hazard_HazardRegister where x.CheckSpecialId == CheckSpecialId select x;
foreach (var item in hazardRegisters)
{
item.States = "3";
BLL.HSSE_Hazard_HazardRegisterService.UpdateHazardRegister(item);
}
BindGrid();
ShowNotify("闭环成功!", MessageBoxIcon.Success);
}
}
#endregion
protected string ConvertState(object state)
{
if (state != null)
{
var checkSpecial = Funs.DB.Check_CheckSpecial.Where(y => y.CheckSpecialId == state.ToString()).FirstOrDefault();
if (checkSpecial != null)
{
if (checkSpecial.States == "2")
{
return "已完成";
}
else if (checkSpecial.States == "1")
{
var details = Funs.DB.Check_CheckSpecialDetail.Where(x => x.CheckSpecialId == state.ToString()).ToList();
if (details != null && details.Count > 0)
{
string res = "待整改";
foreach (var d in details)
{
if (d.CompleteStatus.HasValue && d.CompleteStatus.Value)
{
res = "部分待整改";
}
}
return res;
}
}
else
{
return "待提交";
}
}
}
return "";
}
}
}

View File

@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Check {
public partial class CheckSpecial {
namespace FineUIPro.Web.HSSE.Check
{
public partial class CheckSpecial
{
/// <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>
/// Toolbar2 控件。
/// </summary>
@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// rbStates 控件。
/// </summary>
@ -65,16 +67,16 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rbStates;
/// <summary>
/// rbType 控件。
/// drpType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rbType;
protected global::FineUIPro.DropDownList drpType;
/// <summary>
/// drpSupCheckItemSet 控件。
/// </summary>
@ -83,7 +85,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpSupCheckItemSet;
/// <summary>
/// txtStartTime 控件。
/// </summary>
@ -92,7 +94,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStartTime;
/// <summary>
/// txtEndTime 控件。
/// </summary>
@ -101,7 +103,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@ -110,7 +112,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnNew 控件。
/// </summary>
@ -119,7 +121,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnOut 控件。
/// </summary>
@ -128,16 +130,25 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// lblNumber 控件。
/// labNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblNumber;
protected global::System.Web.UI.WebControls.Label labNumber;
/// <summary>
/// labStatesName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label labStatesName;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@ -146,7 +157,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
@ -155,7 +166,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
@ -164,7 +175,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
@ -173,7 +184,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Menu1 控件。
/// </summary>
@ -182,7 +193,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuModify 控件。
/// </summary>
@ -191,7 +202,16 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuModify;
/// <summary>
/// btnMenuClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuClose;
/// <summary>
/// btnPrinter 控件。
/// </summary>
@ -200,7 +220,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnPrinter;
/// <summary>
/// btnMenuDel 控件。
/// </summary>

View File

@ -1,23 +1,25 @@
<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="CheckSpecialEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.Check.CheckSpecialEdit" %>
<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" TagPrefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>编辑专项检查</title>
<link href="~/res/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.labcenter {
text-align: center;
}
<link href="~/res/css/common.css" rel="stylesheet" type="text/css" />
.f-grid-row.burlywood {
<style type="text/css">
.labcenter
{
text-align: center;
}
.f-grid-row.burlywood
{
background-color: burlywood;
background-image: none;
}
.fontred {
.fontred
{
color: #FF7575;
background-image: none;
}
@ -25,147 +27,166 @@
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow ColumnWidths="30% 15% 30% 30%">
<Items>
<f:TextBox ID="txtCheckSpecialCode" runat="server" Label="检查编号" Readonly="true" MaxLength="50">
</f:TextBox>
<f:RadioButtonList runat="server" ID="rbType"
AutoPostBack="true" OnSelectedIndexChanged="rbType_SelectedIndexChanged">
<f:RadioItem Text="专项" Value="0" Selected="true" />
<f:RadioItem Text="联合" Value="1" />
</f:RadioButtonList>
<f:DropDownList ID="drpSupCheckItemSet" runat="server" Label="检查类别"
AutoPostBack="true" OnSelectedIndexChanged="drpSupCheckItemSet_SelectedIndexChanged"
EnableEdit="true">
</f:DropDownList>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="检查日期" ID="txtCheckDate" EnableEdit="false">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="35% 35% 30%">
<Items>
<f:DropDownList ID="drpPartInPersons" runat="server" Label="参检人员" EnableEdit="true" EnableMultiSelect="true"
ForceSelection="false" MaxLength="2000" EnableCheckBoxSelect="true"
AutoPostBack="true" OnSelectedIndexChanged="drpPartInPersons_SelectedIndexChanged">
</f:DropDownList>
<f:TextBox runat="server" ID="txtPartInPersonNames" MaxLength="1000" Label="补充人员"></f:TextBox>
<f:Button ID="btnNew" Text="新增检查" Icon="Add" EnablePostBack="false" runat="server" MarginLeft="50px">
</f:Button>
<%-- <f:Button ID="btnDelete" Text="删除" Icon="Delete" EnablePostBack="false" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow ColumnWidths="25% 25% 25% 30%">
<Items>
<f:TextBox ID="txtCheckSpecialCode" runat="server" Label="检查编号" Readonly="true" MaxLength="50">
</f:TextBox>
<f:DropDownList ID="drpType" runat="server" Label="检查类型"
EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpSupCheckItemSet" runat="server" Label="检查类别"
AutoPostBack="true"
EnableEdit="true">
</f:DropDownList>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="检查日期" ID="txtCheckDate" EnableEdit="false">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="35% 35% 30%">
<Items>
<f:DropDownList ID="drpPartInPersons" runat="server" Label="参检人员" EnableEdit="true" EnableMultiSelect="true"
ForceSelection="false" MaxLength="2000" EnableCheckBoxSelect="true"
AutoPostBack="true" OnSelectedIndexChanged="drpPartInPersons_SelectedIndexChanged">
</f:DropDownList>
<f:TextBox runat="server" ID="txtPartInPersonNames" MaxLength="1000" Label="补充人员" ></f:TextBox>
<f:Button ID="btnNew" Text="新增检查" Icon="Add" OnClick="btnAdd_Click" runat="server" MarginLeft="50px">
</f:Button>
<%-- <f:Button ID="btnDelete" Text="删除" Icon="Delete" EnablePostBack="false" runat="server">
</f:Button>--%>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" DataIDField="CheckSpecialDetailId"
DataKeyNames="CheckSpecialDetailId" ShowGridHeader="true" SortField="SortIndex" SortDirection="ASC"
MinHeight="350px" AllowCellEditing="true" ClicksToEdit="1" AllowSorting="true" EnableColumnLines="true"
OnPreDataBound="Grid1_PreDataBound" EnableTextSelection="True" OnSort="Grid1_Sort"
OnRowCommand="Grid1_RowCommand">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
TextAlign="Center" />
<f:RenderField Width="130px" ColumnID="CheckAreaName" DataField="CheckAreaName" SortField="CheckAreaName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="单位工程">
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" DataIDField="CheckSpecialDetailId"
DataKeyNames="CheckSpecialDetailId" ShowGridHeader="true" SortField="SortIndex" SortDirection="ASC" OnRowCommand="Grid1_RowCommand"
MinHeight="350px" AllowCellEditing="true" ClicksToEdit="1" AllowSorting="true" EnableColumnLines="true" OnPreDataBound="Grid1_PreDataBound"
EnableTextSelection="True" OnSort="Grid1_Sort">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
TextAlign="Center" />
<f:RenderField Width="100px" ColumnID="CheckAreaName" DataField="CheckAreaName" SortField="CheckAreaName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="单位工程">
<Editor>
<f:DropDownList ID="drpCheckArea" Required="true" runat="server" EnableEdit="true" ShowRedStar="true">
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="150px" ColumnID="UnitName" DataField="UnitName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="受检单位">
<Editor>
<f:DropDownList ID="drpWorkUnit" runat="server" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="drpWorkUnit_SelectedIndexChanged" >
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="100px" ColumnID="HSEManage" DataField="HSEManage" SortField="HSEManage"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="HSE经理">
<Editor>
<f:DropDownList ID="drpCheckArea" Required="true" runat="server" EnableEdit="true" ShowRedStar="true">
<f:DropDownList ID="drpHSE" Required="true" runat="server" EnableEdit="true" ShowRedStar="true">
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="240px" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="受检单位">
<Editor>
<f:DropDownList ID="drpWorkUnit" Required="true" runat="server" EnableEdit="true" ShowRedStar="true">
</f:DropDownList>
</f:RenderField>
<f:RenderField Width="150px" ColumnID="Unqualified" DataField="Unqualified"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="问题描述">
<Editor>
<f:TextBox ID="txtUnqualified" runat="server" ShowRedStar="true">
</f:TextBox>
</Editor>
</f:RenderField>
<f:LinkButtonField Width="90px" HeaderText="问题图片" ConfirmTarget="Top" CommandName="attchUrl"
TextAlign="Center" ToolTip="上传" Text="上传" />
<f:RenderField Width="150px" ColumnID="CheckItemName" DataField="CheckItemName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="问题类型">
<Editor>
<f:DropDownList ID="drpCheckItem" runat="server" EnableEdit="true" AutoPostBack="true"
OnSelectedIndexChanged="drpCheckItem_SelectedIndexChanged">
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="150px" ColumnID="RiskLevel" DataField="RiskLevel"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="风险级别">
<Editor>
<f:DropDownList ID="drpRiskLevel" runat="server" EnableEdit="true" >
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="80px" ColumnID="CompleteStatusName" DataField="CompleteStatusName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="现场处理结果">
<Editor>
<f:DropDownList ID="drpCompleteStatus" Required="true" runat="server" EnableEdit="true" ShowRedStar="true">
<f:ListItem Text="待整改" Value="待整改" Selected="true"/>
<f:ListItem Text="已整改" Value="已整改"/>
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="150px" ColumnID="Unqualified" DataField="Unqualified"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="问题描述" ExpandUnusedSpace="true">
<Editor>
<f:TextBox ID="txtUnqualified" runat="server" ShowRedStar="true">
</f:TextBox>
</f:RenderField>
<f:RenderField Width="80px" ColumnID="RectifyOpinion" DataField="RectifyOpinion"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="处理方式">
<Editor>
<f:DropDownList ID="drpHandleWay" Required="true" runat="server" EnableEdit="true" ShowRedStar="true">
<f:ListItem Text="" Value="" Selected="true"/>
<f:ListItem Text="当场纠正" Value="当场纠正" />
<f:ListItem Text="口头警告" Value="口头警告"/>
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="150px" ColumnID="CheckItemName" DataField="CheckItemName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="问题类型">
<Editor>
<f:DropDownList ID="drpCheckItem" runat="server" EnableEdit="true" AutoPostBack="true"
OnSelectedIndexChanged="drpCheckItem_SelectedIndexChanged">
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="80px" ColumnID="CompleteStatusName" DataField="CompleteStatusName" SortField="CompleteStatusName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="处理结果">
<Editor>
<f:DropDownList ID="drpCompleteStatus" Required="true" runat="server" EnableEdit="true" ShowRedStar="true">
<f:ListItem Text="待整改" Value="待整改" Selected="true" />
<f:ListItem Text="已整改" Value="已整改" />
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="150px" ColumnID="HandleStepStr" DataField="HandleStepStr" SortField="HandleStepStr"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="处理措施">
<Editor>
<f:DropDownList ID="drpHandleStep" Required="true" EnableCheckBoxSelect="true" runat="server" EnableEdit="true" EnableMultiSelect="true">
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="80px" ColumnID="HiddenHazardTypeName" DataField="HiddenHazardTypeName" SortField="HiddenHazardType"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="隐患类别">
<Editor>
<f:DropDownList ID="drpHiddenHazardType" Required="true" runat="server" EnableEdit="true" ShowRedStar="true">
<f:ListItem Text="一般" Value="一般" Selected="true" />
<f:ListItem Text="较大" Value="较大" />
<f:ListItem Text="重大" Value="重大" />
</f:DropDownList>
</Editor>
</f:RenderField>
<f:LinkButtonField Width="90px" HeaderText="问题图片" ConfirmTarget="Top" CommandName="attchUrl"
TextAlign="Center" ToolTip="附件上传查看" Text="详情" />
<f:LinkButtonField ColumnID="Delete" Width="50px" EnablePostBack="false" Icon="Delete"
HeaderTextAlign="Center" HeaderText="删除" />
<f:RenderField Width="1px" ColumnID="CheckSpecialDetailId" DataField="CheckSpecialDetailId"
SortField="CheckSpecialDetailId" FieldType="String" HeaderText="ID" Hidden="true">
</f:RenderField>
</Columns>
<Listeners>
<%-- <f:Listener Event="beforeedit" Handler="onGridBeforeEdit" />--%>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
<f:Listener Event="afteredit" Handler="onGridAfterEdit" />
</Listeners>
</f:Grid>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Label runat="server" ID="lbTemp"></f:Label>
<f:Button ID="btnAttachUrl" Text="附件" ToolTip="附件上传及查看" Icon="TableCell" runat="server" OnClick="btnAttachUrl_Click"
ValidateForms="SimpleForm1">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnSubmit" Icon="SystemSaveNew" runat="server" ToolTip="提交" ValidateForms="SimpleForm1"
OnClick="btnSubmit_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</f:RenderField>
<f:RenderField Width="120px" ColumnID="LimitedDate" DataField="LimitedDate" FieldType="Date"
Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="限时日期">
<Editor>
<f:DatePicker ID="dpLimitedDate" Required="true" runat="server">
</f:DatePicker>
</Editor>
</f:RenderField>
<f:RenderField Width="150px" ColumnID="Suggestions" DataField="Suggestions"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="整改要求" ExpandUnusedSpace="true">
<Editor>
<f:TextBox ID="txtSuggest" runat="server" ShowRedStar="true">
</f:TextBox>
</Editor>
</f:RenderField>
<f:LinkButtonField ColumnID="Delete" Width="50px" EnablePostBack="false" Icon="Delete"
HeaderTextAlign="Center" HeaderText="删除" />
</Columns>
<Listeners>
<%-- <f:Listener Event="beforeedit" Handler="onGridBeforeEdit" />--%>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
<%--<f:Listener Event="afteredit" Handler="onGridAfterEdit" />--%>
</Listeners>
</f:Grid>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Label runat="server" ID="lbTemp"></f:Label>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnSubmit" Icon="SystemSaveNew" runat="server" ToolTip="提交" ValidateForms="SimpleForm1"
OnClick="btnSubmit_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</form>
<script src="../../Controls/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
@ -173,7 +194,7 @@
return false;
}
var grid1ClientID = '<%= Grid1.ClientID %>';
<%-- var grid1ClientID = '<%= Grid1.ClientID %>';
var drpCompleteStatusClientID = '<%= drpCompleteStatus.ClientID %>';
var drpHandleStepClientID = '<%= drpHandleStep.ClientID %>';
var drpHiddenHazardTypeClientID = '<%= drpHiddenHazardType.ClientID %>';
@ -181,9 +202,9 @@
function onGridAfterEdit(event, value, params) {
var grid = F(grid1ClientID);
var drpHiddenHazardType = F(drpHiddenHazardTypeClientID);
var drpHandleStep = F(drpHandleStepClientID);
if (params.columnId === 'CompleteStatusName') {
var CompleteStatusName = grid.getCellValue(params.rowId, 'CompleteStatusName');
var drpHandleStep = F(drpHandleStepClientID);
if (params.columnId === 'CompleteStatusName') {
var CompleteStatusName = grid.getCellValue(params.rowId, 'CompleteStatusName');
if (CompleteStatusName.indexOf("待整改") != -1) {
drpHandleStep.enable();
drpHandleStep.setEmptyText('');
@ -197,17 +218,18 @@
}
if (params.columnId === 'HandleStepStr') {
var HandleStepStr = grid.getCellValue(params.rowId, 'HandleStepStr');
var HandleStepStr = grid.getCellValue(params.rowId, 'HandleStepStr');
if (HandleStepStr.indexOf("整改通知单") != -1) {
drpHiddenHazardType.enable();
drpHiddenHazardType.setEmptyText('一般');
// drpHandleStep.loadData(shidata);
// drpHandleStep.loadData(shidata);
} else {
drpHiddenHazardType.setEmptyText('');
drpHiddenHazardType.disable();
}
}
}
}--%>
</script>
</body>
</html>

View File

@ -1,4 +1,5 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@ -38,12 +39,25 @@ namespace FineUIPro.Web.HSSE.Check
ViewState["ProjectId"] = value;
}
}
//public List<View_CheckSpecialDetail> details
//{
// get
// {
// return (List<View_CheckSpecialDetail>)ViewState["details"];
// }
// set
// {
// ViewState["details"] = value;
// }
//}
/// <summary>
/// 定义集合
/// </summary>
//private static List<Model.View_CheckSpecialDetail> checkSpecialDetails = new List<Model.View_CheckSpecialDetail>();
private static List<Model.View_CheckSpecialDetail> details = new List<Model.View_CheckSpecialDetail>();
#endregion
// public List<View_CheckSpecialDetail> details = new List<View_CheckSpecialDetail>();
#region
/// <summary>
/// 加载页面
@ -60,8 +74,11 @@ namespace FineUIPro.Web.HSSE.Check
this.InitCheckItemSetDropDownList();
this.CheckSpecialId = Request.Params["CheckSpecialId"];
var checkSpecial = Check_CheckSpecialService.GetCheckSpecialByCheckSpecialId(this.CheckSpecialId);
Technique_CheckItemSetService.InitCheckItemSetNameDropDownList(this.drpSupCheckItemSet, "2", "0", false);
if (checkSpecial != null)
{
details.Clear();
this.ProjectId = checkSpecial.ProjectId;
if (this.ProjectId != this.CurrUser.LoginProjectId)
{
@ -70,7 +87,7 @@ namespace FineUIPro.Web.HSSE.Check
if (!String.IsNullOrEmpty(checkSpecial.CheckType))
{
this.rbType.SelectedValue = checkSpecial.CheckType;
this.drpType.SelectedValue = checkSpecial.CheckType;
}
this.InitCheckItemSetDropDownList();
this.txtCheckSpecialCode.Text = CodeRecordsService.ReturnCodeByDataId(this.CheckSpecialId);
@ -89,16 +106,17 @@ namespace FineUIPro.Web.HSSE.Check
}
var checkSpecialDetails = (from x in Funs.DB.View_CheckSpecialDetail
where x.CheckSpecialId == this.CheckSpecialId
where x.CheckSpecialId == this.CheckSpecialId
orderby x.UnitName, x.SortIndex
select x).ToList();
if (checkSpecialDetails.Count() > 0)
{
this.drpSupCheckItemSet.Readonly = true;
this.rbType.Readonly = true;
this.drpType.Readonly = true;
}
Grid1.DataSource = checkSpecialDetails;
details = checkSpecialDetails;
Grid1.DataSource = details;
Grid1.DataBind();
}
else
@ -107,41 +125,83 @@ namespace FineUIPro.Web.HSSE.Check
this.txtCheckSpecialCode.Text = CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectCheckSpecialMenuId, this.ProjectId, this.CurrUser.UnitId);
this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.drpSupCheckItemSet.SelectedIndex = 0;
this.drpSupCheckItemSet.SelectedIndex = 0;
}
// 删除选中单元格的客户端脚本
string deleteScript = GetDeleteScript();
// 新增数据初始值
JObject defaultObj = new JObject
{
{ "CheckAreaName", "" },
{ "UnitName", "" },
{ "Unqualified", "" },
{ "CheckItemName", "" },
{ "CompleteStatusName", "" },
{ "HandleStepStr", "" },
{ "HiddenHazardTypeName", "" },
{ "Delete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", deleteScript, IconHelper.GetResolvedIconUrl(Icon.Delete)) }
};
// 在第一行新增一条数据
btnNew.OnClientClick = Grid1.GetAddNewRecordReference(defaultObj, true);
}
}
#endregion
protected void btnAdd_Click(object sender, EventArgs e)
{
//JObject defaultObj = new JObject
// { { "CheckSpecialDetailId",Guid.NewGuid() },
// { "CheckAreaName", "" },
// { "UnitName", "" },
// { "HSEManage",""},
// { "Unqualified", "" },
// { "attchUrl","上传" },
// {"RiskLevel","" },
// { "CompleteStatusName", "" },
// {"LimitedDate","" },
// { "Suggestions",""},
// { "HandleStepStr", "" },
// { "Delete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", deleteScript, IconHelper.GetResolvedIconUrl(Icon.Delete)) }
// };
//details = (from x in Funs.DB.View_CheckSpecialDetail
// where x.CheckSpecialId == this.CheckSpecialId
// orderby x.UnitName, x.SortIndex
// select x).ToList();
//if (details == null)
// details = new List<View_CheckSpecialDetail>();
//View_CheckSpecialDetail d = new View_CheckSpecialDetail();
//d.CheckSpecialDetailId = Guid.NewGuid().ToString();
//details.Add(d);
//Grid1.DataSource= details;
/// <summary>
/// 行点击
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//Grid1.DataBind();
JArray teamGroupData = Grid1.GetMergedData();
List<JObject> list = new List<JObject>();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
values.Add("CheckSpecialDetailId", teamGroupRow.Value<string>("id"));
list.Add(values);
}
JObject defaultObj = new JObject
{ { "CheckSpecialDetailId",Guid.NewGuid() },
{ "CheckAreaName", "" },
{ "UnitName", "" },
{ "HSEManage",""},
{ "Unqualified", "" },
{"RiskLevel","" },
{ "CompleteStatusName", "" },
{"LimitedDate","" },
{ "Suggestions",""},
{ "HandleStepStr", "" },
{ "Delete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteScript(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
};
list.Add( defaultObj);
Grid1.DataSource = list;
Grid1.DataBind();
// Grid1.GetAddNewRecordReference(defaultObj, true);
// 在第一行新增一条数据
//btnNew.OnClientClick = Grid1.GetAddNewRecordReference(defaultObj, true);
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
string itemId = Grid1.DataKeys[e.RowIndex][0].ToString();
if (e.CommandName == "attchUrl")
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckSpecial&menuId={1}&edit=1", itemId, BLL.Const.ProjectCheckSpecialMenuId)));
}
}
/// <summary>
@ -149,11 +209,21 @@ namespace FineUIPro.Web.HSSE.Check
/// </summary>
private void InitDropDownList()
{
ListItem[] item = new ListItem[4];
item[0] = new ListItem("专项检查", "0");
item[1] = new ListItem("安全周检", "1");
item[2] = new ListItem("安全月检", "2");
item[3] = new ListItem("节前节后安全检查", "3");
this.drpType.DataValueField = "Value";
this.drpType.DataTextField = "Text";
this.drpType.DataSource = item;
this.drpType.DataBind();
//检查组成员
UserService.InitUserDropDownList(this.drpPartInPersons, this.ProjectId, true);
ConstValue.InitConstNameDropDownList(this.drpHandleStep, ConstValue.Group_HandleStep, true);
// ConstValue.InitConstNameDropDownList(this.drpHandleStep, ConstValue.Group_HandleStep, true);
///责任单位
UnitService.InitUnitNameByProjectIdUnitTypeDropDownList(this.drpWorkUnit, this.ProjectId, Const.ProjectUnitType_2, false);
UnitService.InitUnitNameByProjectIdUnitTypeDropDownList(this.drpWorkUnit, this.ProjectId, Const.ProjectUnitType_2, true);
///单位工程
UnitWorkService.InitUnitWorkNameDropDownList(this.drpCheckArea, this.ProjectId, false);
}
@ -167,7 +237,7 @@ namespace FineUIPro.Web.HSSE.Check
{
Model.Check_CheckSpecial checkSpecial = new Model.Check_CheckSpecial
{
CheckSpecialId = SQLHelper.GetNewID(),
CheckSpecialId = SQLHelper.GetNewID(typeof(Model.Check_CheckSpecial)),
CheckSpecialCode = this.txtCheckSpecialCode.Text.Trim(),
ProjectId = this.ProjectId,
CompileMan=this.CurrUser.UserId,
@ -210,7 +280,7 @@ namespace FineUIPro.Web.HSSE.Check
/// <param name="e"></param>
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (this.rbType.SelectedValue == "0" && (string.IsNullOrEmpty(this.drpSupCheckItemSet.SelectedValue) || this.drpSupCheckItemSet.SelectedValue == Const._Null))
if (this.drpType.SelectedValue == "0" && (string.IsNullOrEmpty(this.drpSupCheckItemSet.SelectedValue) || this.drpSupCheckItemSet.SelectedValue == Const._Null))
{
ShowNotify("请选择检查类别!", MessageBoxIcon.Warning);
return;
@ -219,7 +289,17 @@ namespace FineUIPro.Web.HSSE.Check
this.SaveData(Const.BtnSubmit);
}
#endregion
public string ConvertDate(object date)
{
if (date != null)
{
return string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(date));
}
else
{
return null;
}
}
#region
/// <summary>
/// 保存按钮
@ -228,7 +308,7 @@ namespace FineUIPro.Web.HSSE.Check
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (this.rbType.SelectedValue == "0" && (string.IsNullOrEmpty(this.drpSupCheckItemSet.SelectedValue) || this.drpSupCheckItemSet.SelectedValue == Const._Null))
if (this.drpType.SelectedValue == "0" && (string.IsNullOrEmpty(this.drpSupCheckItemSet.SelectedValue) || this.drpSupCheckItemSet.SelectedValue == Const._Null))
{
ShowNotify("请选择检查类别!", MessageBoxIcon.Warning);
return;
@ -251,7 +331,7 @@ namespace FineUIPro.Web.HSSE.Check
PartInPersonNames = this.txtPartInPersonNames.Text.Trim(),
CheckTime = Funs.GetNewDateTime(this.txtCheckDate.Text.Trim()),
CompileMan=this.CurrUser.UserId,
CheckType=this.rbType.SelectedValue,
CheckType=this.drpType.SelectedValue,
////单据状态
States = Const.State_0,
};
@ -272,23 +352,28 @@ namespace FineUIPro.Web.HSSE.Check
checkSpecial.PartInPersonIds = partInPersonIds.Substring(0, partInPersonIds.LastIndexOf(","));
checkSpecial.PartInPersons = partInPersons.Substring(0, partInPersons.LastIndexOf(","));
}
if (!string.IsNullOrEmpty(this.drpSupCheckItemSet.SelectedValue) && this.drpSupCheckItemSet.SelectedValue != Const._Null)
var getCheckItem = Funs.DB.Technique_CheckItemSet.FirstOrDefault(x => x.CheckItemName == this.drpSupCheckItemSet.SelectedValue);
if (getCheckItem != null)
{
checkSpecial.CheckItemSetId = this.drpSupCheckItemSet.SelectedValue;
checkSpecial.CheckItemSetId = getCheckItem.CheckItemSetId;
}
//if (!string.IsNullOrEmpty(this.drpSupCheckItemSet.SelectedValue) && this.drpSupCheckItemSet.SelectedValue != Const._Null)
//{
// checkSpecial.CheckItemSetId = this.drpSupCheckItemSet.SelectedValue;
//}
if (!string.IsNullOrEmpty(this.CheckSpecialId))
{
checkSpecial.CheckSpecialId = this.CheckSpecialId;
Check_CheckSpecialService.UpdateCheckSpecial(checkSpecial);
LogService.AddSys_Log(this.CurrUser, checkSpecial.CheckSpecialCode, checkSpecial.CheckSpecialId, BLL.Const.ProjectCheckSpecialMenuId, BLL.Const.BtnModify);
Check_CheckSpecialDetailService.DeleteCheckSpecialDetails(this.CheckSpecialId);
// Check_CheckSpecialDetailService.DeleteCheckSpecialDetails(this.CheckSpecialId);
}
else
{
checkSpecial.CheckSpecialId = SQLHelper.GetNewID(typeof(Model.Check_CheckSpecial));
this.CheckSpecialId = checkSpecial.CheckSpecialId;
checkSpecial.CompileMan = this.CurrUser.UserId;
Check_CheckSpecialService.AddCheckSpecial(checkSpecial);
LogService.AddSys_Log(this.CurrUser, checkSpecial.CheckSpecialCode, checkSpecial.CheckSpecialId, BLL.Const.ProjectCheckSpecialMenuId, BLL.Const.BtnAdd);
}
@ -311,25 +396,57 @@ namespace FineUIPro.Web.HSSE.Check
x.UnitWorkId,
UnitWorkName = BLL.UnitWorkService.GetUnitWorkALLName(x.UnitWorkId)
};
var olddetailLists = Check_CheckSpecialDetailService.GetCheckSpecialDetailByCheckSpecialId(this.CheckSpecialId);
List<string> needRemove = new List<string>();
foreach (var oldDetail in olddetailLists)
{
bool hasFind = false;
for (int i = 0; i < Grid1.Rows.Count; i++)
{
if (oldDetail.CheckSpecialDetailId == Grid1.Rows[i].DataKeys[0].ToString())
{
hasFind = true;
break;
}
}
if (!hasFind)
{
Check_CheckSpecialDetailService.DeleteCheckSpecialDetailById(oldDetail.CheckSpecialDetailId);
}
}
List<Model.Check_CheckSpecialDetail> detailLists = new List<Model.Check_CheckSpecialDetail>();
JArray teamGroupData = Grid1.GetMergedData();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
int rowIndex = teamGroupRow.Value<int>("index");
string CheckSpecialDetailId = values.Value<string>("CheckSpecialDetailId");
if (string.IsNullOrEmpty(CheckSpecialDetailId))
{
CheckSpecialDetailId = SQLHelper.GetNewID();
}
Model.Check_CheckSpecialDetail newDetail = new Model.Check_CheckSpecialDetail
{
CheckSpecialDetailId = CheckSpecialDetailId,
CheckSpecialDetailId = values.Value<string>("CheckSpecialDetailId"),
CheckSpecialId = this.CheckSpecialId,
CheckContent = values.Value<string>("CheckItemName"),
Unqualified = values.Value<string>("Unqualified"),
// WorkArea = values.Value<string>("WorkArea"),
Suggestions = values.Value<string>("Suggestions"),
RectifyOpinion = values.Value<string>("RectifyOpinion"),
ProposeUnitId = this.CurrUser.UnitId
};
if (!string.IsNullOrEmpty(values.Value<string>("RectifyOpinion")))
{
if(values.Value<string>("RectifyOpinion")=="")
newDetail.HandleStep = "";
}
if (!string.IsNullOrEmpty(values.Value<string>("LimitedDate")))
{
newDetail.LimitedDate = values.Value<DateTime>("LimitedDate");
}
var HSE = Funs.DB.Sys_User.FirstOrDefault(x=>x.UserName== values.Value<string>("HSE"));
var getUnit = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitName == values.Value<string>("UnitName"));
if (getUnit != null)
{
@ -348,36 +465,17 @@ namespace FineUIPro.Web.HSSE.Check
//{
// newDetail.CheckArea = getUnitWork.UnitWorkId;
//}
string[] strs = values.Value<string>("HandleStepStr").Split(',');
string handleStep = string.Empty;
foreach (var item in strs)
if (!string.IsNullOrEmpty(values.Value<string>("HSEManage")))
{
var getHandleStep = Funs.DB.Sys_Const.FirstOrDefault(x => x.GroupId == ConstValue.Group_HandleStep && x.ConstText == item);
if (getHandleStep != null)
string hsemange = values.Value<string>("HSEManage").Split('-')[0];
Sys_User user = Funs.DB.Sys_User.FirstOrDefault(x => x.UserName == hsemange);
if (user != null)
{
handleStep += getHandleStep.ConstValue + ",";
}
}
if (!string.IsNullOrEmpty(handleStep))
{
handleStep = handleStep.Substring(0, handleStep.LastIndexOf(","));
}
newDetail.HandleStep = handleStep;
if (newDetail.HandleStep.Contains("1"))
{
if (values.Value<string>("HiddenHazardTypeName") == "较大")
{
newDetail.HiddenHazardType = "2";
}
else if (values.Value<string>("HiddenHazardTypeName") == "重大")
{
newDetail.HiddenHazardType = "3";
}
else
{
newDetail.HiddenHazardType = "1";
newDetail.HSEManage = user.UserId;
}
}
if (values.Value<string>("CompleteStatusName") == "已整改")
{
newDetail.CompleteStatus = true;
@ -387,28 +485,42 @@ namespace FineUIPro.Web.HSSE.Check
{
newDetail.CompleteStatus = false;
}
var getCheckItem = Funs.DB.Technique_CheckItemSet.FirstOrDefault(x => x.SupCheckItem == this.drpSupCheckItemSet.SelectedValue && x.CheckItemName == newDetail.CheckContent);
var getCheckItem = Funs.DB.HSSE_Hazard_HazardRegisterTypes.FirstOrDefault(x => x.RegisterTypesName == values.Value<string>("CheckItemName") );
if (getCheckItem != null)
{
newDetail.CheckItem = getCheckItem.CheckItemSetId;
newDetail.CheckItem = getCheckItem.RegisterTypesId;
}
newDetail.SortIndex = rowIndex;
Check_CheckSpecialDetailService.AddCheckSpecialDetail(newDetail);
if (Grid1.Rows[rowIndex].DataKeys.Length > 0)
{
newDetail.CheckSpecialDetailId = Grid1.Rows[rowIndex].DataKeys[0].ToString();
}
switch (values.Value<string>("RiskLevel"))
{
case "低": newDetail.RiskLevel = "0"; break;
case "一般": newDetail.RiskLevel = "1"; break;
case "较高": newDetail.RiskLevel = "2"; break;
case "高": newDetail.RiskLevel = "3"; break;
}
if (string.IsNullOrEmpty(newDetail.CheckSpecialDetailId))
{
Check_CheckSpecialDetailService.AddCheckSpecialDetail(newDetail);
}
else
{
Check_CheckSpecialDetailService.UpdateCheckSpecialDetail(newDetail);
}
detailLists.Add(newDetail);
}
if (type == Const.BtnSubmit)
{
var getDails = detailLists.Where(x => x.CompleteStatus == false);
if (getDails.Count() > 0)
{
if (getDails.FirstOrDefault(x => x.HandleStep == null) != null)
{
info = "存在待整改问题,没有处理措施!";
}
else
{
info = Check_CheckSpecialService.IssueRectification(getDails.ToList(), checkSpecial);
}
checkSpecial.States = Const.State_1;
info = Check_CheckSpecialService.IssueRectification(getDails.ToList(), checkSpecial);
}
else
{
@ -469,11 +581,52 @@ namespace FineUIPro.Web.HSSE.Check
/// <param name="e"></param>
protected void drpSupCheckItemSet_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpCheckItem.Items.Clear();
Technique_CheckItemSetService.InitCheckItemSetNameDropDownList(this.drpCheckItem, "2", this.drpSupCheckItemSet.SelectedValue, false);
//this.drpCheckItem.Items.Clear();
//Technique_CheckItemSetService.InitCheckItemSetNameDropDownList(this.drpCheckItem, "2", this.drpSupCheckItemSet.SelectedValue, false);
}
protected void drpPartInPersons_SelectedIndexChanged(object sender, EventArgs e)
protected void drpWorkUnit_SelectedIndexChanged(object sender, EventArgs e)
{
//for (int i = 0; i < this.Grid1.Rows.Count; i++)
//{
// DropDownList drpUnitWork = (DropDownList)Grid1.Rows[i].FindControl("drpUnitWork");
// if(((DropDownList)sender).ID == drpUnitWork.ID)
// {
//DropDownList drpHSE = (DropDownList)Grid1.Rows[i].FindControl("drpHSE");
string unitName = ((DropDownList)sender).SelectedValue;
string id = "";
if(unitName != BLL.Const._Null)
{
var unit = Funs.DB.Base_Unit.FirstOrDefault(x=>x.UnitName == unitName);
if(unit != null)
{
id = unit.UnitId;
}
}
var sysUser = BLL.ProjectUserService.GetProjectUserByUnitidAndProjectId(CurrUser.LoginProjectId, id, Const.HSSEManager);
List<ListItem> lists = new List<ListItem>();
foreach(var item in sysUser)
{
lists.Add(new ListItem(item.UserName, item.UserName));
}
drpHSE.Items.Clear();
drpHSE.DataValueField = "Value";
drpHSE.DataTextField = "Value";
drpHSE.DataSource = lists;
drpHSE.DataBind();
// }
//}
//this.drpHSE.Items.Clear();
//this.drpHSE.DataValueField = "UserId";
//this.drpHSE.DataTextField = "UserId";
//this.drpHSE.DataSource=BLL.ProjectUserService.GetProjectUserByProjectId(CurrUser.LoginProjectId, Const.HSSEManager);
}
protected void drpPartInPersons_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpPartInPersons.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpPartInPersons.SelectedValueArray);
@ -489,28 +642,26 @@ namespace FineUIPro.Web.HSSE.Check
/// </summary>
private void InitCheckItemSetDropDownList()
{
this.drpSupCheckItemSet.Items.Clear();
this.drpCheckItem.Items.Clear();
if (this.rbType.SelectedValue == "1")
{
this.drpSupCheckItemSet.SelectedIndex = 0;
this.drpSupCheckItemSet.Readonly = true;
Technique_CheckItemSetService.InitCheckItemSetNameDropDownList(this.drpCheckItem, "6", "0", false);
}
else
{
this.drpSupCheckItemSet.Readonly = false;
Technique_CheckItemSetService.InitCheckItemSetDropDownList(this.drpSupCheckItemSet, "2", "0", false);
this.drpSupCheckItemSet.SelectedIndex = 0;
Technique_CheckItemSetService.InitCheckItemSetNameDropDownList(this.drpCheckItem, "2", this.drpSupCheckItemSet.SelectedValue, false);
}
this.drpCheckItem.DataTextField = "RegisterTypesName";
this.drpCheckItem.DataValueField = "RegisterTypesName";
this.drpCheckItem.DataSource = BLL.HSSE_Hazard_HazardRegisterTypesService.GetHazardRegisterTypesList("1"); //安全巡检类型
this.drpCheckItem.DataBind();
//this.drpCheckItem.SelectedValue = null;
ListItem[] item = new ListItem[4];
this.drpCheckItem.SelectedValue = null;
}
item[0] = new ListItem("低", "低");
item[1] = new ListItem("一般", "一般");
item[2] = new ListItem("较高", "较高");
item[3] = new ListItem("高", "高");
this.drpRiskLevel.DataValueField = "Value";
this.drpRiskLevel.DataTextField = "Text";
this.drpRiskLevel.DataSource = item;
this.drpRiskLevel.DataBind();
}
protected void drpCheckItem_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpCheckItem.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpCheckItem.SelectedValueArray);
// this.drpCheckItem.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpCheckItem.SelectedValueArray);
}
protected void Grid1_Sort(object sender, GridSortEventArgs e)
@ -522,10 +673,10 @@ namespace FineUIPro.Web.HSSE.Check
if (checkSpecialDetails.Count() > 0)
{
this.drpSupCheckItemSet.Readonly = true;
this.rbType.Readonly = true;
this.drpType.Readonly = true;
}
Grid1.DataSource = checkSpecialDetails;
details = checkSpecialDetails;
Grid1.DataSource = details;
Grid1.DataBind();
}
}

View File

@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Check {
public partial class CheckSpecialEdit {
namespace FineUIPro.Web.HSSE.Check
{
public partial class CheckSpecialEdit
{
/// <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>
/// SimpleForm1 控件。
/// </summary>
@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtCheckSpecialCode 控件。
/// </summary>
@ -47,16 +49,16 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCheckSpecialCode;
/// <summary>
/// rbType 控件。
/// drpType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rbType;
protected global::FineUIPro.DropDownList drpType;
/// <summary>
/// drpSupCheckItemSet 控件。
/// </summary>
@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpSupCheckItemSet;
/// <summary>
/// txtCheckDate 控件。
/// </summary>
@ -74,7 +76,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtCheckDate;
/// <summary>
/// drpPartInPersons 控件。
/// </summary>
@ -83,7 +85,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpPartInPersons;
/// <summary>
/// txtPartInPersonNames 控件。
/// </summary>
@ -92,7 +94,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPartInPersonNames;
/// <summary>
/// btnNew 控件。
/// </summary>
@ -101,7 +103,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// Grid1 控件。
/// </summary>
@ -110,7 +112,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// drpCheckArea 控件。
/// </summary>
@ -119,7 +121,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCheckArea;
/// <summary>
/// drpWorkUnit 控件。
/// </summary>
@ -128,7 +130,16 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWorkUnit;
/// <summary>
/// drpHSE 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpHSE;
/// <summary>
/// txtUnqualified 控件。
/// </summary>
@ -137,7 +148,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUnqualified;
/// <summary>
/// drpCheckItem 控件。
/// </summary>
@ -146,7 +157,16 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCheckItem;
/// <summary>
/// drpRiskLevel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpRiskLevel;
/// <summary>
/// drpCompleteStatus 控件。
/// </summary>
@ -155,25 +175,34 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCompleteStatus;
/// <summary>
/// drpHandleStep 控件。
/// drpHandleWay 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpHandleStep;
protected global::FineUIPro.DropDownList drpHandleWay;
/// <summary>
/// drpHiddenHazardType 控件。
/// dpLimitedDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpHiddenHazardType;
protected global::FineUIPro.DatePicker dpLimitedDate;
/// <summary>
/// txtSuggest 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSuggest;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@ -182,7 +211,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbTemp 控件。
/// </summary>
@ -191,16 +220,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbTemp;
/// <summary>
/// btnAttachUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttachUrl;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@ -209,7 +229,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave 控件。
/// </summary>
@ -218,7 +238,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnSubmit 控件。
/// </summary>
@ -227,7 +247,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSubmit;
/// <summary>
/// btnClose 控件。
/// </summary>
@ -236,7 +256,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt 控件。
/// </summary>

View File

@ -17,7 +17,7 @@
runat="server" BoxFlex="1" DataKeyNames="CheckSpecialDetailId" DataIDField="CheckSpecialDetailId"
AllowSorting="true" SortField="CheckTime" SortDirection="DESC" OnSort="Grid1_Sort"
EnableColumnLines="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10"
OnPageIndexChange="Grid1_PageIndexChange" OnRowCommand="Grid1_RowCommand"
OnPageIndexChange="Grid1_PageIndexChange" OnRowCommand="Grid1_RowCommand"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
@ -59,6 +59,10 @@
</f:DatePicker>
<f:DropDownList ID="drpStates" runat="server" Label="状态" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"
LabelWidth="70px" LabelAlign="Right" Width="170px">
<f:ListItem Text="- 请选择 -" Value="null" Selected="true" />
<f:ListItem Text="待提交" Value="0" />
<f:ListItem Text="待整改" Value="1" />
<f:ListItem Text="已完成" Value="2" />
</f:DropDownList>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
@ -97,7 +101,7 @@
SortField="HSEManage" FieldType="String" HeaderText="HSE经理" TextAlign="Left"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Unqualified" DataField="Unqualified"
<f:RenderField Width="200px" ColumnID="Unqualified" DataField="Unqualified"
SortField="Unqualified" FieldType="String" HeaderText="问题描述" TextAlign="Left"
HeaderTextAlign="Center">
</f:RenderField>
@ -112,22 +116,30 @@
</f:RenderField>
<f:RenderField Width="80px" ColumnID="CompleteStatusName" DataField="CompleteStatusName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="处理结果">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="现场处理结果">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="RectifyOpinion" DataField="RectifyOpinion"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="处理方式">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="LimitedDate" DataField="LimitedDate" FieldType="Date"
Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="限时日期">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="Suggestions" DataField="Suggestions"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="整改要求" ExpandUnusedSpace="true">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="整改要求" >
</f:RenderField>
<f:TemplateField ColumnID="StatesName" Width="100px" HeaderText="状态" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="labStatesName" runat="server" Text='<%# ConvertState(Eval("CheckSpecialDetailId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:LinkButtonField Width="50px" HeaderText="删除" ConfirmText="确定要删除此条信息吗?" ConfirmTarget="Parent" ColumnID="Del"
CommandName="del" TextAlign="Center" ToolTip="删除" Icon="Delete" Hidden="true" />
</Columns>

View File

@ -42,11 +42,11 @@ namespace FineUIPro.Web.HSSE.Check
GetButtonPower();
this.ItemSelectedList = new List<string>();
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
this.drpStates.DataValueField = "Id";
this.drpStates.DataTextField = "Name";
this.drpStates.DataSource = BLL.HSSE_Hazard_HazardRegisterService.GetStatesList(); ;
this.drpStates.DataBind();
Funs.FineUIPleaseSelect(this.drpStates);
//this.drpStates.DataValueField = "Id";
//this.drpStates.DataTextField = "Name";
//this.drpStates.DataSource = BLL.HSSE_Hazard_HazardRegisterService.GetStatesList(); ;
//this.drpStates.DataBind();
//Funs.FineUIPleaseSelect(this.drpStates);
// 绑定表格
BindGrid();
}
@ -57,9 +57,9 @@ namespace FineUIPro.Web.HSSE.Check
/// </summary>
private void BindGrid()
{
string strSql = "SELECT a.CheckSpecialCode,a.CheckTime,b.* FROM Check_CheckSpecial a left join View_CheckSpecialDetail b on a.CheckSpecialId=b.CheckSpecialId WHERE ";
string strSql = "SELECT a.CheckSpecialCode,(CASE WHEN a.States='2' THEN '已完成' WHEN a.States='1' THEN '待整改' ELSE '待提交' END) AS StatesName,a.CheckTime,b.* FROM Check_CheckSpecial a right join View_CheckSpecialDetail b on a.CheckSpecialId=b.CheckSpecialId WHERE ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
@ -111,15 +111,15 @@ namespace FineUIPro.Web.HSSE.Check
strSql += " AND RectificationTime <= @EndRectificationTime";
listStr.Add(new SqlParameter("@EndRectificationTime", this.txtEndRectificationTime.Text.Trim()));
}
if (this.drpStates.SelectedValue != BLL.Const._Null)
{
strSql += " AND States LIKE @States";
strSql += " AND a.States LIKE @States";
listStr.Add(new SqlParameter("@States", "%" + this.drpStates.SelectedValue + "%"));
}
if (!CommonService.IsMainUnitOrAdmin(this.CurrUser.UserId))
{
strSql += " AND (ResponsibleUnit =@ResponsibleUnit OR SendUnitId=@SendUnitId)";
strSql += " AND (UnitId = @ResponsibleUnit OR ProposeUnitId =@SendUnitId)";
listStr.Add(new SqlParameter("@ResponsibleUnit", this.CurrUser.UnitId));
listStr.Add(new SqlParameter("@SendUnitId", this.CurrUser.UnitId));
}
@ -276,14 +276,14 @@ namespace FineUIPro.Web.HSSE.Check
return;
}
string RegistrationId = Grid1.SelectedRowID;
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(RegistrationId);
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByCheckItemDetailId(RegistrationId);
if (registration != null)
{
if (registration.States == "1") //待整改
{
if (registration.ResponsibleMan == this.CurrUser.UserId) //当前人是责任人,可以进行整改操作
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationRectify.aspx?HazardRegisterId={0}", RegistrationId, "编辑 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HiddenInspection/HiddenRectificationRectify.aspx?HazardRegisterId={0}", registration.HazardRegisterId, "编辑 - ")));
}
else
{
@ -314,14 +314,14 @@ namespace FineUIPro.Web.HSSE.Check
return;
}
string RegistrationId = Grid1.SelectedRowID;
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(RegistrationId);
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByCheckItemDetailId(RegistrationId);
if (registration != null)
{
if (registration.States == Const.State_2) //待确认
{
if (registration.CheckManId == this.CurrUser.UserId) //当前人是检查人,可以进行确认操作
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationConfirm.aspx?HazardRegisterId={0}", RegistrationId, "编辑 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HiddenInspection/HiddenRectificationConfirm.aspx?HazardRegisterId={0}", registration.HazardRegisterId, "编辑 - ")));
}
else
{
@ -348,7 +348,7 @@ namespace FineUIPro.Web.HSSE.Check
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HSSE_HiddenRectificationListMenuId, BLL.Const.BtnAdd))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HiddenRectificationAdd.aspx", "登记 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HiddenInspection/HiddenRectificationAdd.aspx", "登记 - ")));
}
else
{
@ -366,7 +366,7 @@ namespace FineUIPro.Web.HSSE.Check
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
string RegistrationId = Grid1.DataKeys[e.RowIndex][0].ToString();
Model.HSSE_Hazard_HazardRegister hazardRegister = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(RegistrationId);
Model.HSSE_Hazard_HazardRegister hazardRegister = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByCheckItemDetailId(RegistrationId);
if (e.CommandName == "IsSelected")
{
CheckBoxField checkField = (CheckBoxField)Grid1.FindColumn("ckbIsSelected");
@ -386,7 +386,7 @@ namespace FineUIPro.Web.HSSE.Check
}
}
if (e.CommandName == "attchUrl")
{
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckSpecial&menuId={1}&edit=1&type=-1", RegistrationId, BLL.Const.ProjectCheckSpecialMenuId)));
}
if (e.CommandName == "del")
@ -703,5 +703,33 @@ namespace FineUIPro.Web.HSSE.Check
}
}
#endregion
protected string ConvertState(object state)
{
if (state != null)
{
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByCheckItemDetailId(state.ToString());
if (registration != null)
{
if (registration.States == "1") //待整改
{
return "待整改";
}
else if(registration.States == "2") //待整改
{
return "已整改-待复查验收";
}
else if(registration.States == "3") //待整改
{
return "已闭环";
}
{
return "编制";
}
}
}
return "";
}
}
}

View File

@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Check {
public partial class CheckSpecialRecord {
namespace FineUIPro.Web.HSSE.Check
{
public partial class CheckSpecialRecord
{
/// <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>
/// txtCheckMan 控件。
/// </summary>
@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCheckMan;
/// <summary>
/// txtType 控件。
/// </summary>
@ -74,7 +76,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtType;
/// <summary>
/// txtWorkAreaName 控件。
/// </summary>
@ -83,7 +85,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtWorkAreaName;
/// <summary>
/// txtResponsibilityUnitName 控件。
/// </summary>
@ -92,7 +94,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtResponsibilityUnitName;
/// <summary>
/// Toolbar2 控件。
/// </summary>
@ -101,7 +103,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// txtStartTime 控件。
/// </summary>
@ -110,7 +112,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStartTime;
/// <summary>
/// Label3 控件。
/// </summary>
@ -119,7 +121,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label3;
/// <summary>
/// txtEndTime 控件。
/// </summary>
@ -128,7 +130,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// txtStartRectificationTime 控件。
/// </summary>
@ -137,7 +139,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStartRectificationTime;
/// <summary>
/// Label1 控件。
/// </summary>
@ -146,7 +148,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// txtEndRectificationTime 控件。
/// </summary>
@ -155,7 +157,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndRectificationTime;
/// <summary>
/// drpStates 控件。
/// </summary>
@ -164,7 +166,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpStates;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@ -173,7 +175,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// hdRemark 控件。
/// </summary>
@ -182,7 +184,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdRemark;
/// <summary>
/// btnNew 控件。
/// </summary>
@ -191,7 +193,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnOut 控件。
/// </summary>
@ -200,7 +202,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// labNumber 控件。
/// </summary>
@ -209,7 +211,16 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label labNumber;
/// <summary>
/// labStatesName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label labStatesName;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@ -218,7 +229,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
@ -227,7 +238,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
@ -236,7 +247,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
@ -245,7 +256,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
@ -254,7 +265,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Window3 控件。
/// </summary>
@ -263,7 +274,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window3;
/// <summary>
/// WindowAtt 控件。
/// </summary>
@ -272,7 +283,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Menu1 控件。
/// </summary>
@ -281,7 +292,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnModify 控件。
/// </summary>
@ -290,7 +301,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnModify;
/// <summary>
/// btnRectify 控件。
/// </summary>
@ -299,7 +310,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnRectify;
/// <summary>
/// btnConfirm 控件。
/// </summary>
@ -308,7 +319,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnConfirm;
/// <summary>
/// btnMenuSee 控件。
/// </summary>
@ -317,7 +328,7 @@ namespace FineUIPro.Web.HSSE.Check {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuSee;
/// <summary>
/// btnMenuDelete 控件。
/// </summary>

View File

@ -356,8 +356,9 @@ namespace FineUIPro.Web.HSSE.Check
string filePath = string.Empty;
initTemplatePath = "File\\Word\\HSSE\\专项检查.doc";
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".doc");
filePath = initTemplatePath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf");
string docfilename = Funs.GetNewFileName();
newUrl = uploadfilepath.Replace(".doc", docfilename + ".doc");
filePath = initTemplatePath.Replace(".doc", docfilename + ".pdf");
if (File.Exists(newUrl)) {
File.Delete(newUrl);
}
@ -501,7 +502,7 @@ namespace FineUIPro.Web.HSSE.Check
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
builder.CellFormat.Width = 50;
builder.Write(string.IsNullOrEmpty(detail.HiddenHazardTypeName) ? "" : detail.HiddenHazardTypeName);
builder.Write(string.IsNullOrEmpty(detail.RiskLevel) ? "" : detail.RiskLevel);
builder.EndRow();
num++;
}

View File

@ -45,30 +45,44 @@
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" ClicksToEdit="1" DataIDField="CheckSpecialDetailId"
DataKeyNames="CheckSpecialDetailId" ShowGridHeader="true" MinHeight="350px"
AllowSorting="false" SortField="SortIndex" SortDirection="ASC" OnSort="Grid1_Sort"
AllowSorting="false" SortField="SortIndex" SortDirection="ASC" OnSort="Grid1_Sort"
EnableColumnLines="true" EnableTextSelection="True" OnRowCommand="Grid1_RowCommand">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
TextAlign="Center" />
<f:RenderField Width="130px" ColumnID="CheckAreaName" DataField="CheckAreaName" SortField="CheckAreaName"
<f:RenderField Width="100px" ColumnID="CheckAreaName" DataField="CheckAreaName" SortField="CheckAreaName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="单位工程">
</f:RenderField>
<f:RenderField Width="240px" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
<f:RenderField Width="150px" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="受检单位">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="Unqualified" DataField="Unqualified" SortField="Unqualified"
<f:RenderField Width="100px" ColumnID="HSEManage" DataField="HSEManage" SortField="HSEManage"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="HSE经理">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="Unqualified" DataField="Unqualified" SortField="Unqualified"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="问题描述" ExpandUnusedSpace="true">
</f:RenderField>
<f:LinkButtonField Width="90px" HeaderText="问题图片" ConfirmTarget="Top" CommandName="attchUrl"
TextAlign="Center" ToolTip="上传" Text="上传" />
<f:RenderField Width="160px" ColumnID="CheckItemName" DataField="CheckItemName" SortField="CheckItemName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="问题类型">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="RiskLevel" DataField="RiskLevel" SortField="RiskLevel"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="风险级别">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="CompleteStatusName" DataField="CompleteStatusName" SortField="CompleteStatusName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="处理结果">
</f:RenderField>
<f:LinkButtonField Width="150px" ColumnID="HandleStepLink" DataTextField="HandleStepLink" DataToolTipField="HandleStepLink" HeaderText="处理措施"
CommandName="click" EnableAjax="false" />
<f:RenderField Width="80px" ColumnID="HiddenHazardTypeName" DataField="HiddenHazardTypeName" SortField="HiddenHazardTypeName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="隐患类别">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="RectifyOpinion" DataField="RectifyOpinion" SortField="RectifyOpinion"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="处理方式">
</f:RenderField>
<%-- <f:RenderField Width="80px" ColumnID="LimitedDate" DataField="LimitedDate" SortField="LimitedDate"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="级别">
</f:RenderField>--%>
<f:RenderField Width="80px" ColumnID="Suggestions" DataField="Suggestions" SortField="Suggestions"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="整改要求">
</f:RenderField>
<%--<f:LinkButtonField Width="140px" HeaderText="处理措施" ConfirmTarget="Parent" CommandName="click"
TextAlign="Center" DataTextField="HandleStepLink" ColumnID="HandleStepLink" /> --%>

View File

@ -150,6 +150,10 @@ namespace FineUIPro.Web.HSSE.Check
}
}
}
if (e.CommandName == "attchUrl")
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckSpecial&menuId={1}&edit=1&type=-1", checkSpecialDetailId, BLL.Const.ProjectCheckSpecialMenuId)));
}
}
protected void Grid1_Sort(object sender, GridSortEventArgs e)

View File

@ -90,7 +90,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
dpCompanyTraining.SelectedValueArray = planItem;
}
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, trainingPlan.UnitIds, trainingPlan.WorkPostId,"", trainingPlan.TrainTypeId).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, trainingPlan.UnitIds, trainingPlan.WorkPostId,"", trainingPlan.TrainTypeId,"","").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
dpSysUser.DataTextField = "PersonName";
dpSysUser.DataValueField = "PersonId";
dpSysUser.DataSource = getDataList;
@ -431,7 +431,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
dpSysUser.Items.Clear();
string unitIds=string.Join(",",dpUnit.SelectedValue);
string workPostIds = string.Join(",", dpWorkPost.SelectedValue);
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, unitIds, workPostIds,"", drpTrainType.SelectedValue).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, unitIds, workPostIds,"", drpTrainType.SelectedValue,"","").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
dpSysUser.DataTextField = "PersonName";
dpSysUser.DataValueField = "PersonId";
dpSysUser.DataSource = getDataList;

View File

@ -55,7 +55,7 @@
<f:CheckBox runat="server" Label="时间空" ID="ckIsNULL" AutoPostBack="true"
OnCheckedChanged="IsTemp_CheckedChanged" LabelWidth="70px" Width="80px">
</f:CheckBox>
<f:Label runat="server" Text="红色表示分数低于80分。" CssClass="LabelColor"></f:Label>
<f:Label runat="server" ID="lbPassScore" Text="红色表示分数低于80分。" CssClass="LabelColor"></f:Label>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnOut" OnClick="btnMenuOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">

View File

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
namespace FineUIPro.Web.HSSE.EduTrain
{
@ -24,7 +25,24 @@ namespace FineUIPro.Web.HSSE.EduTrain
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
GetButtonPower();
var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault();
if (sysTestRule != null)
{
if (sysTestRule.PassingScore > 0)
{
this.lbPassScore.Text = "红色表示分数低于" + sysTestRule.PassingScore.ToString() + "分。";
}
else
{
this.lbPassScore.Text = "红色表示分数低于80分。";
}
}
else
{
this.lbPassScore.Text = "红色表示分数低于80分。";
}
///更新没有结束时间且超时的考试记录
GetDataService.UpdateTestPlanStates();

View File

@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.EduTrain {
public partial class TestRecord {
namespace FineUIPro.Web.HSSE.EduTrain
{
public partial class TestRecord
{
/// <summary>
/// form1 控件。
/// </summary>
@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// txtName 控件。
/// </summary>
@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtName;
/// <summary>
/// txtMinScores 控件。
/// </summary>
@ -74,7 +76,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMinScores;
/// <summary>
/// txtMaxScores 控件。
/// </summary>
@ -83,7 +85,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMaxScores;
/// <summary>
/// IsTemp 控件。
/// </summary>
@ -92,7 +94,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox IsTemp;
/// <summary>
/// txtStartDate 控件。
/// </summary>
@ -101,7 +103,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStartDate;
/// <summary>
/// txtEndDate 控件。
/// </summary>
@ -110,7 +112,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndDate;
/// <summary>
/// ckIsNULL 控件。
/// </summary>
@ -119,7 +121,16 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckIsNULL;
/// <summary>
/// lbPassScore 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbPassScore;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@ -128,7 +139,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnOut 控件。
/// </summary>
@ -137,7 +148,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// labNumber 控件。
/// </summary>
@ -146,7 +157,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label labNumber;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@ -155,7 +166,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
@ -164,7 +175,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
@ -173,7 +184,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
@ -182,7 +193,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Menu1 控件。
/// </summary>
@ -191,7 +202,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuView 控件。
/// </summary>
@ -200,7 +211,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuView;
/// <summary>
/// btnPrinter 控件。
/// </summary>
@ -209,7 +220,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnPrinter;
/// <summary>
/// btnMenuDelete 控件。
/// </summary>

View File

@ -7,6 +7,17 @@
<title>HSE巡检</title>
<link href="~/res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<style type="text/css">
.f-grid-row.Red {
background-color: red;
}
.f-grid-row.Yellow {
background-color: yellow;
} .f-grid-row.Blue {
background-color: deepskyblue;
}
</style>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />

View File

@ -107,8 +107,20 @@ 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) );
if (this.dpRiskLevel.SelectedText == "重大")
{
strSql += " AND Risk_Level in('重大','3','高') ";
}
else if (this.dpRiskLevel.SelectedText == "较大")
{
strSql += " AND Risk_Level in('较大','2','较高') ";
}
else if (this.dpRiskLevel.SelectedText == "一般")
{
strSql += " AND Risk_Level in('一般','1','低') ";
}
}
if (!string.IsNullOrEmpty(this.drpType.SelectedValue.Trim()))
{
@ -163,6 +175,32 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
Grid1.DataSource = table;
Grid1.DataBind();
for (int i = 0; i < Grid1.Rows.Count; i++)
{
string HazardRegisterId = Grid1.Rows[i].DataKeys[0].ToString();
Model.View_Hazard_HazardRegister registration = (from x in Funs.DB.View_Hazard_HazardRegister where x.HazardRegisterId == HazardRegisterId select x).FirstOrDefault();
if (registration != null)
{
if (registration.Risk_Level == "一般" || registration.Risk_Level == "1" || registration.Risk_Level == "低")
{
Grid1.Rows[i].RowCssClass = "Blue";
}else if (registration.Risk_Level == "较大" || registration.Risk_Level == "2" || registration.Risk_Level == "较高")
{
Grid1.Rows[i].RowCssClass = "Yellow";
}
else if (registration.Risk_Level == "重大" || registration.Risk_Level == "3")
{
Grid1.Rows[i].RowCssClass = "Red";
}
}
}
}
#endregion

View File

@ -90,7 +90,7 @@ namespace FineUIPro.Web.Person.EduTrain
{
dpCompanyTraining.SelectedValueArray = planItem;
}
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, trainingPlan.UnitIds, trainingPlan.WorkPostId,"", trainingPlan.TrainTypeId).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, trainingPlan.UnitIds, trainingPlan.WorkPostId,"", trainingPlan.TrainTypeId,"","").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
dpSysUser.DataTextField = "PersonName";
dpSysUser.DataValueField = "PersonId";
dpSysUser.DataSource = getDataList;
@ -431,7 +431,7 @@ namespace FineUIPro.Web.Person.EduTrain
dpSysUser.Items.Clear();
string unitIds=string.Join(",",dpUnit.SelectedValue);
string workPostIds = string.Join(",", dpDepart.SelectedValue);
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, unitIds, workPostIds,"", drpTrainType.SelectedValue).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, unitIds, workPostIds,"", drpTrainType.SelectedValue,"","").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
dpSysUser.DataTextField = "PersonName";
dpSysUser.DataValueField = "PersonId";
dpSysUser.DataSource = getDataList;

View File

@ -670,12 +670,12 @@
// refreshWhenExist 添加选项卡时如果选项卡已经存在是否刷新内部IFrame
// refreshWhenTabChange: 切换选项卡时是否刷新内部IFrame
F.initTreeTabStrip(mainMenu, mainTabStrip, true, false, false);
var themeTitle = F.cookie('Theme_Pro_Title');
var themeName = F.cookie('Theme_Pro');
if (themeTitle) {
F.removeCookie('Theme_Pro_Title');
//notify('主题更改为:' + themeTitle + '' + themeName + '');
}
//var themeTitle = F.cookie('Theme_Pro_Title');
//var themeName = F.cookie('Theme_Pro');
//if (themeTitle) {
// F.removeCookie('Theme_Pro_Title');
// //notify('主题更改为:' + themeTitle + '' + themeName + '');
//}
});
</script>
</body>

View File

@ -762,12 +762,12 @@
// refreshWhenExist 添加选项卡时如果选项卡已经存在是否刷新内部IFrame
// refreshWhenTabChange: 切换选项卡时是否刷新内部IFrame
F.initTreeTabStrip(mainMenu, mainTabStrip, true, false, false);
var themeTitle = F.cookie('Theme_Pro_Title');
var themeName = F.cookie('Theme_Pro');
if (themeTitle) {
F.removeCookie('Theme_Pro_Title');
//notify('主题更改为:' + themeTitle + '' + themeName + '');
}
//var themeTitle = F.cookie('Theme_Pro_Title');
//var themeName = F.cookie('Theme_Pro');
//if (themeTitle) {
// F.removeCookie('Theme_Pro_Title');
// //notify('主题更改为:' + themeTitle + '' + themeName + '');
//}
});
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -120,7 +120,7 @@ namespace Model
/// <summary>
/// 是否启用
/// </summary>
public bool IsUsed { get; set; }
public string IsUsed { get; set; }
/// <summary>
/// 是否启用
/// </summary>

View File

@ -247,5 +247,19 @@ namespace Model
get;
set;
}
/// <summary>
/// 签名
/// </summary>
public string Signature
{
get;
set;
}
public string Fingerprint
{
get;
set;
}
}
}

View File

@ -360605,6 +360605,10 @@ namespace Model
private int _Duration;
private string _Signature;
private string _Fingerprint;
private EntityRef<Training_TestPlan> _Training_TestPlan;
private EntitySet<Training_TestRecordItem> _Training_TestRecordItem;
@ -360635,6 +360639,10 @@ namespace Model
partial void OnIsFiledChanged();
partial void OnDurationChanging(int value);
partial void OnDurationChanged();
partial void OnSignatureChanging(string value);
partial void OnSignatureChanged();
partial void OnFingerprintChanging(string value);
partial void OnFingerprintChanged();
#endregion
public Training_TestRecord()
@ -360868,6 +360876,46 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Signature", DbType="NVarChar(1000)")]
public string Signature
{
get
{
return this._Signature;
}
set
{
if ((this._Signature != value))
{
this.OnSignatureChanging(value);
this.SendPropertyChanging();
this._Signature = value;
this.SendPropertyChanged("Signature");
this.OnSignatureChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Fingerprint", DbType="NVarChar(1000)")]
public string Fingerprint
{
get
{
return this._Fingerprint;
}
set
{
if ((this._Fingerprint != value))
{
this.OnFingerprintChanging(value);
this.SendPropertyChanging();
this._Fingerprint = value;
this.SendPropertyChanged("Fingerprint");
this.OnFingerprintChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Training_TestRecord_Training_TestPlan", Storage="_Training_TestPlan", ThisKey="TestPlanId", OtherKey="TestPlanId", IsForeignKey=true)]
public Training_TestPlan Training_TestPlan
{

View File

@ -174,11 +174,14 @@ namespace WebAPI.Controllers
OutResult = person.OutResult,
Birthday = person.Birthday,
Telephone = person.Telephone,
IsUsed = (person.IsUsed == false ? 0 : 1),
InTime = Funs.GetNewDateTimeOrNow(person.InTime),
Password = BLL.PersonService.GetPersonPassWord(person.IdentityCard),
Isprint = "0",
};
if (!string.IsNullOrEmpty(person.IsUsed))
{
newPerson.IsUsed = int.Parse(person.IsUsed);
}
if (!string.IsNullOrEmpty(person.TeamGroupName) && !string.IsNullOrEmpty(newPerson.UnitId))
{
var getTeamGroup = TeamGroupService.getTeamGroupByTeamGroupName(getProject.ProjectId, newPerson.UnitId, person.TeamGroupName);

View File

@ -1,5 +1,8 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
@ -350,7 +353,7 @@ namespace WebAPI.Controllers
/// 交卷
/// </summary>
/// <param name="testRecordId">试卷ID</param>
public Model.ResponeData getSubmitTestRecordByTestRecordId(string testRecordId)
public Model.ResponeData getSubmitTestRecordByTestRecordId(string testRecordId,string Signature)
{
var responeData = new Model.ResponeData();
try
@ -364,6 +367,7 @@ namespace WebAPI.Controllers
{
if (getTestRecord.TestStartTime.HasValue)
{
getTestRecord.Signature = Signature;
getTestRecord.TestEndTime = DateTime.Now;
var getRItem = db.Training_TestRecordItem.Where(x => x.TestRecordId == testRecordId);
if (getRItem.Count() > 0)
@ -410,5 +414,104 @@ namespace WebAPI.Controllers
return responeData;
}
#endregion
#region
/// <summary>
/// 交卷
/// </summary>
public Model.ResponeData SaveSubmitTestRecordByTestRecordId(Model.TestRecordItem testRecordItem)
{
string testRecordId = testRecordItem.TestRecordId;
string Signature = testRecordItem.Signature;
string Fingerprint = testRecordItem.Fingerprint;
var responeData = new Model.ResponeData();
try
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getTestRecord = db.Training_TestRecord.FirstOrDefault(e => e.TestRecordId == testRecordId);
if (getTestRecord != null)
{
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
string SignatureUrl = @"FileUpload\TestRecord\" + getTestRecord.TestRecordId + "~签名" + ".png";
string FingerprintUrl = @"FileUpload\TestRecord\" + getTestRecord.TestRecordId + "~指纹" + ".png";
string Signaturefilename = rootUrl + SignatureUrl;
string Fingerprintfilename = rootUrl + FingerprintUrl;
if (!string.IsNullOrEmpty(Signature))
{
Signature = Signature.Replace("data:image/svg+xml;base64,", "").Replace("data:image/png;base64,", "").Replace("data:image/jgp;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", "");//将base64头部信息替换
byte[] bytes = Convert.FromBase64String(Signature);
MemoryStream memStream = new MemoryStream(bytes);
Image mImage = Image.FromStream(memStream);
Bitmap bp = new Bitmap(mImage);
MemoryStream ms = new MemoryStream();
bp.Save(Signaturefilename, System.Drawing.Imaging.ImageFormat.Png);
// System.IO.File.WriteAllBytes(Signaturefilename, Convert.FromBase64String(Signature));
getTestRecord.Signature = Signaturefilename.Replace(rootUrl, "");
}
if (!string.IsNullOrEmpty(Fingerprint))
{
Fingerprint = Fingerprint.Replace("data:image/svg+xml;base64,", "").Replace("data:image/png;base64,", "").Replace("data:image/jgp;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", "");//将base64头部信息替换
byte[] bytes = Convert.FromBase64String(Fingerprint);
MemoryStream memStream = new MemoryStream(bytes);
Image mImage = Image.FromStream(memStream);
Bitmap bp = new Bitmap(mImage);
MemoryStream ms = new MemoryStream();
bp.Save(Fingerprintfilename, System.Drawing.Imaging.ImageFormat.Png);
getTestRecord.Fingerprint = Fingerprintfilename.Replace(rootUrl, "");
}
APITestRecordService.updateTestRecord(getTestRecord);
string returnTestRecordId = string.Empty;
////考试分数
decimal getTestScores = APITestRecordService.getSubmitTestRecord(getTestRecord);
////及格分数
int getPassScores = 80;
var testRule = db.Sys_TestRule.FirstOrDefault();
if (testRule != null)
{
getPassScores = testRule.PassingScore;
}
if (getTestScores <= getPassScores)
{
int testCount = db.Training_TestRecord.Where(x => x.TestPlanId == getTestRecord.TestPlanId && x.TestManId == getTestRecord.TestManId).Count();
if (testCount < 2)
{
////重新生成一条考试记录 以及考试试卷
returnTestRecordId = APITestRecordService.getResitTestRecord(getTestRecord);
responeData.message = "考试不合格!您的成绩为:【" + getTestScores.ToString() + "】,您将进入补考。";
}
else
{
APITestRecordService.updateAll(getTestRecord.TestPlanId);
responeData.message = "考试不合格!您的成绩为:【" + getTestScores.ToString() + "】,请再次参加培训后补考。";
}
}
else
{
APITestRecordService.updateAll(getTestRecord.TestPlanId);
responeData.message = "恭喜考试通过!您的成绩为:【" + getTestScores.ToString() + "】。";
}
responeData.data = new { getTestScores, getPassScores, returnTestRecordId };
}
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}

View File

@ -349,7 +349,7 @@ namespace WebAPI.Controllers
/// <param name="trainTypeId">培训类型ID(可为空)</param>
/// <param name="pageIndex">分页</param>
/// <returns></returns>
public Model.ResponeData getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId, int pageIndex)
public Model.ResponeData getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId, int pageIndex,string strParam,string InTime)
{
var responeData = new Model.ResponeData();
try
@ -366,7 +366,7 @@ namespace WebAPI.Controllers
}
else
{
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(projectId, unitIds, workPostIds, departIds, trainTypeId).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(projectId, unitIds, workPostIds, departIds, trainTypeId, InTime, strParam).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
int pageCount = getDataList.Count;
if (pageCount > 0 && pageIndex > 0)