20210520
This commit is contained in:
@@ -418,96 +418,61 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.txtStartDate.Text.Trim()) || string.IsNullOrEmpty(this.txtEndDate.Text.Trim()))
|
||||
{
|
||||
ShowNotify("请选择开始、结束日期!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
var certificates = from x in Funs.DB.Base_Certificate select x;
|
||||
var quantityLists = from x in Funs.DB.JDGL_QuantityList where x.ProjectId == this.ProjectId select x;
|
||||
var quantityCompletionLists = from x in Funs.DB.JDGL_QuantityCompletion where x.ProjectId == this.ProjectId select x;
|
||||
string quantityListId = string.Empty;
|
||||
int a = quantityCompletions.Count();
|
||||
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
||||
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
||||
for (int i = 0; i < a; i++)
|
||||
{
|
||||
//if (getPerson == null)
|
||||
//{
|
||||
// Model.SitePerson_Person newPerson = new Model.SitePerson_Person();
|
||||
// string newKeyID = SQLHelper.GetNewID(typeof(Model.SitePerson_Person));
|
||||
// newPerson.PersonId = newKeyID;
|
||||
// newPerson.ProjectId = Request.Params["ProjectId"];
|
||||
// newPerson.CardNo = quantityCompletions[i].CardNo;
|
||||
// newPerson.PersonName = quantityCompletions[i].PersonName;
|
||||
// newPerson.Sex = quantityCompletions[i].SexName == "男" ? "1" : "2";
|
||||
// newPerson.IdcardType = quantityCompletions[i].IdcardType;
|
||||
// newPerson.IdentityCard = quantityCompletions[i].IdentityCard;
|
||||
// newPerson.IdcardStartDate = quantityCompletions[i].IdcardStartDate;
|
||||
// newPerson.IdcardForever = quantityCompletions[i].IdcardForever;
|
||||
// newPerson.IdcardEndDate = quantityCompletions[i].IdcardEndDate;
|
||||
// newPerson.IdcardAddress = quantityCompletions[i].IdcardAddress;
|
||||
// newPerson.UnitId = quantityCompletions[i].UnitId;
|
||||
// newPerson.WorkPostId = quantityCompletions[i].WorkPostId;
|
||||
// newPerson.TeamGroupId = quantityCompletions[i].TeamGroupId;
|
||||
// newPerson.WorkAreaId = quantityCompletions[i].WorkAreaId;
|
||||
// newPerson.InTime = quantityCompletions[i].InTime;
|
||||
// newPerson.PositionId = quantityCompletions[i].PositionId;
|
||||
// newPerson.PostTitleId = quantityCompletions[i].PostTitleId;
|
||||
// newPerson.EduLevel = quantityCompletions[i].EduLevel;
|
||||
// newPerson.MaritalStatus = quantityCompletions[i].MaritalStatus;
|
||||
// newPerson.PoliticsStatus = quantityCompletions[i].PoliticsStatus;
|
||||
// newPerson.Nation = quantityCompletions[i].Nation;
|
||||
// newPerson.CountryCode = quantityCompletions[i].CountryCode;
|
||||
// newPerson.ProvinceCode = quantityCompletions[i].ProvinceCode;
|
||||
// newPerson.MainCNProfessionalId = quantityCompletions[i].MainCNProfessionalId;
|
||||
// newPerson.ViceCNProfessionalId = quantityCompletions[i].ViceCNProfessionalId;
|
||||
// newPerson.Birthday = quantityCompletions[i].Birthday;
|
||||
// newPerson.Telephone = quantityCompletions[i].Telephone;
|
||||
// newPerson.Address = quantityCompletions[i].Address;
|
||||
// newPerson.OutTime = quantityCompletions[i].OutTime;
|
||||
// newPerson.OutResult = quantityCompletions[i].OutResult;
|
||||
// newPerson.IsForeign = quantityCompletions[i].IsForeign;
|
||||
// newPerson.IsOutside = quantityCompletions[i].IsOutside;
|
||||
// newPerson.IsUsed = quantityCompletions[i].IsUsedName == "是" ? true : false;
|
||||
// newPerson.IsCardUsed = quantityCompletions[i].IsCardUsedName == "是" ? true : false;
|
||||
// BLL.PersonService.AddPerson(newPerson);
|
||||
|
||||
// var item = personQualitys.FirstOrDefault(x => x.Remark == newPerson.IdentityCard);
|
||||
// if (item != null)
|
||||
// {
|
||||
// Model.QualityAudit_PersonQuality newPersonQuality = new Model.QualityAudit_PersonQuality
|
||||
// {
|
||||
// PersonQualityId = SQLHelper.GetNewID(typeof(Model.QualityAudit_PersonQuality)),
|
||||
// PersonId = newPerson.PersonId,
|
||||
// CompileMan = this.CurrUser.UserId,
|
||||
// CompileDate = DateTime.Now
|
||||
// };
|
||||
// var certificate = certificates.FirstOrDefault(x => x.CertificateName == item.CertificateName);
|
||||
// if (certificate != null)
|
||||
// {
|
||||
// newPersonQuality.CertificateId = certificate.CertificateId;
|
||||
// }
|
||||
// newPersonQuality.CertificateName = item.CertificateName;
|
||||
// newPersonQuality.CertificateNo = item.CertificateNo;
|
||||
// newPersonQuality.LimitDate = item.LimitDate;
|
||||
// BLL.PersonQualityService.AddPersonQuality(newPersonQuality);
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// getPerson.CardNo = quantityCompletions[i].CardNo;
|
||||
// getPerson.PersonName = quantityCompletions[i].PersonName;
|
||||
// getPerson.Sex = quantityCompletions[i].SexName == "男" ? "1" : "2";
|
||||
// getPerson.IdentityCard = quantityCompletions[i].IdentityCard;
|
||||
// getPerson.Address = quantityCompletions[i].Address;
|
||||
// getPerson.UnitId = quantityCompletions[i].UnitId;
|
||||
// getPerson.TeamGroupId = quantityCompletions[i].TeamGroupId;
|
||||
// getPerson.WorkAreaId = quantityCompletions[i].WorkAreaId;
|
||||
// getPerson.WorkPostId = quantityCompletions[i].WorkPostId;
|
||||
// //newPerson.CertificateId = quantityCompletions[i].CertificateId;
|
||||
// //newPerson.CertificateCode = quantityCompletions[i].CertificateCode;
|
||||
// //newPerson.CertificateLimitTime = quantityCompletions[i].CertificateLimitTime;
|
||||
// getPerson.InTime = quantityCompletions[i].InTime;
|
||||
// getPerson.OutTime = quantityCompletions[i].OutTime;
|
||||
// getPerson.OutResult = quantityCompletions[i].OutResult;
|
||||
// getPerson.Telephone = quantityCompletions[i].Telephone;
|
||||
// getPerson.IsUsed = quantityCompletions[i].IsUsedName == "是" ? true : false;
|
||||
// getPerson.IsCardUsed = quantityCompletions[i].IsCardUsedName == "是" ? true : false;
|
||||
// Funs.DB.SubmitChanges();
|
||||
//}
|
||||
var oldQuantityList = quantityLists.FirstOrDefault(x => x.ProjectId == this.ProjectId && x.Name == quantityCompletions[i].Name);
|
||||
if (oldQuantityList == null)
|
||||
{
|
||||
Model.JDGL_QuantityList newQuantityList = new Model.JDGL_QuantityList();
|
||||
quantityListId = SQLHelper.GetNewID(typeof(Model.JDGL_QuantityList));
|
||||
newQuantityList.QuantityListId = quantityListId;
|
||||
newQuantityList.ProjectId = this.ProjectId;
|
||||
newQuantityList.Name = quantityCompletions[i].Name;
|
||||
newQuantityList.Unit = quantityCompletions[i].Unit;
|
||||
newQuantityList.DesignNum = quantityCompletions[i].DesignNum;
|
||||
BLL.QuantityListService.AddQuantityList(newQuantityList);
|
||||
}
|
||||
else
|
||||
{
|
||||
quantityListId = oldQuantityList.QuantityListId;
|
||||
oldQuantityList.Unit = quantityCompletions[i].Unit;
|
||||
oldQuantityList.DesignNum = quantityCompletions[i].DesignNum;
|
||||
BLL.QuantityListService.UpdateQuantityList(oldQuantityList);
|
||||
}
|
||||
var oldQuantityCompletion = quantityCompletionLists.FirstOrDefault(x => x.ProjectId == this.ProjectId && x.QuantityListId == quantityListId && x.StartDate == startDate && x.EndDate == endDate);
|
||||
if (oldQuantityCompletion == null)
|
||||
{
|
||||
Model.JDGL_QuantityCompletion newQuantityCompletion = new Model.JDGL_QuantityCompletion();
|
||||
newQuantityCompletion.QuantityCompletionId = SQLHelper.GetNewID(typeof(Model.JDGL_QuantityCompletion));
|
||||
newQuantityCompletion.ProjectId = this.ProjectId;
|
||||
newQuantityCompletion.QuantityListId = quantityListId;
|
||||
newQuantityCompletion.PlanNum = quantityCompletions[i].PlanNum;
|
||||
newQuantityCompletion.RealNum = quantityCompletions[i].RealNum;
|
||||
newQuantityCompletion.CompileMan = this.CurrUser.UserId;
|
||||
newQuantityCompletion.CompileDate = DateTime.Now;
|
||||
newQuantityCompletion.StartDate = startDate;
|
||||
newQuantityCompletion.EndDate = endDate;
|
||||
BLL.QuantityCompletionService.AddQuantityCompletion(newQuantityCompletion);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldQuantityCompletion.PlanNum= quantityCompletions[i].PlanNum;
|
||||
oldQuantityCompletion.RealNum= quantityCompletions[i].RealNum;
|
||||
BLL.QuantityCompletionService.UpdateQuantityCompletion(oldQuantityCompletion);
|
||||
}
|
||||
}
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initFullPath = rootPath + initPath;
|
||||
@@ -581,8 +546,8 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
if (e.EventArgument == "Confirm_OK")
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string uploadfilepath = rootPath + Const.PersonTemplateUrl;
|
||||
string filePath = Const.PersonTemplateUrl;
|
||||
string uploadfilepath = rootPath + Const.QuantityCompletionTemplateUrl;
|
||||
string filePath = Const.QuantityCompletionTemplateUrl;
|
||||
string fileName = Path.GetFileName(filePath);
|
||||
FileInfo info = new FileInfo(uploadfilepath);
|
||||
long fileSize = info.Length;
|
||||
|
||||
Reference in New Issue
Block a user