Merge branch 'master' of https://gitee.com/frane-yang/SGGL_CWCEC
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -15,12 +15,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
/// 上传预设的虚拟路径
|
||||
/// </summary>
|
||||
private string initPath = Const.ExcelUrl;
|
||||
|
||||
/// <summary>
|
||||
/// 人员考勤集合
|
||||
/// </summary>
|
||||
public static List<Model.View_SitePerson_Checking> viewCheckings = new List<Model.View_SitePerson_Checking>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 错误集合
|
||||
/// </summary>
|
||||
@@ -54,11 +49,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
{
|
||||
this.hdFileName.Text = string.Empty;
|
||||
this.hdCheckResult.Text = string.Empty;
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (viewCheckings != null)
|
||||
{
|
||||
viewCheckings.Clear();
|
||||
}
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
errorInfos = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -84,11 +75,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
{
|
||||
ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (viewCheckings!=null)
|
||||
{
|
||||
viewCheckings.Clear();
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
@@ -171,8 +158,8 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
{
|
||||
var units = from x in Funs.DB.Base_Unit select x;
|
||||
var sitePersons = from x in Funs.DB.SitePerson_Person
|
||||
where x.ProjectId == this.ProjectId select x;
|
||||
|
||||
where x.ProjectId == this.ProjectId
|
||||
select x;
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
string col0 = pds.Rows[i][0].ToString().Trim();
|
||||
@@ -198,14 +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 + "]不在人员信息表中!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(col2))
|
||||
{
|
||||
var person = sitePersons.FirstOrDefault(e => e.IdentityCard == col2);
|
||||
@@ -216,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 != "出")
|
||||
@@ -335,6 +333,10 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 人员考勤集合
|
||||
/// </summary>
|
||||
public static List<Model.View_SitePerson_Checking> viewCheckings = new List<Model.View_SitePerson_Checking>();
|
||||
|
||||
#region 将Dataset的数据导入数据库
|
||||
/// <summary>
|
||||
@@ -345,13 +347,13 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
/// <returns></returns>
|
||||
private bool AddDatasetToSQL2(DataTable pds)
|
||||
{
|
||||
viewCheckings.Clear();
|
||||
viewCheckings.Clear();
|
||||
int ir = pds.Rows.Count;
|
||||
if (pds != null && ir > 0)
|
||||
{
|
||||
var units = from x in Funs.DB.Base_Unit select x;
|
||||
var sitePersons = from x in Funs.DB.SitePerson_Person where x.ProjectId == this.ProjectId select x;
|
||||
|
||||
{
|
||||
var sitePersons = from x in Funs.DB.SitePerson_Person
|
||||
where x.ProjectId == this.ProjectId && !x.OutTime.HasValue
|
||||
select x;
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
string col0 = pds.Rows[i][0].ToString().Trim();
|
||||
@@ -369,14 +371,14 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
IntoOut = col3 == "进" ? "1" : "0",
|
||||
IntoOutTime = Convert.ToDateTime(col4)
|
||||
};
|
||||
var person = BLL.PersonService.GetPersonByIdentityCard( this.ProjectId, checking.IdentityCard);
|
||||
var person = sitePersons.FirstOrDefault(x => x.IdentityCard == checking.IdentityCard);
|
||||
if (person != null)
|
||||
{
|
||||
checking.PersonId = person.PersonId;
|
||||
checking.ProjectId = person.ProjectId;
|
||||
}
|
||||
checking.CheckingId = SQLHelper.GetNewID();
|
||||
viewCheckings.Add(checking);
|
||||
checking.CheckingId = SQLHelper.GetNewID();
|
||||
viewCheckings.Add(checking);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (viewCheckings.Count > 0)
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
if (!string.IsNullOrEmpty(idText))
|
||||
{
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(this.drpProject.SelectedValue);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
var getList = returnCardList();
|
||||
@@ -418,7 +418,7 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
int count = 0;
|
||||
string projectId = this.drpProject.SelectedValue;
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(projectId);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
var getIdentityCards = (from x in Funs.DB.SitePerson_Person
|
||||
@@ -470,7 +470,7 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
int count = 0;
|
||||
string projectId = this.drpProject.SelectedValue;
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(projectId);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
var getIdentityCards = (from x in Funs.DB.SitePerson_Person
|
||||
@@ -515,7 +515,7 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
string message = string.Empty;
|
||||
string projectId = this.drpProject.SelectedValue;
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(projectId);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
message= SynchroSetService.updatePersonsExitTime(getRProjects.JTproCode);
|
||||
|
||||
Reference in New Issue
Block a user