提交定制会内容
This commit is contained in:
@@ -25,6 +25,9 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
{
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
Funs.FineUIPleaseSelect(this.drpCheckMainType);
|
||||
//Funs.FineUIPleaseSelect(this.drpCheckType);
|
||||
btnNewDG.OnClientClick = Window1.GetShowReference("SuperviseCheckReportFinalizeEdit.aspx") + "return false;";
|
||||
btnNew.OnClientClick = Window1.GetShowReference("SuperviseCheckReportEdit.aspx") + "return false;";
|
||||
btnDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
|
||||
btnDelete.ConfirmText = String.Format("你确定要删除选中的 <b><script>{0}</script></b> 行数据吗?", Grid1.GetSelectedCountReference());
|
||||
@@ -40,23 +43,37 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT S.SuperviseCheckReportId,S.SuperviseCheckReportCode,S.CheckDate,S.ProjectId,P.ProjectName,S.UnitId,u.UnitName,S.CheckTeam,S.EvaluationResult,S.AttachUrl,S.IsIssued,case S.CheckType when '1' then '企业负责人带班检查' when '2' then '企业综合检查' when '3' then '企业专项检查' else '' end as CheckTypeName"
|
||||
+ @" FROM dbo.Supervise_SuperviseCheckReport AS S"
|
||||
+ @" LEFT JOIN dbo.Base_Project AS P ON P.ProjectId=S.ProjectId"
|
||||
+ @" LEFT JOIN dbo.Base_Unit AS U ON U.UnitId=S.UnitId"
|
||||
+ @" WHERE 1=1 ";
|
||||
string strSql = @"SELECT S.SuperviseCheckReportId,S.SuperviseCheckReportCode,S.CheckDate,CU.UnitName as CheckUnitName,S.ProjectId,P.ProjectName,S.UnitId,u.UnitName,S.CheckTeam,S.EvaluationResult,S.AttachUrl,S.IsIssued
|
||||
,case S.CheckMainType when '0' then '安全' when '1' then '质量' else '' end as CheckMainTypeName
|
||||
,SType.CheckTypeName as CheckTypeName
|
||||
FROM dbo.Supervise_SuperviseCheckReport AS S
|
||||
LEFT JOIN dbo.Base_Project AS P ON P.ProjectId=S.ProjectId
|
||||
LEFT JOIN dbo.Base_Unit AS U ON U.UnitId=S.UnitId
|
||||
LEFT JOIN dbo.Base_Unit AS CU ON CU.UnitId=S.CheckUnitId
|
||||
LEFT JOIN dbo.Base_SuperviseCheckType AS SType ON SType.CheckMainType=S.CheckMainType and SType.CheckTypeCode=S.CheckType
|
||||
WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND (S.SuperviseCheckReportCode like @name OR P.ProjectName like @name OR u.UnitName like @name OR S.CheckTeam like @name OR S.EvaluationResult like @name)";
|
||||
listStr.Add(new SqlParameter("@name", "%" + this.txtName.Text.Trim() + "%"));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && Const.UnitId_SEDIN != this.CurrUser.UnitId)
|
||||
var thisUnit = BLL.CommonService.GetIsThisUnit();
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && thisUnit.UnitId != this.CurrUser.UnitId)
|
||||
{
|
||||
strSql += " AND P.UnitId = @UnitId";
|
||||
listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId));
|
||||
}
|
||||
if (this.drpCheckMainType.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND S.CheckMainType = @CheckMainType";
|
||||
listStr.Add(new SqlParameter("@CheckMainType", this.drpCheckMainType.SelectedValue));
|
||||
}
|
||||
if (this.drpCheckType.SelectedValue != null && this.drpCheckType.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND S.CheckType = @CheckType";
|
||||
listStr.Add(new SqlParameter("@CheckType", this.drpCheckType.SelectedValue));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
@@ -81,9 +98,12 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
if (rectify != null)
|
||||
{
|
||||
code = rectify.SuperviseCheckRectifyCode;
|
||||
lblRectify.Text = "已下发:" + code;
|
||||
}
|
||||
else
|
||||
{
|
||||
lblRectify.Text = "定稿";
|
||||
}
|
||||
lblRectify.Text = "已下发:" + code;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -329,11 +349,30 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
ShowNotify("删除的检查报告中已下发检查整改记录,请先删除对应检查整改记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
BLL.SubUnitCheckRectifyItemService.DeleteSubUnitCheckRectifyBySuperviseCheckReportId(rowID);
|
||||
BLL.SuperviseCheckReportItemService.DeleteSuperviseCheckReportItemBySuperviseCheckReportId(rowID);
|
||||
BLL.SuperviseCheckReportService.DeleteSuperviseCheckReportById(rowID);
|
||||
}
|
||||
|
||||
var superviseCheckReport = BLL.SuperviseCheckReportService.GetSuperviseCheckReportById(rowID);
|
||||
if (superviseCheckReport.IsUpdate == true)
|
||||
{
|
||||
var returndata = HSSEData_HSSEService.DeleteSuperviseCheckReportData(rowID);
|
||||
if (returndata.code == 1)
|
||||
{
|
||||
BLL.SubUnitCheckRectifyItemService.DeleteSubUnitCheckRectifyBySuperviseCheckReportId(rowID);
|
||||
BLL.SuperviseCheckReportItemService.DeleteSuperviseCheckReportItemBySuperviseCheckReportId(rowID);
|
||||
BLL.SuperviseCheckReportService.DeleteSuperviseCheckReportById(rowID);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("记录已上报集团,集团删除失败,无法删除本地数据!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BLL.SubUnitCheckRectifyItemService.DeleteSubUnitCheckRectifyBySuperviseCheckReportId(rowID);
|
||||
BLL.SuperviseCheckReportItemService.DeleteSuperviseCheckReportItemBySuperviseCheckReportId(rowID);
|
||||
BLL.SuperviseCheckReportService.DeleteSuperviseCheckReportById(rowID);
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!");
|
||||
}
|
||||
@@ -370,6 +409,7 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNewDG.Hidden = false;
|
||||
this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
@@ -381,6 +421,14 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
this.btnDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
//if (string.IsNullOrEmpty(CurrUser.LoginProjectId))
|
||||
//{
|
||||
// btnNewDG.Hidden = true;
|
||||
// btnNew.Hidden = true;
|
||||
// btnDelete.Hidden = true;
|
||||
// btnEdit.Hidden = true;
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -597,6 +645,23 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查大类下拉触发事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void DrpCheckMainType_SelectChanged(object sender, EventArgs e)
|
||||
{
|
||||
BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(this.drpCheckType, this.drpCheckMainType.SelectedValue, false);
|
||||
//var mainType = drpCheckMainType.SelectedValue;
|
||||
//if (!string.IsNullOrWhiteSpace(mainType) && mainType != Const._Null)
|
||||
//{
|
||||
// BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(this.drpCheckType, mainType, true);
|
||||
//}
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user