CNCEC_SUBQHSE_WUHUAN/SGGL/BLL/TestRun/ProduceProperty/PropertyRunPumpCheckService.cs

93 lines
4.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 机泵巡检记录管理
/// </summary>
public static class PropertyRunPumpCheckService
{
/// <summary>
/// 根据主键获取机泵巡检记录管理信息
/// </summary>
/// <param name="PropertyRunPumpCheckId"></param>
/// <returns></returns>
public static Model.ProduceProperty_PropertyRunPumpCheck GetPropertyRunPumpCheckById(string PropertyRunPumpCheckId)
{
return Funs.DB.ProduceProperty_PropertyRunPumpCheck.FirstOrDefault(e => e.PropertyRunPumpCheckId == PropertyRunPumpCheckId);
}
/// <summary>
/// 添加机泵巡检记录管理信息
/// </summary>
/// <param name="PropertyRunPumpCheck"></param>
public static void AddPropertyRunPumpCheck(Model.ProduceProperty_PropertyRunPumpCheck PropertyRunPumpCheck)
{
Model.ProduceProperty_PropertyRunPumpCheck newPropertyRunPumpCheck = new Model.ProduceProperty_PropertyRunPumpCheck();
newPropertyRunPumpCheck.PropertyRunPumpCheckId = PropertyRunPumpCheck.PropertyRunPumpCheckId;
newPropertyRunPumpCheck.ProjectId = PropertyRunPumpCheck.ProjectId;
newPropertyRunPumpCheck.Code = PropertyRunPumpCheck.Code;
newPropertyRunPumpCheck.UnitWorkId = PropertyRunPumpCheck.UnitWorkId;
newPropertyRunPumpCheck.InstallationMan = PropertyRunPumpCheck.InstallationMan;
newPropertyRunPumpCheck.RecordName = PropertyRunPumpCheck.RecordName;
newPropertyRunPumpCheck.RecordCode = PropertyRunPumpCheck.RecordCode;
newPropertyRunPumpCheck.RecordMan = PropertyRunPumpCheck.RecordMan;
newPropertyRunPumpCheck.StartDate = PropertyRunPumpCheck.StartDate;
newPropertyRunPumpCheck.EndDate = PropertyRunPumpCheck.EndDate;
newPropertyRunPumpCheck.RecordInstructions = PropertyRunPumpCheck.RecordInstructions;
newPropertyRunPumpCheck.ProblemsSolutions = PropertyRunPumpCheck.ProblemsSolutions;
newPropertyRunPumpCheck.AttachUrl = PropertyRunPumpCheck.AttachUrl;
newPropertyRunPumpCheck.Remark = PropertyRunPumpCheck.Remark;
Funs.DB.ProduceProperty_PropertyRunPumpCheck.InsertOnSubmit(newPropertyRunPumpCheck);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改机泵巡检记录管理
/// </summary>
/// <param name="PropertyRunPumpCheck"></param>
public static void UpdatePropertyRunPumpCheck(Model.ProduceProperty_PropertyRunPumpCheck PropertyRunPumpCheck)
{
Model.ProduceProperty_PropertyRunPumpCheck newPropertyRunPumpCheck = Funs.DB.ProduceProperty_PropertyRunPumpCheck.FirstOrDefault(e => e.PropertyRunPumpCheckId == PropertyRunPumpCheck.PropertyRunPumpCheckId);
if (newPropertyRunPumpCheck != null)
{
newPropertyRunPumpCheck.Code = PropertyRunPumpCheck.Code;
newPropertyRunPumpCheck.UnitWorkId = PropertyRunPumpCheck.UnitWorkId;
newPropertyRunPumpCheck.InstallationMan = PropertyRunPumpCheck.InstallationMan;
newPropertyRunPumpCheck.RecordName = PropertyRunPumpCheck.RecordName;
newPropertyRunPumpCheck.RecordCode = PropertyRunPumpCheck.RecordCode;
// newPropertyRunPumpCheck.RecordMan = PropertyRunPumpCheck.RecordMan;
newPropertyRunPumpCheck.StartDate = PropertyRunPumpCheck.StartDate;
newPropertyRunPumpCheck.EndDate = PropertyRunPumpCheck.EndDate;
newPropertyRunPumpCheck.RecordInstructions = PropertyRunPumpCheck.RecordInstructions;
newPropertyRunPumpCheck.ProblemsSolutions = PropertyRunPumpCheck.ProblemsSolutions;
newPropertyRunPumpCheck.AttachUrl = PropertyRunPumpCheck.AttachUrl;
newPropertyRunPumpCheck.Remark = PropertyRunPumpCheck.Remark;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除机泵巡检记录管理
/// </summary>
/// <param name="PropertyRunPumpCheckId"></param>
public static void DeletePropertyRunPumpCheck(string PropertyRunPumpCheckId)
{
Model.ProduceProperty_PropertyRunPumpCheck PropertyRunPumpCheck = Funs.DB.ProduceProperty_PropertyRunPumpCheck.FirstOrDefault(e => e.PropertyRunPumpCheckId == PropertyRunPumpCheckId);
if (PropertyRunPumpCheck != null)
{
if (!string.IsNullOrEmpty(PropertyRunPumpCheck.AttachUrl))
{
BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, PropertyRunPumpCheck.AttachUrl);//删除附件
}
Funs.DB.ProduceProperty_PropertyRunPumpCheck.DeleteOnSubmit(PropertyRunPumpCheck);
Funs.DB.SubmitChanges();
}
}
}
}