This commit is contained in:
2021-08-16 17:41:00 +08:00
parent dfd370a9b0
commit dba64994c3
44 changed files with 1962 additions and 839 deletions
@@ -179,84 +179,12 @@ namespace FineUIPro.Web.HSSE.SitePerson
unitId = str[0];
}
}
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))
{
if (unitId == "0")
{
strSql += " AND UnitId IS NULL ";
}
else
{
strSql += " AND UnitId =@UnitId ";
listStr.Add(new SqlParameter("@UnitId", unitId));
}
}
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 (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)
{
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
{
strSql += " OR WorkPostId = @WorkPostId" + i.ToString();
listStr.Add(new SqlParameter("@WorkPostId" + i.ToString(), item));
}
i++;
}
strSql += ")";
}
if (this.ckTrain.Checked)
{
strSql += " AND TrainCount =0";
}
if (this.ckIspost.Checked)
{
strSql += " AND IsUsedName ='否'";
}
if (this.ckJT.Checked)
{
strSql += " AND RealNameAddTime IS NULL";
}
if (this.ckIdCardInfoNotOK.Checked)
{
strSql += " AND (IdcardType is null or IdentityCard is null or PhotoUrl is null or HeadImage IS NULL OR (LEN(IdentityCard) != 15 AND LEN(IdentityCard) != 18))";
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
var getData = PersonService.getListData(this.ProjectId, unitId, this.txtPersonName.Text.Trim(), this.txtIdentityCard.Text.Trim(),
this.drpTreamGroup.SelectedValue, Funs.GetStringByArray(this.drpPost.SelectedValueArray), this.ckTrain.Checked, this.ckIspost.Checked, this.ckJT.Checked,
this.ckIdCardInfoNotOK.Checked, Grid1);
Grid1.RecordCount = PersonService.count;
Grid1.DataSource = getData;
Grid1.DataBind();
}
}
@@ -737,5 +665,11 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
ShowNotify("操作完成,新转二进制照片" + num.ToString() + "条", MessageBoxIcon.Success);
}
protected void drpPost_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpPost.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpPost.SelectedValueArray);
}
}
}