河北专项检查和移动端
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
using BLL;
|
||||
using FineUIPro.Web.BaseInfo;
|
||||
using Model;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
@@ -43,8 +47,6 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
GetButtonPower();
|
||||
this.ItemSelectedList = new List<string>();
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
this.drpStates.DataValueField = "Id";
|
||||
this.drpStates.DataTextField = "Name";
|
||||
List<Model.HandleStep> handleSteps = new List<Model.HandleStep>();
|
||||
Model.HandleStep handleStep1 = new Model.HandleStep();
|
||||
handleStep1.Id = "1";
|
||||
@@ -58,22 +60,12 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
handleStep3.Id = "3";
|
||||
handleStep3.Name = "已闭环";
|
||||
handleSteps.Add(handleStep3);
|
||||
//Model.HandleStep handleStep4 = new Model.HandleStep();
|
||||
//handleStep4.Id = "4";
|
||||
//handleStep4.Name = "已作废";
|
||||
//handleSteps.Add(handleStep4);
|
||||
this.drpStates.DataSource = handleSteps; ;
|
||||
this.drpStates.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpStates);
|
||||
ListItem[] ProblemTypes = new ListItem[2];
|
||||
ProblemTypes[0] = new ListItem("日常巡检", "1");
|
||||
ProblemTypes[1] = new ListItem("专项巡检", "2");
|
||||
this.drpProblemTypes.DataValueField = "Value";
|
||||
this.drpProblemTypes.DataTextField = "Text";
|
||||
this.drpProblemTypes.DataSource = ProblemTypes;
|
||||
this.drpProblemTypes.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpProblemTypes);
|
||||
// 绑定表格
|
||||
|
||||
SetProblemTypes();
|
||||
SetUnitProject();
|
||||
SetResponsibleUnit();
|
||||
this.txtStartTime.Text = DateTime.Today.ToString("yyyy-MM-dd");
|
||||
this.txtEndTime.Text = DateTime.Today.ToString("yyyy-MM-dd");
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
@@ -95,66 +87,45 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
strSql += " AND CheckManName LIKE @CheckMan";
|
||||
listStr.Add(new SqlParameter("@CheckMan", "%" + this.txtCheckMan.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtType.Text.Trim()))
|
||||
if (this.txtType.SelectedText.Trim() != "请选择" && !string.IsNullOrEmpty(this.txtType.SelectedText.Trim()))
|
||||
{
|
||||
strSql += " AND RegisterTypesName LIKE @Type";
|
||||
listStr.Add(new SqlParameter("@Type", "%" + this.txtType.Text.Trim() + "%"));
|
||||
strSql += " AND RectifyName = @Type";
|
||||
listStr.Add(new SqlParameter("@Type", this.txtType.SelectedText.Trim()));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtWorkAreaName.SelectedText)&&this.txtWorkAreaName.SelectedText.Trim() != "请选择" )
|
||||
{
|
||||
strSql += " AND Place = @Place";
|
||||
listStr.Add(new SqlParameter("@Place", this.txtWorkAreaName.SelectedText.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtWorkAreaName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND WorkAreaName LIKE @WorkAreaName";
|
||||
listStr.Add(new SqlParameter("@WorkAreaName", "%" + this.txtWorkAreaName.Text.Trim() + "%"));
|
||||
strSql += " AND Place LIKE @Place";
|
||||
listStr.Add(new SqlParameter("@Place", "%" + this.txtWorkAreaName.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.dpRiskLevel.SelectedValue.Trim()))
|
||||
if (!string.IsNullOrEmpty(this.txtResponsibilityUnitName.Text.Trim())&&this.txtResponsibilityUnitName.SelectedText.Trim() != "请选择" )
|
||||
{
|
||||
strSql += " AND Risk_Level = @Risk_Level";
|
||||
listStr.Add(new SqlParameter("@Risk_Level", this.dpRiskLevel.SelectedText) );
|
||||
}
|
||||
//if (this.ckType.SelectedValue != "0")
|
||||
//{
|
||||
// strSql += " AND CheckCycle=@CheckCycle";
|
||||
// listStr.Add(new SqlParameter("@CheckCycle", this.ckType.SelectedValue));
|
||||
//}
|
||||
if (!string.IsNullOrEmpty(this.txtResponsibilityUnitName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND ResponsibilityUnitName LIKE @ResponsibilityUnitName";
|
||||
listStr.Add(new SqlParameter("@ResponsibilityUnitName", "%" + this.txtResponsibilityUnitName.Text.Trim() + "%"));
|
||||
strSql += " AND ResponsibilityUnitName = @ResponsibilityUnitName";
|
||||
listStr.Add(new SqlParameter("@ResponsibilityUnitName", this.txtResponsibilityUnitName.SelectedText.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtStartTime.Text.Trim()))
|
||||
{
|
||||
strSql += " AND CheckTime >= @StartTime";
|
||||
listStr.Add(new SqlParameter("@StartTime", this.txtStartTime.Text.Trim()));
|
||||
listStr.Add(new SqlParameter("@StartTime", string.Format("{0} {1}", this.txtStartTime.Text.Trim(), "00:00:00")));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
|
||||
{
|
||||
strSql += " AND CheckTime <= @EndTime";
|
||||
listStr.Add(new SqlParameter("@EndTime", this.txtEndTime.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtStartRectificationTime.Text.Trim()))
|
||||
{
|
||||
strSql += " AND RectificationTime >= @StartRectificationTime";
|
||||
listStr.Add(new SqlParameter("@StartRectificationTime", this.txtStartRectificationTime.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtEndRectificationTime.Text.Trim()))
|
||||
{
|
||||
strSql += " AND RectificationTime <= @EndRectificationTime";
|
||||
listStr.Add(new SqlParameter("@EndRectificationTime", this.txtEndRectificationTime.Text.Trim()));
|
||||
}
|
||||
if (this.drpProblemTypes.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " and ProblemTypes ='"+this.drpProblemTypes.SelectedValue+"' " ;
|
||||
}
|
||||
if (this.drpStates.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND States LIKE @States";
|
||||
listStr.Add(new SqlParameter("@States", "%" + this.drpStates.SelectedValue + "%"));
|
||||
}
|
||||
if (!CommonService.IsMainUnitOrAdmin(this.CurrUser.UserId))
|
||||
{
|
||||
strSql += " AND (ResponsibleUnit =@ResponsibleUnit OR SendUnitId=@SendUnitId)";
|
||||
listStr.Add(new SqlParameter("@ResponsibleUnit", this.CurrUser.UnitId));
|
||||
listStr.Add(new SqlParameter("@SendUnitId", this.CurrUser.UnitId));
|
||||
listStr.Add(new SqlParameter("@EndTime", string.Format("{0} {1}", this.txtEndTime.Text.Trim(), "23:59:59")));
|
||||
}
|
||||
//if (!CommonService.IsMainUnitOrAdmin(this.CurrUser.UserId))
|
||||
//{
|
||||
// strSql += " AND (ResponsibleUnit =@ResponsibleUnit OR SendUnitId=@SendUnitId)";
|
||||
// listStr.Add(new SqlParameter("@ResponsibleUnit", this.CurrUser.UnitId));
|
||||
// listStr.Add(new SqlParameter("@SendUnitId", this.CurrUser.UnitId));
|
||||
//}
|
||||
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
@@ -222,6 +193,70 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 问题类型下拉框赋值
|
||||
public void SetProblemTypes()
|
||||
{
|
||||
txtType.DataValueField = "RectifyId";
|
||||
txtType.DataTextField = "RectifyName";
|
||||
List<Model.Technique_Rectify> list = (from x in Funs.DB.Technique_Rectify select x).ToList();
|
||||
list.Insert(0, new Model.Technique_Rectify()
|
||||
{
|
||||
RectifyId = "-1",
|
||||
RectifyName = "请选择"
|
||||
});
|
||||
txtType.DataSource = list;
|
||||
txtType.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 单位工程下拉框赋值
|
||||
public void SetUnitProject()
|
||||
{
|
||||
List<Model.WBS_UnitWork> list = new List<Model.WBS_UnitWork>() {
|
||||
new Model.WBS_UnitWork()
|
||||
{
|
||||
UnitWorkId = "-1",
|
||||
UnitWorkName = "请选择"
|
||||
}
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
list.AddRange((from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList());
|
||||
}
|
||||
txtWorkAreaName.DataValueField = "UnitWorkId";
|
||||
txtWorkAreaName.DataTextField = "UnitWorkName";
|
||||
txtWorkAreaName.DataSource = list;
|
||||
txtWorkAreaName.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 责任单位下拉框赋值
|
||||
public void SetResponsibleUnit()
|
||||
{
|
||||
List<Model.UnitItem> list = new List<Model.UnitItem>() {
|
||||
new Model.UnitItem()
|
||||
{
|
||||
UnitId = "-1",
|
||||
UnitName = "请选择"
|
||||
}
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
list.AddRange((from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId select new Model.UnitItem()
|
||||
{
|
||||
UnitId = y.UnitId,
|
||||
UnitName = y.UnitName
|
||||
}).ToList());
|
||||
}
|
||||
txtResponsibilityUnitName.DataValueField = "UnitId";
|
||||
txtResponsibilityUnitName.DataTextField = "UnitName";
|
||||
txtResponsibilityUnitName.DataSource = list;
|
||||
txtResponsibilityUnitName.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查看
|
||||
/// <summary>
|
||||
/// 查看按钮
|
||||
@@ -670,32 +705,32 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
html = (row.FindControl("lbCheckItemName") as AspNet.Label).Text;
|
||||
}
|
||||
|
||||
if (column.ColumnID == "tfImageUrl1")
|
||||
{
|
||||
if (rbOutType.SelectedValue == "1")
|
||||
{
|
||||
html = (row.FindControl("lbImageUrl1") as AspNet.Label).Text;
|
||||
//if (column.ColumnID == "tfImageUrl1")
|
||||
//{
|
||||
// if (rbOutType.SelectedValue == "1")
|
||||
// {
|
||||
// html = (row.FindControl("lbImageUrl1") as AspNet.Label).Text;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
html = "";
|
||||
}
|
||||
}
|
||||
if (column.ColumnID == "tfImageUrl2")
|
||||
{
|
||||
if (rbOutType.SelectedValue == "1")
|
||||
{
|
||||
html = (row.FindControl("lbImageUrl2") as AspNet.Label).Text;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// html = "";
|
||||
// }
|
||||
//}
|
||||
//if (column.ColumnID == "tfImageUrl2")
|
||||
//{
|
||||
// if (rbOutType.SelectedValue == "1")
|
||||
// {
|
||||
// html = (row.FindControl("lbImageUrl2") as AspNet.Label).Text;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
html = "";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// html = "";
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
//}
|
||||
//if (column.ColumnID == "tfCutPayment")
|
||||
//{
|
||||
// html = (row.FindControl("lbtnCutPayment") as AspNet.LinkButton).Text;
|
||||
@@ -719,14 +754,15 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtStartRectificationTime.Text.Trim()) && !string.IsNullOrEmpty(this.txtEndRectificationTime.Text.Trim()))
|
||||
{
|
||||
if (Funs.GetNewDateTime(this.txtStartRectificationTime.Text.Trim()) > Funs.GetNewDateTime(this.txtEndRectificationTime.Text.Trim()))
|
||||
{
|
||||
Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Console.WriteLine("TextBox_TextChanged", this.txtType.SelectedText);
|
||||
//if (!string.IsNullOrEmpty(this.txtStartRectificationTime.Text.Trim()) && !string.IsNullOrEmpty(this.txtEndRectificationTime.Text.Trim()))
|
||||
//{
|
||||
// if (Funs.GetNewDateTime(this.txtStartRectificationTime.Text.Trim()) > Funs.GetNewDateTime(this.txtEndRectificationTime.Text.Trim()))
|
||||
// {
|
||||
// Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning);
|
||||
// return;
|
||||
// }
|
||||
//}
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
@@ -750,7 +786,6 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
hazardRegisterIds = hazardRegisterIds.Substring(0, hazardRegisterIds.LastIndexOf(","));
|
||||
}
|
||||
// PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("HiddenRectificationPrint.aspx?HazardRegisterIds={0}&CheckType={1}", hazardRegisterIds,"0", "查看 - ")));
|
||||
this.hdRemark.Text = string.Empty;
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -762,27 +797,34 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (Request.Params["value"] == "0")
|
||||
try
|
||||
{
|
||||
return;
|
||||
if (Request.Params["value"] == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HSSE_HiddenRectificationListMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
//if (buttonList.Contains(Const.BtnAdd))
|
||||
//{
|
||||
// this.btnRectify.Hidden = false;
|
||||
// this.btnConfirm.Hidden = false;
|
||||
//}
|
||||
//if (buttonList.Contains(Const.BtnModify))
|
||||
//{
|
||||
// this.btnModify.Hidden = false;
|
||||
//}
|
||||
if (buttonList.Contains(Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
var buttonList = CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HSSE_HiddenRectificationListMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
catch(Exception ex)
|
||||
{
|
||||
if (buttonList.Contains(Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
this.btnRectify.Hidden = false;
|
||||
this.btnConfirm.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(Const.BtnModify))
|
||||
{
|
||||
this.btnModify.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user