This commit is contained in:
2021-07-26 11:08:59 +08:00
parent 7700a66999
commit 16bd4f1767
18 changed files with 1180 additions and 216 deletions
@@ -70,6 +70,11 @@ namespace FineUIPro.Web.HSSE.SitePerson
BindGrid(personInfo.PersonId);
this.drpPersonId.Value = personInfo.PersonId;
}
this.txtIdCard.Text = personInfo.IdentityCard;
if (!string.IsNullOrEmpty(personInfo.WorkAreaId))
{
this.drpWorkArea.SelectedValueArray = personInfo.WorkAreaId.Split(',');
}
this.txtWorkArea.Text = personInfo.WorkAreaName;
this.txtAddress.Text = personInfo.Address;
if (personInfo.IntoOutTime != null)
@@ -99,16 +104,35 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
if (!string.IsNullOrEmpty(this.drpPersonId.Value))
{
var person = BLL.PersonService.GetPersonById(this.drpPersonId.Value);
if (person != null)
string[] personIds = this.drpPersonId.Value.Split(',');
string idCards = string.Empty;
string workAreaIds = string.Empty;
string workAreaNames = string.Empty;
foreach (var item in personIds)
{
this.txtIdCard.Text = person.IdentityCard;
if (!string.IsNullOrEmpty(person.WorkAreaId))
var person = BLL.PersonService.GetPersonById(item.Trim());
if (person != null)
{
this.drpWorkArea.SelectedValue = person.WorkAreaId;
this.txtWorkArea.Text = this.drpWorkArea.SelectedItem.Text;
idCards += person.IdentityCard + ",";
workAreaIds += person.WorkAreaId;
if (!string.IsNullOrEmpty(person.WorkAreaId))
{
workAreaNames += BLL.UnitWorkService.getUnitWorkByUnitWorkId(person.WorkAreaId).UnitWorkName + ",";
}
}
}
if (!string.IsNullOrEmpty(idCards))
{
this.txtIdCard.Text = idCards.Substring(0, idCards.LastIndexOf(','));
}
if (!string.IsNullOrEmpty(workAreaIds))
{
this.drpWorkArea.SelectedValueArray = workAreaIds.Split(',');
}
if (!string.IsNullOrEmpty(workAreaNames))
{
this.txtWorkArea.Text = workAreaNames.Substring(0, workAreaNames.LastIndexOf(','));
}
}
}
#endregion
@@ -196,32 +220,67 @@ namespace FineUIPro.Web.HSSE.SitePerson
ShowNotify("请选择人员!", MessageBoxIcon.Warning);
return;
}
Model.SitePerson_Checking personInfo = new Model.SitePerson_Checking
string[] personIds = this.drpPersonId.Value.Split(',');
foreach (var item in personIds)
{
PersonId = this.drpPersonId.Value,
IdentityCard = this.txtIdCard.Text,
ProjectId = this.ProjectId,
WorkAreaName = this.txtWorkArea.Text.Trim(),
Address = this.txtAddress.Text.Trim()
};
string date = string.IsNullOrEmpty(this.txtTime.Text) ? string.Format("{0:yyyy-MM-dd}", DateTime.Now) : this.txtTime.Text.Trim();
string time = string.IsNullOrEmpty(this.txtTime2.Text) ? string.Format("{0:HH:mm:ss}", DateTime.Now) : this.txtTime2.Text.Trim();
personInfo.IntoOutTime = Funs.GetNewDateTimeOrNow(date + " " + time);
personInfo.IntoOut = this.drpType.SelectedValue.Trim();
Model.SitePerson_Checking personInfo = new Model.SitePerson_Checking();
personInfo.ProjectId = this.ProjectId;
personInfo.PersonId = item.Trim();
var person = BLL.PersonService.GetPersonById(personInfo.PersonId);
if (person != null)
{
personInfo.IdentityCard = person.IdentityCard;
if (!string.IsNullOrEmpty(person.WorkAreaId))
{
personInfo.WorkAreaId = person.WorkAreaId;
personInfo.WorkAreaName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(person.WorkAreaId).UnitWorkName;
}
}
personInfo.Address = this.txtAddress.Text.Trim();
string date = string.IsNullOrEmpty(this.txtTime.Text) ? string.Format("{0:yyyy-MM-dd}", DateTime.Now) : this.txtTime.Text.Trim();
string time = string.IsNullOrEmpty(this.txtTime2.Text) ? string.Format("{0:HH:mm:ss}", DateTime.Now) : this.txtTime2.Text.Trim();
personInfo.IntoOutTime = Funs.GetNewDateTimeOrNow(date + " " + time);
personInfo.IntoOut = this.drpType.SelectedValue.Trim();
if (!string.IsNullOrEmpty(CheckingId))
{
personInfo.CheckingId = CheckingId;
BLL.SitePerson_CheckingService.UpdatePersonInfo(personInfo);
BLL.LogService.AddSys_Log(this.CurrUser, personInfo.CardNo, personInfo.CheckingId, BLL.Const.PersonalInfoMenuId, BLL.Const.BtnModify);
}
else
{
//this.CheckingId = SQLHelper.GetNewID();
personInfo.CheckingId = SQLHelper.GetNewID();
BLL.SitePerson_CheckingService.AddPersonInfo(personInfo);
BLL.LogService.AddSys_Log(this.CurrUser, personInfo.CardNo, personInfo.CheckingId, BLL.Const.PersonalInfoMenuId, BLL.Const.BtnDelete);
}
}
//Model.SitePerson_Checking personInfo = new Model.SitePerson_Checking
//{
// PersonId = this.drpPersonId.Value,
// IdentityCard = this.txtIdCard.Text,
// ProjectId = this.ProjectId,
// WorkAreaName = this.txtWorkArea.Text.Trim(),
// Address = this.txtAddress.Text.Trim()
//};
//string date = string.IsNullOrEmpty(this.txtTime.Text) ? string.Format("{0:yyyy-MM-dd}", DateTime.Now) : this.txtTime.Text.Trim();
//string time = string.IsNullOrEmpty(this.txtTime2.Text) ? string.Format("{0:HH:mm:ss}", DateTime.Now) : this.txtTime2.Text.Trim();
//personInfo.IntoOutTime = Funs.GetNewDateTimeOrNow(date + " " + time);
//personInfo.IntoOut = this.drpType.SelectedValue.Trim();
if (!string.IsNullOrEmpty(CheckingId))
{
personInfo.CheckingId = CheckingId;
BLL.SitePerson_CheckingService.UpdatePersonInfo(personInfo);
BLL.LogService.AddSys_Log(this.CurrUser, personInfo.CardNo, personInfo.CheckingId, BLL.Const.PersonalInfoMenuId, BLL.Const.BtnModify);
}
else
{
this.CheckingId = SQLHelper.GetNewID();
personInfo.CheckingId = this.CheckingId;
BLL.SitePerson_CheckingService.AddPersonInfo(personInfo);
BLL.LogService.AddSys_Log(this.CurrUser, personInfo.CardNo, personInfo.CheckingId, BLL.Const.PersonalInfoMenuId, BLL.Const.BtnDelete);
}
//if (!string.IsNullOrEmpty(CheckingId))
//{
// personInfo.CheckingId = CheckingId;
// BLL.SitePerson_CheckingService.UpdatePersonInfo(personInfo);
// BLL.LogService.AddSys_Log(this.CurrUser, personInfo.CardNo, personInfo.CheckingId, BLL.Const.PersonalInfoMenuId, BLL.Const.BtnModify);
//}
//else
//{
// this.CheckingId = SQLHelper.GetNewID();
// personInfo.CheckingId = this.CheckingId;
// BLL.SitePerson_CheckingService.AddPersonInfo(personInfo);
// BLL.LogService.AddSys_Log(this.CurrUser, personInfo.CardNo, personInfo.CheckingId, BLL.Const.PersonalInfoMenuId, BLL.Const.BtnDelete);
//}
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion