20220304 考勤导入、接口修改

This commit is contained in:
2022-03-04 16:15:21 +08:00
parent 5dd16e8bf7
commit 65dfdb13a9
84 changed files with 76 additions and 29 deletions
@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
namespace FineUIPro.Web.HSSE.EduTrain
{
@@ -22,11 +23,8 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
Funs.DropDownPageSize(this.ddlPageSize);
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
if (this.CurrUser.UserId == BLL.Const.sysglyId)
{
this.btnMenuDelete.Hidden = false;
}
////权限按钮方法
this.GetButtonPower();
///更新没有结束时间且超时的考试记录
GetDataService.UpdateTestPlanStates();
// 绑定表格
@@ -127,7 +125,6 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
@@ -138,7 +135,6 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
@@ -301,6 +297,29 @@ namespace FineUIPro.Web.HSSE.EduTrain
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TestRecordPrint.aspx?TestRecordId={0}", Grid1.SelectedRowID, "编辑 - "), "考试试卷", 900, 650));
//}
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectTestRecordMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDelete.Hidden = false;
}
}
}
#endregion
protected void btnPrint_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
@@ -185,20 +185,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
result += "第" + (i + 2).ToString() + "行," + "单位" + "," + "[" + col0 + "]不在单位表中!" + "|";
}
}
if (!string.IsNullOrEmpty(col1))
{
var person = sitePersons.FirstOrDefault(e => e.PersonName == col1);
if (person == null)
{
result += "第" + (i + 2).ToString() + "行," + "姓名" + "," + "[" + col1 + "]不在人员信息表中!" + "|";
}
var personOut = sitePersons.FirstOrDefault(e => e.PersonName == col1 && e.OutTime.HasValue && e.OutTime < DateTime.Now);
if (personOut != null)
{
result += "第" + (i + 2).ToString() + "行," + "姓名" + "," + "[" + col1 + "]已离岗!" + "|";
}
}
if (!string.IsNullOrEmpty(col2))
{
var person = sitePersons.FirstOrDefault(e => e.IdentityCard == col2);
@@ -209,8 +196,26 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
else
{
result += "第" + (i + 2).ToString() + "行," + "身份证号码" + "," + "此项为必填项!" + "|";
if (!string.IsNullOrEmpty(col1))
{
var person = sitePersons.FirstOrDefault(e => e.PersonName == col1);
if (person == null)
{
result += "第" + (i + 2).ToString() + "行," + "姓名" + "," + "[" + col1 + "]不在人员信息表中!" + "|";
}
var personOut = sitePersons.FirstOrDefault(e => e.PersonName == col1 && (!e.OutTime.HasValue || e.OutTime > DateTime.Now));
if (personOut == null)
{
result += "第" + (i + 2).ToString() + "行," + "姓名" + "," + "[" + col1 + "]不在岗!" + "|";
}
}
else
{
result += "第" + (i + 2).ToString() + "行," + "身份证号码/姓名" + "," + "不能都为空!" + "|";
}
}
if (!string.IsNullOrEmpty(col3))
{
if (col3 != "进" && col3 != "出")