提交代码
This commit is contained in:
@@ -476,73 +476,159 @@ namespace BLL
|
||||
/// <param name="workPostIds">培训岗位ID</param>
|
||||
/// <param name="trainTypeId">培训类型ID</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId)
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId,string InTime,string strParam)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
DateTime inDateTime=DateTime.Now;
|
||||
if (!string.IsNullOrEmpty(InTime)&&!"null".Equals(InTime))
|
||||
{
|
||||
inDateTime = DateTime.Parse(InTime);
|
||||
}
|
||||
|
||||
List<string> unitIdList = Funs.GetStrListByStr(unitIds, ',');
|
||||
var getPersons = from x in db.View_SitePerson_Person
|
||||
where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == true
|
||||
var getPersons = (from x in db.View_SitePerson_Person
|
||||
where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == true &&(string.IsNullOrEmpty(strParam)||x.PersonName.Contains(strParam)) && (string.IsNullOrEmpty(InTime) || x.InTime < inDateTime)
|
||||
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now)
|
||||
select new Model.PersonItem
|
||||
{
|
||||
PersonId = x.PersonId,
|
||||
CardNo = x.CardNo,
|
||||
PersonName = x.PersonName,
|
||||
SexName = x.SexName,
|
||||
IdentityCard = x.IdentityCard,
|
||||
Address = x.Address,
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectCode = x.ProjectCode,
|
||||
ProjectName = x.ProjectName,
|
||||
UnitId = x.UnitId,
|
||||
UnitCode = x.UnitCode,
|
||||
UnitName = x.UnitName,
|
||||
TeamGroupId = x.TeamGroupId,
|
||||
TeamGroupName = x.TeamGroupName,
|
||||
WorkPostId = x.WorkPostId,
|
||||
WorkPostName = x.WorkPostName,
|
||||
InTime = string.Format("{0:yyyy-MM-dd}", x.InTime),
|
||||
OutTime = string.Format("{0:yyyy-MM-dd}", x.OutTime),
|
||||
OutResult = x.OutResult,
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
DepartName = x.DepartName,
|
||||
};
|
||||
{
|
||||
PersonId = x.PersonId,
|
||||
CardNo = x.CardNo,
|
||||
PersonName = x.PersonName,
|
||||
SexName = x.SexName,
|
||||
IdentityCard = x.IdentityCard,
|
||||
Address = x.Address,
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectCode = x.ProjectCode,
|
||||
ProjectName = x.ProjectName,
|
||||
UnitId = x.UnitId,
|
||||
UnitCode = x.UnitCode,
|
||||
UnitName = x.UnitName,
|
||||
TeamGroupId = x.TeamGroupId,
|
||||
TeamGroupName = x.TeamGroupName,
|
||||
WorkPostId = x.WorkPostId,
|
||||
WorkPostName = x.WorkPostName,
|
||||
InTime = string.Format("{0:yyyy-MM-dd}", x.InTime),
|
||||
OutTime = string.Format("{0:yyyy-MM-dd}", x.OutTime),
|
||||
OutResult = x.OutResult,
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
DepartName = x.DepartName,
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(workPostIds))
|
||||
{
|
||||
List<string> workPostIdList = Funs.GetStrListByStr(workPostIds, ',');
|
||||
getPersons = getPersons.Where(x => workPostIdList.Contains(x.WorkPostId));
|
||||
getPersons = getPersons.Where(x => workPostIdList.Contains(x.WorkPostId)).ToList();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(trainTypeId) &&trainTypeId == Const.SpecialSafeTrainId)//专项安全培训
|
||||
{
|
||||
var ids = db.Base_WorkPost.Where(x => x.PostType == "2").Select(x => x.WorkPostId).ToList();
|
||||
getPersons = getPersons.Where(x => ids.Contains(x.WorkPostId)).ToList();
|
||||
}
|
||||
|
||||
List<Model.PersonItem> getTrainPersonList = new List<Model.PersonItem>();
|
||||
var getTrainType = TrainTypeService.GetTrainTypeById(trainTypeId);
|
||||
if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false))
|
||||
{
|
||||
foreach (var item in getPersons)
|
||||
{
|
||||
var getTrainPersonIdList1 = (from x in db.EduTrain_TrainRecordDetail
|
||||
join y in db.EduTrain_TrainRecord on x.TrainingId equals y.TrainingId
|
||||
where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && x.CheckResult == true && x.PersonId == item.PersonId
|
||||
select x).FirstOrDefault();
|
||||
if (getTrainPersonIdList1 == null)
|
||||
{
|
||||
var getTrainPersonIdList2 = (from x in db.Training_Task
|
||||
join y in db.Training_Plan on x.PlanId equals y.PlanId
|
||||
where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.UserId == item.PersonId
|
||||
select x).FirstOrDefault();
|
||||
if (getTrainPersonIdList2 == null)
|
||||
{
|
||||
getTrainPersonList.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return getTrainPersonList;
|
||||
}
|
||||
else
|
||||
{
|
||||
return getPersons.ToList();
|
||||
}
|
||||
if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat.Value == false))
|
||||
{
|
||||
int score = 80;
|
||||
var sysTestRule = db.Sys_TestRule.FirstOrDefault();
|
||||
if (sysTestRule != null)
|
||||
{
|
||||
if (sysTestRule.PassingScore > 0)
|
||||
{
|
||||
score = sysTestRule.PassingScore;
|
||||
}
|
||||
}
|
||||
foreach (var item in getPersons)
|
||||
{
|
||||
var getTrainPersonIdList3 = (from x in db.Training_TestRecord
|
||||
join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
|
||||
where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.TestManId == item.PersonId
|
||||
where x.TestScores > score
|
||||
select x).FirstOrDefault();
|
||||
if (getTrainPersonIdList3 != null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var getTrainPersonIdList1 = (from x in db.EduTrain_TrainRecordDetail
|
||||
join y in db.EduTrain_TrainRecord on x.TrainingId equals y.TrainingId
|
||||
where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && x.CheckResult == true && x.PersonId == item.PersonId
|
||||
select x).FirstOrDefault();
|
||||
if (getTrainPersonIdList1 == null)
|
||||
{
|
||||
var getTrainPersonIdList2 = (from x in db.Training_Task
|
||||
join y in db.Training_Plan on x.PlanId equals y.PlanId
|
||||
where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.UserId == item.PersonId
|
||||
|
||||
select x).FirstOrDefault();
|
||||
if (getTrainPersonIdList2 == null)
|
||||
{
|
||||
getTrainPersonList.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return getTrainPersonList;
|
||||
}
|
||||
else if (getTrainType != null && getTrainType.IsRepeat.HasValue && getTrainType.IsRepeat.Value == true)//重复的 过滤人员
|
||||
{
|
||||
foreach (var item in getPersons)
|
||||
{
|
||||
//int score = 80;
|
||||
//var sysTestRule = db.Sys_TestRule.FirstOrDefault();
|
||||
//if (sysTestRule != null)
|
||||
//{
|
||||
// if (sysTestRule.PassingScore > 0)
|
||||
// {
|
||||
// score = sysTestRule.PassingScore;
|
||||
// }
|
||||
//}
|
||||
//var getTrainPersonIdList2 = (from x in db.Training_TestRecord
|
||||
// join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
|
||||
// where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.TestManId == item.PersonId
|
||||
// where x.TestScores > score
|
||||
// select x).FirstOrDefault();
|
||||
//if (getTrainPersonIdList2 != null)
|
||||
//{
|
||||
// continue;
|
||||
//}
|
||||
getTrainPersonList.Add(item);
|
||||
}
|
||||
return getTrainPersonList;
|
||||
}
|
||||
//else if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false))//重复的 过滤人员
|
||||
//{
|
||||
// int score = 80;
|
||||
// var sysTestRule = db.Sys_TestRule.FirstOrDefault();
|
||||
// if (sysTestRule != null)
|
||||
// {
|
||||
// if (sysTestRule.PassingScore > 0)
|
||||
// {
|
||||
// score = sysTestRule.PassingScore;
|
||||
// }
|
||||
// }
|
||||
// foreach (var item in getPersons)
|
||||
// {
|
||||
|
||||
// var getTrainPersonIdList2 = (from x in db.Training_TestRecord
|
||||
// join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
|
||||
// where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.TestManId == item.PersonId
|
||||
// where x.TestScores > score
|
||||
// select x).FirstOrDefault();
|
||||
// if (getTrainPersonIdList2 != null)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
// getTrainPersonList.Add(item);
|
||||
// }
|
||||
// return getTrainPersonList;
|
||||
//}
|
||||
else
|
||||
{
|
||||
return getPersons.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Lib\Microsoft.SQLServer.ManagedDTS.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -716,13 +717,17 @@
|
||||
<Compile Include="HSSE\Solution\ExpertArgumentService.cs" />
|
||||
<Compile Include="HSSE\Solution\LargerHazardService.cs" />
|
||||
<Compile Include="HSSE\Solution\SolutionTemplateService.cs" />
|
||||
<Compile Include="HSSE\Technique\AwardStandardsService.cs" />
|
||||
<Compile Include="HSSE\Technique\ConstructionStandardsService.cs" />
|
||||
<Compile Include="HSSE\Technique\EmergencyService.cs" />
|
||||
<Compile Include="HSSE\Technique\HazardListService.cs" />
|
||||
<Compile Include="HSSE\Technique\HazardListTypeService.cs" />
|
||||
<Compile Include="HSSE\Technique\EnvironmentalService.cs" />
|
||||
<Compile Include="HSSE\Technique\ProtectionStandardsService.cs" />
|
||||
<Compile Include="HSSE\Technique\RectifyItemService.cs" />
|
||||
<Compile Include="HSSE\Technique\RectifyService.cs" />
|
||||
<Compile Include="HSSE\Technique\RiskEvaluationRecordService.cs" />
|
||||
<Compile Include="HSSE\Technique\SafetyResponsibilitiesService.cs" />
|
||||
<Compile Include="HSSE\Technique\SpecialSchemeService.cs" />
|
||||
<Compile Include="HSSE\Technique\Technique_CheckItemDetailService.cs" />
|
||||
<Compile Include="HSSE\Technique\Technique_CheckItemSetService.cs" />
|
||||
|
||||
@@ -1890,6 +1890,25 @@ namespace BLL
|
||||
/// 施工方案
|
||||
/// </summary>
|
||||
public const string SpecialSchemeMenuId = "3E2F2FFD-ED2E-4914-8370-D97A68398814";
|
||||
|
||||
/// <summary>
|
||||
/// 防护标准
|
||||
/// </summary>
|
||||
public const string ProtectionStandardsMenuId = "8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201";
|
||||
|
||||
/// <summary>
|
||||
/// 安全职责
|
||||
/// </summary>
|
||||
public const string SafetyResponsibilitiesMenuId = "6D75EA6C-0E49-4B04-850B-930B628EE1DF";
|
||||
/// <summary>
|
||||
/// 队伍文明施工标准
|
||||
/// </summary>
|
||||
public const string ConstructionStandardsMenuId = "23ACEE2E-0E56-4136-9DFB-C971B3C4EA60";
|
||||
/// <summary>
|
||||
/// 奖罚标准
|
||||
/// </summary>
|
||||
public const string AwardStandardsMenuId = "E4FD28A8-9715-452F-BB16-5FF87BE7D32B";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 标牌管理
|
||||
@@ -6267,6 +6286,10 @@ namespace BLL
|
||||
public const string InterFaceSetMenuId = "FFD221D7-AE05-447F-8727-80058A04F401";
|
||||
public const string InterFaceTaskMenuId = "FFD221D7-AE05-447F-8727-80058A04F402";
|
||||
public const string IFLogListMenuId = "FFD221D7-AE05-447F-8727-80058A04F404";
|
||||
/// <summary>
|
||||
/// 专项安全培训 id
|
||||
/// </summary>
|
||||
public static string SpecialSafeTrainId = "0e7fdf78-eaa0-4d00-a60b-490040bbea18";
|
||||
#endregion
|
||||
|
||||
#region 数据同步状态
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
namespace BLL;
|
||||
|
||||
public class AwardStandardsService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取
|
||||
/// </summary>
|
||||
/// <param name="AwardStandardsId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Technique_AwardStandards GetAwardStandardsListById(string AwardStandardsId)
|
||||
{
|
||||
return Funs.DB.Technique_AwardStandards.FirstOrDefault(e =>
|
||||
e.AwardStandardsId == AwardStandardsId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取集合
|
||||
/// </summary>
|
||||
/// <param name="AwardStandardsId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<AwardStandardsItem> GetAwardStandardsList(int PageNumber, int PageSize)
|
||||
{
|
||||
List<AwardStandardsItem> getDataLists = (from x in Funs.DB.Technique_AwardStandards
|
||||
select new AwardStandardsItem
|
||||
{
|
||||
AwardStandardsId = x.AwardStandardsId,
|
||||
AwardStandardsCode = x.AwardStandardsCode,
|
||||
AwardStandardsName = x.AwardStandardsName,
|
||||
AttachUrl = x.AttachUrl,
|
||||
CompileMan = x.CompileMan,
|
||||
CompileDate = x.CompileDate,
|
||||
IsPass = x.IsPass,
|
||||
UpState = x.UpState,
|
||||
Remark = x.Remark
|
||||
}).ToList();
|
||||
if (PageNumber > 0 && PageSize > 0)
|
||||
{
|
||||
getDataLists = getDataLists.Skip((PageNumber - 1) * PageSize).Take(PageSize).ToList();
|
||||
}
|
||||
|
||||
return getDataLists;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="AwardStandardsList"></param>
|
||||
public static void AddAwardStandardsList(Model.Technique_AwardStandards AwardStandardsList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_AwardStandards newAwardStandardsList = new Model.Technique_AwardStandards
|
||||
{
|
||||
AwardStandardsId = AwardStandardsList.AwardStandardsId,
|
||||
AwardStandardsCode = AwardStandardsList.AwardStandardsCode,
|
||||
AwardStandardsName = AwardStandardsList.AwardStandardsName,
|
||||
AttachUrl = AwardStandardsList.AttachUrl,
|
||||
CompileMan = AwardStandardsList.CompileMan,
|
||||
CompileDate = AwardStandardsList.CompileDate,
|
||||
};
|
||||
newAwardStandardsList.CompileMan = AwardStandardsList.CompileMan;
|
||||
newAwardStandardsList.CompileDate = AwardStandardsList.CompileDate;
|
||||
newAwardStandardsList.IsPass = AwardStandardsList.IsPass;
|
||||
newAwardStandardsList.UpState = AwardStandardsList.UpState;
|
||||
newAwardStandardsList.Remark = AwardStandardsList.Remark;
|
||||
db.Technique_AwardStandards.InsertOnSubmit(newAwardStandardsList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="AwardStandardsList"></param>
|
||||
public static void UpdateAwardStandardsList(Model.Technique_AwardStandards AwardStandardsList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_AwardStandards newAwardStandardsList =
|
||||
db.Technique_AwardStandards.FirstOrDefault(e =>
|
||||
e.AwardStandardsId == AwardStandardsList.AwardStandardsId);
|
||||
if (newAwardStandardsList != null)
|
||||
{
|
||||
newAwardStandardsList.AwardStandardsCode = AwardStandardsList.AwardStandardsCode;
|
||||
newAwardStandardsList.AwardStandardsName = AwardStandardsList.AwardStandardsName;
|
||||
newAwardStandardsList.AttachUrl = AwardStandardsList.AttachUrl;
|
||||
newAwardStandardsList.CompileMan = AwardStandardsList.CompileMan;
|
||||
newAwardStandardsList.CompileDate = AwardStandardsList.CompileDate;
|
||||
newAwardStandardsList.UpState = AwardStandardsList.UpState;
|
||||
newAwardStandardsList.Remark = AwardStandardsList.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///根据主键删除
|
||||
/// </summary>
|
||||
/// <param name="AwardStandardsId"></param>
|
||||
public static void DeleteAwardStandardsListById(string AwardStandardsId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_AwardStandards AwardStandardsList =
|
||||
db.Technique_AwardStandards.FirstOrDefault(e => e.AwardStandardsId == AwardStandardsId);
|
||||
if (AwardStandardsList != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(AwardStandardsList.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, AwardStandardsList.AttachUrl);
|
||||
}
|
||||
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(AwardStandardsList.AwardStandardsId);
|
||||
|
||||
db.Technique_AwardStandards.DeleteOnSubmit(AwardStandardsList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public class AwardStandardsItem
|
||||
{
|
||||
|
||||
public string AwardStandardsId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string AwardStandardsCode
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string AwardStandardsName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string AttachUrl
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string CompileMan
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public System.Nullable<System.DateTime> CompileDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public System.Nullable<bool> IsPass
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string UpState
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string Remark
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
namespace BLL;
|
||||
|
||||
public class ConstructionStandardsService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取
|
||||
/// </summary>
|
||||
/// <param name="ConstructionStandardsId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Technique_ConstructionStandards GetConstructionStandardsListById(string ConstructionStandardsId)
|
||||
{
|
||||
return Funs.DB.Technique_ConstructionStandards.FirstOrDefault(e =>
|
||||
e.ConstructionStandardsId == ConstructionStandardsId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取集合
|
||||
/// </summary>
|
||||
/// <param name="ConstructionStandardsId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<ConstructionStandardsItem> GetConstructionStandardsList(int PageNumber, int PageSize)
|
||||
{
|
||||
List<ConstructionStandardsItem> getDataLists = (from x in Funs.DB.Technique_ConstructionStandards
|
||||
select new ConstructionStandardsItem
|
||||
{
|
||||
ConstructionStandardsId = x.ConstructionStandardsId,
|
||||
ConstructionStandardsCode = x.ConstructionStandardsCode,
|
||||
ConstructionStandardsName = x.ConstructionStandardsName,
|
||||
AttachUrl = x.AttachUrl,
|
||||
CompileMan = x.CompileMan,
|
||||
CompileDate = x.CompileDate,
|
||||
IsPass = x.IsPass,
|
||||
UpState = x.UpState,
|
||||
Remark = x.Remark
|
||||
}).ToList();
|
||||
if (PageNumber > 0 && PageSize > 0)
|
||||
{
|
||||
getDataLists = getDataLists.Skip((PageNumber - 1) * PageSize).Take(PageSize).ToList();
|
||||
}
|
||||
return getDataLists;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="ConstructionStandardsList"></param>
|
||||
public static void AddConstructionStandardsList(Model.Technique_ConstructionStandards ConstructionStandardsList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_ConstructionStandards newConstructionStandardsList = new Model.Technique_ConstructionStandards
|
||||
{
|
||||
ConstructionStandardsId = ConstructionStandardsList.ConstructionStandardsId,
|
||||
ConstructionStandardsCode = ConstructionStandardsList.ConstructionStandardsCode,
|
||||
ConstructionStandardsName = ConstructionStandardsList.ConstructionStandardsName,
|
||||
AttachUrl = ConstructionStandardsList.AttachUrl,
|
||||
CompileMan = ConstructionStandardsList.CompileMan,
|
||||
CompileDate = ConstructionStandardsList.CompileDate,
|
||||
};
|
||||
newConstructionStandardsList.CompileMan = ConstructionStandardsList.CompileMan;
|
||||
newConstructionStandardsList.CompileDate = ConstructionStandardsList.CompileDate;
|
||||
newConstructionStandardsList.IsPass = ConstructionStandardsList.IsPass;
|
||||
newConstructionStandardsList.UpState = ConstructionStandardsList.UpState;
|
||||
newConstructionStandardsList.Remark = ConstructionStandardsList.Remark;
|
||||
db.Technique_ConstructionStandards.InsertOnSubmit(newConstructionStandardsList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="ConstructionStandardsList"></param>
|
||||
public static void UpdateConstructionStandardsList(Model.Technique_ConstructionStandards ConstructionStandardsList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_ConstructionStandards newConstructionStandardsList =
|
||||
db.Technique_ConstructionStandards.FirstOrDefault(e =>
|
||||
e.ConstructionStandardsId == ConstructionStandardsList.ConstructionStandardsId);
|
||||
if (newConstructionStandardsList != null)
|
||||
{
|
||||
newConstructionStandardsList.ConstructionStandardsCode = ConstructionStandardsList.ConstructionStandardsCode;
|
||||
newConstructionStandardsList.ConstructionStandardsName = ConstructionStandardsList.ConstructionStandardsName;
|
||||
newConstructionStandardsList.AttachUrl = ConstructionStandardsList.AttachUrl;
|
||||
newConstructionStandardsList.CompileMan = ConstructionStandardsList.CompileMan;
|
||||
newConstructionStandardsList.CompileDate = ConstructionStandardsList.CompileDate;
|
||||
newConstructionStandardsList.UpState = ConstructionStandardsList.UpState;
|
||||
newConstructionStandardsList.Remark = ConstructionStandardsList.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///根据主键删除
|
||||
/// </summary>
|
||||
/// <param name="ConstructionStandardsId"></param>
|
||||
public static void DeleteConstructionStandardsListById(string ConstructionStandardsId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_ConstructionStandards ConstructionStandardsList =
|
||||
db.Technique_ConstructionStandards.FirstOrDefault(e => e.ConstructionStandardsId == ConstructionStandardsId);
|
||||
if (ConstructionStandardsList != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ConstructionStandardsList.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, ConstructionStandardsList.AttachUrl);
|
||||
}
|
||||
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(ConstructionStandardsList.ConstructionStandardsId);
|
||||
|
||||
db.Technique_ConstructionStandards.DeleteOnSubmit(ConstructionStandardsList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public class ConstructionStandardsItem
|
||||
{
|
||||
|
||||
public string ConstructionStandardsId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string ConstructionStandardsCode
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string ConstructionStandardsName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string AttachUrl
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string CompileMan
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public System.Nullable<System.DateTime> CompileDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public System.Nullable<bool> IsPass
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string UpState
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string Remark
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Model;
|
||||
|
||||
namespace BLL;
|
||||
|
||||
public class ProtectionStandardsService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取
|
||||
/// </summary>
|
||||
/// <param name="ProtectionStandardsId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Technique_ProtectionStandards GetProtectionStandardsListById(string ProtectionStandardsId)
|
||||
{
|
||||
return Funs.DB.Technique_ProtectionStandards.FirstOrDefault(e =>
|
||||
e.ProtectionStandardsId == ProtectionStandardsId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取集合
|
||||
/// </summary>
|
||||
/// <param name="ProtectionStandardsId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<ProtectionStandardsItem> GetProtectionStandardsList(int PageNumber, int PageSize)
|
||||
{
|
||||
List<ProtectionStandardsItem> getDataLists = (from x in Funs.DB.Technique_ProtectionStandards
|
||||
select new ProtectionStandardsItem
|
||||
{
|
||||
ProtectionStandardsId = x.ProtectionStandardsId,
|
||||
ProtectionStandardsCode = x.ProtectionStandardsCode,
|
||||
ProtectionStandardsName = x.ProtectionStandardsName,
|
||||
AttachUrl = x.AttachUrl,
|
||||
CompileMan = x.CompileMan,
|
||||
CompileDate = x.CompileDate,
|
||||
IsPass = x.IsPass,
|
||||
UpState = x.UpState,
|
||||
Remark = x.Remark
|
||||
}).ToList();
|
||||
if (PageNumber > 0 && PageSize > 0)
|
||||
{
|
||||
getDataLists = getDataLists.Skip((PageNumber - 1) * PageSize).Take(PageSize).ToList();
|
||||
}
|
||||
return getDataLists;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="ProtectionStandardsList"></param>
|
||||
public static void AddProtectionStandardsList(Model.Technique_ProtectionStandards ProtectionStandardsList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_ProtectionStandards newProtectionStandardsList = new Model.Technique_ProtectionStandards
|
||||
{
|
||||
ProtectionStandardsId = ProtectionStandardsList.ProtectionStandardsId,
|
||||
ProtectionStandardsCode = ProtectionStandardsList.ProtectionStandardsCode,
|
||||
ProtectionStandardsName = ProtectionStandardsList.ProtectionStandardsName,
|
||||
AttachUrl = ProtectionStandardsList.AttachUrl,
|
||||
CompileMan = ProtectionStandardsList.CompileMan,
|
||||
CompileDate = ProtectionStandardsList.CompileDate,
|
||||
};
|
||||
newProtectionStandardsList.CompileMan = ProtectionStandardsList.CompileMan;
|
||||
newProtectionStandardsList.CompileDate = ProtectionStandardsList.CompileDate;
|
||||
newProtectionStandardsList.IsPass = ProtectionStandardsList.IsPass;
|
||||
newProtectionStandardsList.UpState = ProtectionStandardsList.UpState;
|
||||
newProtectionStandardsList.Remark = ProtectionStandardsList.Remark;
|
||||
db.Technique_ProtectionStandards.InsertOnSubmit(newProtectionStandardsList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="ProtectionStandardsList"></param>
|
||||
public static void UpdateProtectionStandardsList(Model.Technique_ProtectionStandards ProtectionStandardsList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_ProtectionStandards newProtectionStandardsList =
|
||||
db.Technique_ProtectionStandards.FirstOrDefault(e =>
|
||||
e.ProtectionStandardsId == ProtectionStandardsList.ProtectionStandardsId);
|
||||
if (newProtectionStandardsList != null)
|
||||
{
|
||||
newProtectionStandardsList.ProtectionStandardsCode = ProtectionStandardsList.ProtectionStandardsCode;
|
||||
newProtectionStandardsList.ProtectionStandardsName = ProtectionStandardsList.ProtectionStandardsName;
|
||||
newProtectionStandardsList.AttachUrl = ProtectionStandardsList.AttachUrl;
|
||||
newProtectionStandardsList.CompileMan = ProtectionStandardsList.CompileMan;
|
||||
newProtectionStandardsList.CompileDate = ProtectionStandardsList.CompileDate;
|
||||
newProtectionStandardsList.UpState = ProtectionStandardsList.UpState;
|
||||
newProtectionStandardsList.Remark = ProtectionStandardsList.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///根据主键删除
|
||||
/// </summary>
|
||||
/// <param name="ProtectionStandardsId"></param>
|
||||
public static void DeleteProtectionStandardsListById(string ProtectionStandardsId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_ProtectionStandards ProtectionStandardsList =
|
||||
db.Technique_ProtectionStandards.FirstOrDefault(e => e.ProtectionStandardsId == ProtectionStandardsId);
|
||||
if (ProtectionStandardsList != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ProtectionStandardsList.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, ProtectionStandardsList.AttachUrl);
|
||||
}
|
||||
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(ProtectionStandardsList.ProtectionStandardsId);
|
||||
|
||||
db.Technique_ProtectionStandards.DeleteOnSubmit(ProtectionStandardsList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ProtectionStandardsItem
|
||||
{
|
||||
|
||||
public string ProtectionStandardsId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string ProtectionStandardsCode
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string ProtectionStandardsName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string AttachUrl
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string CompileMan
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public System.Nullable<System.DateTime> CompileDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public System.Nullable<bool> IsPass
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string UpState
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string Remark
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
namespace BLL;
|
||||
|
||||
public class SafetyResponsibilitiesService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键
|
||||
/// </summary>
|
||||
/// <param name="SafetyResponsibilitiesId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Technique_SafetyResponsibilities GetSafetyResponsibilitiesListById(string SafetyResponsibilitiesId)
|
||||
{
|
||||
return Funs.DB.Technique_SafetyResponsibilities.FirstOrDefault(e =>
|
||||
e.SafetyResponsibilitiesId == SafetyResponsibilitiesId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取集合
|
||||
/// </summary>
|
||||
/// <param name="SafetyResponsibilitiesId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<SafetyResponsibilitiesItem> GetSafetyResponsibilitiesList(int PageNumber, int PageSize)
|
||||
{
|
||||
List<SafetyResponsibilitiesItem> getDataLists = (from x in Funs.DB.Technique_SafetyResponsibilities
|
||||
select new SafetyResponsibilitiesItem
|
||||
{
|
||||
SafetyResponsibilitiesId = x.SafetyResponsibilitiesId,
|
||||
SafetyResponsibilitiesCode = x.SafetyResponsibilitiesCode,
|
||||
SafetyResponsibilitiesName = x.SafetyResponsibilitiesName,
|
||||
AttachUrl = x.AttachUrl,
|
||||
CompileMan = x.CompileMan,
|
||||
CompileDate = x.CompileDate,
|
||||
IsPass = x.IsPass,
|
||||
UpState = x.UpState,
|
||||
Remark = x.Remark
|
||||
}).ToList();
|
||||
if (PageNumber > 0 && PageSize > 0)
|
||||
{
|
||||
getDataLists = getDataLists.Skip((PageNumber - 1) * PageSize).Take(PageSize).ToList();
|
||||
}
|
||||
return getDataLists;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加专项方案
|
||||
/// </summary>
|
||||
/// <param name="SafetyResponsibilitiesList"></param>
|
||||
public static void AddSafetyResponsibilitiesList(Model.Technique_SafetyResponsibilities SafetyResponsibilitiesList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_SafetyResponsibilities newSafetyResponsibilitiesList = new Model.Technique_SafetyResponsibilities
|
||||
{
|
||||
SafetyResponsibilitiesId = SafetyResponsibilitiesList.SafetyResponsibilitiesId,
|
||||
SafetyResponsibilitiesCode = SafetyResponsibilitiesList.SafetyResponsibilitiesCode,
|
||||
SafetyResponsibilitiesName = SafetyResponsibilitiesList.SafetyResponsibilitiesName,
|
||||
AttachUrl = SafetyResponsibilitiesList.AttachUrl,
|
||||
CompileMan = SafetyResponsibilitiesList.CompileMan,
|
||||
CompileDate = SafetyResponsibilitiesList.CompileDate,
|
||||
};
|
||||
newSafetyResponsibilitiesList.CompileMan = SafetyResponsibilitiesList.CompileMan;
|
||||
newSafetyResponsibilitiesList.CompileDate = SafetyResponsibilitiesList.CompileDate;
|
||||
newSafetyResponsibilitiesList.IsPass = SafetyResponsibilitiesList.IsPass;
|
||||
newSafetyResponsibilitiesList.UpState = SafetyResponsibilitiesList.UpState;
|
||||
newSafetyResponsibilitiesList.Remark = SafetyResponsibilitiesList.Remark;
|
||||
db.Technique_SafetyResponsibilities.InsertOnSubmit(newSafetyResponsibilitiesList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="SafetyResponsibilitiesList"></param>
|
||||
public static void UpdateSafetyResponsibilitiesList(Model.Technique_SafetyResponsibilities SafetyResponsibilitiesList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_SafetyResponsibilities newSafetyResponsibilitiesList =
|
||||
db.Technique_SafetyResponsibilities.FirstOrDefault(e =>
|
||||
e.SafetyResponsibilitiesId == SafetyResponsibilitiesList.SafetyResponsibilitiesId);
|
||||
if (newSafetyResponsibilitiesList != null)
|
||||
{
|
||||
newSafetyResponsibilitiesList.SafetyResponsibilitiesCode = SafetyResponsibilitiesList.SafetyResponsibilitiesCode;
|
||||
newSafetyResponsibilitiesList.SafetyResponsibilitiesName = SafetyResponsibilitiesList.SafetyResponsibilitiesName;
|
||||
newSafetyResponsibilitiesList.AttachUrl = SafetyResponsibilitiesList.AttachUrl;
|
||||
newSafetyResponsibilitiesList.CompileMan = SafetyResponsibilitiesList.CompileMan;
|
||||
newSafetyResponsibilitiesList.CompileDate = SafetyResponsibilitiesList.CompileDate;
|
||||
newSafetyResponsibilitiesList.UpState = SafetyResponsibilitiesList.UpState;
|
||||
newSafetyResponsibilitiesList.Remark = SafetyResponsibilitiesList.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///根据主键删
|
||||
/// </summary>
|
||||
/// <param name="SafetyResponsibilitiesId"></param>
|
||||
public static void DeleteSafetyResponsibilitiesListById(string SafetyResponsibilitiesId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_SafetyResponsibilities SafetyResponsibilitiesList =
|
||||
db.Technique_SafetyResponsibilities.FirstOrDefault(e => e.SafetyResponsibilitiesId == SafetyResponsibilitiesId);
|
||||
if (SafetyResponsibilitiesList != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(SafetyResponsibilitiesList.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, SafetyResponsibilitiesList.AttachUrl);
|
||||
}
|
||||
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(SafetyResponsibilitiesList.SafetyResponsibilitiesId);
|
||||
|
||||
db.Technique_SafetyResponsibilities.DeleteOnSubmit(SafetyResponsibilitiesList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public class SafetyResponsibilitiesItem
|
||||
{
|
||||
|
||||
public string SafetyResponsibilitiesId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string SafetyResponsibilitiesCode
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string SafetyResponsibilitiesName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string AttachUrl
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string CompileMan
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public System.Nullable<System.DateTime> CompileDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public System.Nullable<bool> IsPass
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string UpState
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string Remark
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user