20220601 修改Global调用定时器、修改考勤导入列表及导入方法

This commit is contained in:
2022-06-01 14:27:42 +08:00
parent d33b007348
commit 31a7840cda
15 changed files with 365 additions and 210 deletions
@@ -1,8 +1,5 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using AspNet = System.Web.UI.WebControls;
@@ -26,16 +23,15 @@ namespace FineUIPro.Web.HSSE.SitePerson
ViewState["CheckingId"] = value;
}
}
public int RowCount
public string ProjectId
{
get
{
return (int)ViewState["RowCount"];
return (string)ViewState["ProjectId"];
}
set
{
ViewState["RowCount"] = value;
ViewState["ProjectId"] = value;
}
}
#endregion
@@ -51,14 +47,15 @@ namespace FineUIPro.Web.HSSE.SitePerson
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
this.ProjectId = this.CurrUser.LoginProjectId;
////权限按钮方法
this.GetButtonPower();
btnNew.OnClientClick = Window1.GetShowReference("PersonInfoEdit.aspx") + "return false;";
this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的&nbsp;<b><script>{0}</script></b>&nbsp;行数据吗?", Grid1.GetSelectedCountReference());
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
UnitService.InitUnitDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, true);
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId))
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId , true);
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId , this.CurrUser.UnitId))
{
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
this.drpUnit.Enabled = false;
@@ -75,48 +72,10 @@ namespace FineUIPro.Web.HSSE.SitePerson
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT CheckingId,CardNo,ProjectId,IdentityCard,WorkAreaId,IntoOutTime,IntoOut,Address,WorkAreaName,PersonName,UnitId,UnitName,States
FROM dbo.View_SitePerson_Checking where 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND ProjectId = @ProjectId";
if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
{
listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"]));
strSql += " AND States = @States"; ///状态为已完成
listStr.Add(new SqlParameter("@States", BLL.Const.State_2));
}
else
{
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
}
if (this.drpUnit.SelectedValue != Const._Null)
{
strSql += " AND UnitId = @UnitId";
listStr.Add(new SqlParameter("@UnitId", this.drpUnit.SelectedValue));
}
if (!string.IsNullOrEmpty(this.txtPersonName.Text))
{
strSql += " AND PersonName LIKE @PersonName";
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtStartDate.Text))
{
strSql += " AND IntoOutTime >= @StartDate";
listStr.Add(new SqlParameter("@StartDate", this.txtStartDate.Text.Trim()));
}
if (!string.IsNullOrEmpty(this.txtEndDate.Text))
{
strSql += " AND IntoOutTime < @EndDate";
listStr.Add(new SqlParameter("@EndDate", this.txtEndDate.Text.Trim()));
}
strSql += " order by PersonName";
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
this.RowCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
var getData = SitePerson_CheckingService.getListData(this.ProjectId , this.drpUnit.SelectedValue, this.txtPersonName.Text.Trim(),
this.txtStartDate.Text, this.txtEndDate.Text, Grid1);
Grid1.RecordCount = SitePerson_CheckingService.count;
Grid1.DataSource = getData;
Grid1.DataBind();
}
#endregion
@@ -330,7 +289,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.PersonInfoMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId , this.CurrUser.UserId, BLL.Const.PersonInfoMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
@@ -362,7 +321,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("现场人员考勤管理" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = this.RowCount;
this.Grid1.PageSize = this.Grid1.RecordCount;
BindGrid();
Response.Write(GetGridTableHtml1(Grid1));
Response.End();