20230922
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BLL;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -34,8 +35,8 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
|
||||
this.drpUnit.Enabled = false;
|
||||
}
|
||||
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd HH:mm}", DateTime.Now.AddDays(-1));
|
||||
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd HH:mm}", DateTime.Now.AddMinutes(1));
|
||||
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd 00:00}", DateTime.Now);
|
||||
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd 23:59}", DateTime.Now);
|
||||
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
@@ -49,11 +50,43 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
var getData = PersonInOutService.getListData(this.CurrUser.LoginProjectId, this.drpUnit.SelectedValue, this.txtPersonName.Text.Trim(), this.rbInOutWay.SelectedValue
|
||||
, Funs.GetNewDateTime(this.txtStartDate.Text), Funs.GetNewDateTime(this.txtEndDate.Text), Grid1);
|
||||
Grid1.RecordCount = PersonInOutService.count;
|
||||
Grid1.DataSource = getData;
|
||||
Grid1.DataBind();
|
||||
|
||||
string sql = @"select NEWID() PersonInOutId, PersonId,UnitName,PersonName,IdentityCard,case when IsIn =1 then '进门' else '出门' end IsInName,InOutWay,case when IsIn =1 then MinTime else MaxTime end ChangeTime from (
|
||||
select PersonId,UnitName,PersonName,IdentityCard,IsIn,InOutWay,MAX(ChangeTime)MaxTime,MIN(ChangeTime) MinTime from SitePerson_PersonInOut where ProjectId='" + this.CurrUser.LoginProjectId + "'";
|
||||
if (!string.IsNullOrEmpty(this.drpUnit.SelectedValue) && this.drpUnit.SelectedValue != Const._Null)
|
||||
{
|
||||
sql += " and UnitId ='"+ this.drpUnit.SelectedValue + "' ";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
|
||||
{
|
||||
sql += " and PersonName like '%" + this.txtPersonName.Text.Trim() + "%' ";
|
||||
}
|
||||
if(this.rbInOutWay.SelectedValue != "0")
|
||||
{
|
||||
sql += " and InOutWay = '" + this.rbInOutWay.SelectedValue + "' ";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtStartDate.Text))
|
||||
{
|
||||
sql += " and ChangeTime >= '" + this.txtStartDate.Text + "' ";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtEndDate.Text))
|
||||
{
|
||||
sql += " and ChangeTime <= '" + this.txtEndDate.Text + "' ";
|
||||
}
|
||||
|
||||
sql += "group by PersonId,UnitName,PersonName,IdentityCard,year(ChangeTime),month(ChangeTime),day(ChangeTime),IsIn,InOutWay ) a order by ChangeTime desc";
|
||||
|
||||
|
||||
|
||||
System.Data.DataTable tb = SQLHelper.GetDataTableRunText(sql, null);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -169,11 +202,66 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
ShowNotify("删除数据成功!(表格数据已重新绑定)", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 转换字符串
|
||||
#region 转换字符串
|
||||
protected string ConvertInTestRecord(object TestManId)
|
||||
{
|
||||
string inTestRecord = "<span style='color:red'>0</span>";
|
||||
if (TestManId != null && !string.IsNullOrEmpty(TestManId.ToString()))
|
||||
{
|
||||
string strSql = @"select max(TestScores) from dbo.Training_TestRecord AS TestRecord
|
||||
LEFT JOIN dbo.Training_TestPlan AS TestPlan ON TestPlan.TestPlanId=TestRecord.TestPlanId
|
||||
LEFT JOIN dbo.Training_TestTraining AS Training ON Training.TrainingId = TestRecord.TestType
|
||||
where (TestPlan.PlanName LIKE '%入场培训试题%' OR Training.TrainingName LIKE '%入场培训试题%' ) and TestRecord.ProjectId='" + CurrUser.LoginProjectId + "' and TestManId = '" + TestManId + "' ";
|
||||
|
||||
protected string ConvertInOutWayName(object InOutWay)
|
||||
|
||||
System.Data.DataTable tb = SQLHelper.GetDataTableRunText(strSql, null);
|
||||
if (tb != null && tb.Rows.Count > 0&&!string.IsNullOrEmpty(tb.Rows[0][0].ToString()))
|
||||
{
|
||||
var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||
if (sysTestRule != null)
|
||||
{
|
||||
if (sysTestRule.PassingScore > 0)
|
||||
{
|
||||
if (decimal.Parse(tb.Rows[0][0].ToString()) < sysTestRule.PassingScore)
|
||||
{
|
||||
inTestRecord = "<span style='color:red'>"+tb.Rows[0][0].ToString()+ "</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
inTestRecord = tb.Rows[0][0].ToString() ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (decimal.Parse(tb.Rows[0][0].ToString()) < 80)
|
||||
{
|
||||
inTestRecord = "<span style='color:red'>" + tb.Rows[0][0].ToString() + "</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
inTestRecord = tb.Rows[0][0].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (decimal.Parse(tb.Rows[0][0].ToString()) < 80)
|
||||
{
|
||||
inTestRecord = "<span style='color:red'>" + tb.Rows[0][0].ToString() + "</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
inTestRecord = tb.Rows[0][0].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return inTestRecord;
|
||||
}
|
||||
protected string ConvertInOutWayName(object InOutWay)
|
||||
{
|
||||
string name = string.Empty;
|
||||
if (InOutWay != null)
|
||||
|
||||
Reference in New Issue
Block a user