This commit is contained in:
2021-07-06 15:16:17 +08:00
parent 957d206c2b
commit 7f785d6423
13 changed files with 240 additions and 102 deletions
@@ -96,6 +96,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
rootNode.ToolTip = "当前项目人员总数:0";
}
rootNode.Expanded = true;
rootNode.EnableClickEvent = true;
this.tvProjectAndUnit.Nodes.Add(rootNode);
GetUnitLists(rootNode.Nodes, this.ProjectId, personLists);
}
@@ -168,102 +169,99 @@ namespace FineUIPro.Web.HSSE.SitePerson
private void BindGrid()
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
{
string unitId = string.Empty;
if (this.tvProjectAndUnit != null && !string.IsNullOrEmpty(this.tvProjectAndUnit.SelectedNodeID))
{
string id = this.tvProjectAndUnit.SelectedNodeID;
string unitId = string.Empty;
string projectId = string.Empty;
var str = id.Split('|');
var str = this.tvProjectAndUnit.SelectedNodeID.Split('|');
if (str.Count() > 1)
{
unitId = str[0];
projectId = str[1];
}
}
string strSql = "select * from View_SitePerson_Person Where ProjectId=@ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>
string strSql = "select * from View_SitePerson_Person Where ProjectId=@ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>
{
new SqlParameter("@ProjectId", this.ProjectId)
};
if (!string.IsNullOrEmpty(unitId) && unitId != "0")
{
strSql += " AND UnitId =@UnitId ";
listStr.Add(new SqlParameter("@UnitId", unitId));
}
else
{
strSql += " AND UnitId IS NULL";
}
if (!string.IsNullOrEmpty(unitId) && unitId != "0")
{
strSql += " AND UnitId =@UnitId ";
listStr.Add(new SqlParameter("@UnitId", unitId));
}
//else
//{
// strSql += " AND UnitId IS NULL";
//}
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
{
strSql += " AND PersonName LIKE @PersonName";
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
{
strSql += " AND PersonName LIKE @PersonName";
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtCardNo.Text.Trim()))
{
strSql += " AND CardNo LIKE @CardNo";
listStr.Add(new SqlParameter("@CardNo", "%" + this.txtCardNo.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text.Trim()))
{
strSql += " AND IdentityCard LIKE @IdentityCard";
listStr.Add(new SqlParameter("@IdentityCard", "%" + this.txtIdentityCard.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.drpTreamGroup.SelectedValue) && this.drpTreamGroup.SelectedValue != BLL.Const._Null)
{
strSql += " AND TeamGroupId = @TeamGroupId";
listStr.Add(new SqlParameter("@TeamGroupId", this.drpTreamGroup.SelectedValue));
}
if (!string.IsNullOrEmpty(this.txtCardNo.Text.Trim()))
{
strSql += " AND CardNo LIKE @CardNo";
listStr.Add(new SqlParameter("@CardNo", "%" + this.txtCardNo.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text.Trim()))
{
strSql += " AND IdentityCard LIKE @IdentityCard";
listStr.Add(new SqlParameter("@IdentityCard", "%" + this.txtIdentityCard.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.drpTreamGroup.SelectedValue) && this.drpTreamGroup.SelectedValue != BLL.Const._Null)
{
strSql += " AND TeamGroupId = @TeamGroupId";
listStr.Add(new SqlParameter("@TeamGroupId", this.drpTreamGroup.SelectedValue));
}
if (this.drpPost.SelectedItemArray.Count() > 1 || (this.drpPost.SelectedValue != BLL.Const._Null && this.drpPost.SelectedItemArray.Count() == 1))
if (this.drpPost.SelectedItemArray.Count() > 1 || (this.drpPost.SelectedValue != BLL.Const._Null && this.drpPost.SelectedItemArray.Count() == 1))
{
strSql += " AND (1=2 ";
int i = 0;
foreach (var item in this.drpPost.SelectedValueArray)
{
strSql += " AND (1=2 ";
int i = 0;
foreach (var item in this.drpPost.SelectedValueArray)
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
{
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
{
strSql += " OR WorkPostId = @WorkPostId" + i.ToString();
listStr.Add(new SqlParameter("@WorkPostId" + i.ToString(), item));
}
i++;
strSql += " OR WorkPostId = @WorkPostId" + i.ToString();
listStr.Add(new SqlParameter("@WorkPostId" + i.ToString(), item));
}
strSql += ")";
}
if (this.ckTrain.Checked)
{
strSql += " AND TrainCount =0";
}
if (this.ckIdCardInfoNotOK.Checked)
{
strSql += " AND (IdcardType is null or IdentityCard is null or PhotoUrl is null or (select count(*) from AttachFile where ToKeyId=PersonId+'#1')=0 or (select count(*) from AttachFile where ToKeyId=PersonId+'#5')=0)";
i++;
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
strSql += ")";
}
if (this.ckTrain.Checked)
{
strSql += " AND TrainCount =0";
}
if (this.ckIdCardInfoNotOK.Checked)
{
strSql += " AND (IdcardType is null or IdentityCard is null or PhotoUrl is null or (select count(*) from AttachFile where ToKeyId=PersonId+'#1')=0 or (select count(*) from AttachFile where ToKeyId=PersonId+'#5')=0)";
}
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
for (int i = 0; i < Grid1.Rows.Count; i++)
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
for (int i = 0; i < Grid1.Rows.Count; i++)
{
string personId = Grid1.Rows[i].DataKeys[0].ToString();
var isNull = from x in db.EduTrain_TrainRecordDetail
join y in db.EduTrain_TrainRecord on x.TrainingId equals y.TrainingId
where y.ProjectId == this.ProjectId && x.PersonId == personId
select x;
if (isNull.Count() == 0) ////未参加过培训的人员
{
string personId = Grid1.Rows[i].DataKeys[0].ToString();
var isNull = from x in db.EduTrain_TrainRecordDetail
join y in db.EduTrain_TrainRecord on x.TrainingId equals y.TrainingId
where y.ProjectId == this.ProjectId && x.PersonId == personId
select x;
if (isNull.Count() == 0) ////未参加过培训的人员
{
Grid1.Rows[i].RowCssClass = "Red";
}
Grid1.Rows[i].RowCssClass = "Red";
}
}
}
@@ -291,7 +289,10 @@ namespace FineUIPro.Web.HSSE.SitePerson
projectId = str[1];
}
BLL.TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTreamGroup, projectId, unitId, true);
BindGrid();
}
else
{
BindGrid();
}
}
@@ -387,14 +388,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
this.PersonId = Grid1.SelectedRowID;
string id = this.tvProjectAndUnit.SelectedNodeID;
string[] str = id.Split('|');
if (str.Count() > 1)
{
string unitId = id.Split('|')[0];
string projectId = id.Split('|')[1];
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PersonListEdit.aspx?PersonId={0}&&ProjectId={1}&&UnitId={2}", this.PersonId, projectId, unitId, "编辑 - ")));
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PersonListEdit.aspx?PersonId={0}", this.PersonId, "编辑 - ")));
}
/// <summary>
@@ -54,7 +54,7 @@
</f:Toolbar>
</Toolbars>
<Items>
<f:TabStrip ID="TabStrip1" CssClass="f-tabstrip-theme-simple" Height="540px" ShowBorder="true"
<f:TabStrip ID="TabStrip1" CssClass="f-tabstrip-theme-simple" Height="520px" ShowBorder="true"
TabPosition="Top" MarginBottom="5px" EnableTabCloseMenu="false" runat="server"
ActiveTabIndex="0">
<Tabs>
@@ -74,9 +74,9 @@
<f:TextBox ID="txtIdentityCard" runat="server" Label="证件号码" MaxLength="50" LabelAlign="Right" LabelWidth="110px"
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Required="true" ShowRedStar="true">
</f:TextBox>
<f:DatePicker ID="txtIdcardStartDate" runat="server" Label="证件开始日期" LabelAlign="Right" LabelWidth="110px">
<f:DatePicker ID="txtIdcardStartDate" runat="server" Label="证件开始日期" LabelAlign="Right" LabelWidth="110px" Hidden="true">
</f:DatePicker>
<f:DatePicker ID="txtIdcardEndDate" runat="server" Label="证件有效日期" LabelAlign="Right" LabelWidth="110px">
<f:DatePicker ID="txtIdcardEndDate" runat="server" Label="证件有效日期" LabelAlign="Right" LabelWidth="110px" Hidden="true">
</f:DatePicker>
<f:TextBox ID="txtUnitName" runat="server" Label="所属单位" LabelAlign="Right"
Readonly="true" LabelWidth="110px"></f:TextBox>
@@ -119,11 +119,12 @@
<f:RadioItem Value="1" Text="男" Selected="true" />
<f:RadioItem Value="2" Text="女" />
</f:RadioButtonList>
<f:RadioButtonList ID="rblIdcardForever" runat="server" Label="证件是否永久有效" LabelWidth="145px" LabelAlign="Right" AutoPostBack="true" OnSelectedIndexChanged="rblIdcardForever_SelectedIndexChanged">
<f:RadioButtonList ID="rblIdcardForever" runat="server" Label="证件是否永久有效" LabelWidth="145px" Hidden="true"
LabelAlign="Right" AutoPostBack="true" OnSelectedIndexChanged="rblIdcardForever_SelectedIndexChanged">
<f:RadioItem Value="Y" Text="是" />
<f:RadioItem Value="N" Text="否" Selected="true"/>
</f:RadioButtonList>
<f:TextBox ID="txtIdcardAddress" runat="server" Label="发证机关" MaxLength="50" LabelAlign="Right" >
<f:TextBox ID="txtIdcardAddress" runat="server" Label="发证机关" MaxLength="50" LabelAlign="Right" Hidden="true">
</f:TextBox>
<f:DropDownList ID="drpPost" runat="server" Label="所属岗位" LabelAlign="Right" Required="True" ShowRedStar="True" EnableEdit="true">
</f:DropDownList>