164 lines
6.8 KiB
C#
164 lines
6.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Collections;
|
|
|
|
namespace BLL
|
|
{
|
|
public static class HotProessManageService
|
|
{
|
|
|
|
public static Model.SGGLDB db = Funs.DB;
|
|
|
|
/// <summary>
|
|
/// 记录数
|
|
/// </summary>
|
|
private static int count
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取分页列表
|
|
/// </summary>
|
|
/// <param name="projectId"></param>
|
|
/// <param name="installationId"></param>
|
|
/// <param name="cNProfessionalId"></param>
|
|
/// <param name="startDate"></param>
|
|
/// <param name="endDate"></param>
|
|
/// <param name="startRowIndex"></param>
|
|
/// <param name="maximumRows"></param>
|
|
/// <returns></returns>
|
|
public static IEnumerable GetListData(string projectId, string pipelineManageCode,string jointInfoCode, string hotProessReportCode, string hotHardManageCode, int startRowIndex, int maximumRows)
|
|
{
|
|
IQueryable<Model.ProcessControl_HotProessManage> q = from x in db.ProcessControl_HotProessManage
|
|
where x.ProjectId == projectId
|
|
orderby x.HotHardManageCode descending
|
|
select x;
|
|
if (!string.IsNullOrEmpty(projectId))
|
|
{
|
|
q = q.Where(e => e.ProjectId == projectId);
|
|
}
|
|
if (!string.IsNullOrEmpty(jointInfoCode))
|
|
{
|
|
q = q.Where(e => e.JointInfoCode.Contains(jointInfoCode));
|
|
}
|
|
if (!string.IsNullOrEmpty(pipelineManageCode))
|
|
{
|
|
q = q.Where(e => e.PipelineManageCode.Contains(pipelineManageCode));
|
|
}
|
|
if (!string.IsNullOrEmpty(hotProessReportCode))
|
|
{
|
|
q = q.Where(e => e.HotProessReportCode.Contains(hotProessReportCode));
|
|
}
|
|
if (!string.IsNullOrEmpty(hotHardManageCode))
|
|
{
|
|
q = q.Where(e => e.HotHardManageCode.Contains(hotHardManageCode));
|
|
}
|
|
count = q.Count();
|
|
if (count == 0)
|
|
{
|
|
return new object[] { "" };
|
|
}
|
|
return from x in q.Skip(startRowIndex).Take(maximumRows)
|
|
select new
|
|
{
|
|
x.HotProessManageId,
|
|
x.ProjectId,
|
|
x.PipelineManageCode,
|
|
x.JointInfoCode,
|
|
x.STE_ID,
|
|
x.Specification,
|
|
x.HotProessReportCode,
|
|
x.HotHardManageCode,
|
|
x.CompileMan
|
|
};
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取分页列表数
|
|
/// </summary>
|
|
/// <param name="projectId"></param>
|
|
/// <param name="installationId"></param>
|
|
/// <param name="cNProfessionalId"></param>
|
|
/// <param name="startDate"></param>
|
|
/// <param name="endDate"></param>
|
|
/// <returns></returns>
|
|
public static int GetListCount(string projectId, string pipelineManageCode, string jointInfoCode, string hotProessReportCode, string hotHardManageCode)
|
|
{
|
|
return count;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键获取热处理检测
|
|
/// </summary>
|
|
/// <param name="inspectionId"></param>
|
|
/// <returns></returns>
|
|
public static Model.ProcessControl_HotProessManage GetHotProessManageById(string hotProessManageId)
|
|
{
|
|
return Funs.DB.ProcessControl_HotProessManage.FirstOrDefault(e => e.HotProessManageId == hotProessManageId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加热处理检测
|
|
/// </summary>
|
|
/// <param name="inspectionManagement"></param>
|
|
public static void AddHotProessManage(Model.ProcessControl_HotProessManage hotProessManage)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.ProcessControl_HotProessManage newHotProessManage = new Model.ProcessControl_HotProessManage();
|
|
newHotProessManage.HotProessManageId = hotProessManage.HotProessManageId;
|
|
newHotProessManage.ProjectId = hotProessManage.ProjectId;
|
|
newHotProessManage.PipelineManageCode = hotProessManage.PipelineManageCode;
|
|
newHotProessManage.JointInfoCode = hotProessManage.JointInfoCode;
|
|
newHotProessManage.STE_ID = hotProessManage.STE_ID;
|
|
newHotProessManage.Specification = hotProessManage.Specification;
|
|
newHotProessManage.HotProessReportCode = hotProessManage.HotProessReportCode;
|
|
newHotProessManage.HotHardManageCode = hotProessManage.HotHardManageCode;
|
|
newHotProessManage.CompileMan = hotProessManage.CompileMan;
|
|
|
|
db.ProcessControl_HotProessManage.InsertOnSubmit(newHotProessManage);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改热处理检测
|
|
/// </summary>
|
|
/// <param name="inspectionManagement"></param>
|
|
public static void UpdateHotProessManage(Model.ProcessControl_HotProessManage hotProessManage)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.ProcessControl_HotProessManage newHotProessManage = db.ProcessControl_HotProessManage.FirstOrDefault(e => e.HotProessManageId == hotProessManage.HotProessManageId);
|
|
if (newHotProessManage != null)
|
|
{
|
|
newHotProessManage.ProjectId = hotProessManage.ProjectId;
|
|
newHotProessManage.PipelineManageCode = hotProessManage.PipelineManageCode;
|
|
newHotProessManage.JointInfoCode = hotProessManage.JointInfoCode;
|
|
newHotProessManage.STE_ID = hotProessManage.STE_ID;
|
|
newHotProessManage.Specification = hotProessManage.Specification;
|
|
newHotProessManage.HotProessReportCode = hotProessManage.HotProessReportCode;
|
|
newHotProessManage.HotHardManageCode = hotProessManage.HotHardManageCode;
|
|
//newHotProessManage.CompileMan = hotProessManage.CompileMan;
|
|
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除热处理检测
|
|
/// </summary>
|
|
/// <param name="inspectionId"></param>
|
|
public static void DeleteHotProessManage(string hotProessManageId)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.ProcessControl_HotProessManage inspectionManagement = db.ProcessControl_HotProessManage.FirstOrDefault(e => e.HotProessManageId == hotProessManageId);
|
|
if (inspectionManagement != null)
|
|
{
|
|
db.ProcessControl_HotProessManage.DeleteOnSubmit(inspectionManagement);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
} |