This commit is contained in:
2021-06-18 20:37:07 +08:00
parent e7cb804684
commit 65a719e331
32 changed files with 1093 additions and 128 deletions
+3 -3
View File
@@ -22,7 +22,7 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="现场出入记录" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="NewID" AllowPaging="true"
IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange"
DataIDField="NewID" AllowSorting="true" SortField="DateTimeRecord"
DataIDField="NewID" AllowSorting="true" SortField="DateTimeRecord"
SortDirection="DESC" EnableColumnLines="true" OnSort="Grid1_Sort" ForceFit="true"
EnableTextSelection="True">
<Toolbars>
@@ -69,12 +69,12 @@
SortField="AreaName" FieldType="String" HeaderText="区域" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="EmployNO" DataField="EmployNO"
<f:RenderField Width="190px" ColumnID="EmployNO" DataField="EmployNO"
SortField="EmployNO" FieldType="String" HeaderText="员工号" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="CardID" DataField="CardID" SortField="CardID"
HeaderText="卡号" HeaderTextAlign="Center" TextAlign="Center" FieldType="String">
HeaderText="卡号" HeaderTextAlign="Center" TextAlign="Center" FieldType="Int">
</f:RenderField>
<f:RenderField Width="160px" ColumnID="DateTimeRecord" DataField="DateTimeRecord" SortField="DateTimeRecord"
HeaderText="时间" HeaderTextAlign="Center" TextAlign="Center">
+6 -68
View File
@@ -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();
}
}