20210618
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Text;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.Door
|
||||
{
|
||||
@@ -54,71 +51,12 @@ namespace FineUIPro.Web.Door
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
string strSql = string.Empty;
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (this.rbCheckType.SelectedValue == "1")
|
||||
{
|
||||
strSql = @"SELECT NEWID,ValidEventID AS ID,V.ProjectId,EmployName,DepartmentID,DepartmentName AS DepartName,AreaID,AreaName,EmployNO,V.CardNO AS CardID
|
||||
,RecordDateTime AS DateTimeRecord,RecordAll AS RecordDes,(CASE WHEN InOrOut=2 THEN '出门' ELSE '进门' END) AS InOrOut
|
||||
,P.UnitId,P.TeamGroupId
|
||||
FROM t_d_validcardevent V
|
||||
LEFT JOIN SitePerson_Person AS P ON V.IDCardNo=P.IdentityCard AND V.ProjectId=P.ProjectId
|
||||
where V.ProjectId = @ProjectId";
|
||||
if (!string.IsNullOrEmpty(this.txtStartDate.Text))
|
||||
{
|
||||
strSql += " AND RecordDateTime >= @StartDate";
|
||||
listStr.Add(new SqlParameter("@StartDate", this.txtStartDate.Text));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtEndDate.Text))
|
||||
{
|
||||
strSql += " AND RecordDateTime < @EndDate";
|
||||
listStr.Add(new SqlParameter("@EndDate", Funs.GetNewDateTime(this.txtEndDate.Text).Value.AddDays(1)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql = @"SELECT NewID,ID,V.ProjectId,EmployName,DepartmentID,DepartName,AreaID,AreaName,EmployNO,CardID,RoleID
|
||||
,DateTimeRecord,RecordDes, InOrOut ,P.UnitId,P.TeamGroupId
|
||||
FROM dbo.t_d_facerecord V
|
||||
LEFT JOIN SitePerson_Person AS P ON V.EmployNO=P.IdentityCard AND V.ProjectId=P.ProjectId
|
||||
where V.ProjectId = @ProjectId";
|
||||
if (this.rbCheckType.SelectedValue == "2")
|
||||
{
|
||||
strSql += " AND RoleID = '微信端'";
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql += " AND RoleID != '微信端'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtStartDate.Text))
|
||||
{
|
||||
strSql += " AND DateTimeRecord >= @StartDate";
|
||||
listStr.Add(new SqlParameter("@StartDate", this.txtStartDate.Text));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtEndDate.Text))
|
||||
{
|
||||
strSql += " AND DateTimeRecord < @EndDate";
|
||||
listStr.Add(new SqlParameter("@EndDate", Funs.GetNewDateTime(this.txtEndDate.Text).Value.AddDays(1)));
|
||||
}
|
||||
}
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND UnitId = @UnitId ";
|
||||
listStr.Add(new SqlParameter("@UnitId", this.drpUnit.SelectedValue));
|
||||
}
|
||||
string unitId = this.drpUnit.SelectedValue != Const._Null ? this.drpUnit.SelectedValue : null;
|
||||
string name = !string.IsNullOrEmpty(this.txtName.Text.Trim()) ? this.txtName.Text.Trim() : null;
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND EmployName LIKE @EmployName";
|
||||
listStr.Add(new SqlParameter("@EmployName", "%" + this.txtName.Text.Trim() + "%"));
|
||||
}
|
||||
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 = InOutService.getListData(this.ProjectId, this.rbCheckType.SelectedValue, unitId, name, this.txtStartDate.Text, this.txtEndDate.Text, Grid1.PageIndex , Grid1.PageSize);//Funs.DB.SP_InOutList(this.ProjectId, unitId, name, this.rbCheckType.SelectedValue, startDate, endDate, Grid1.PageIndex + 1, Grid1.PageSize);
|
||||
Grid1.RecordCount = InOutService.count;
|
||||
Grid1.DataSource = getData;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user