initproject
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
using Model;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class Pipeline_PipelineDetectionTypeService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据管线探伤类型明细ID获取管线探伤类型明细
|
||||
/// </summary>
|
||||
/// <param name="pipelineDetectionTypeId">管线探伤类型明细ID</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Pipeline_PipelineDetectionType GetPipelineDetectionTypeByPipelineDetectionTypeId(string pipelineDetectionTypeId)
|
||||
{
|
||||
return Funs.DB.Pipeline_PipelineDetectionType.FirstOrDefault(e => e.PipelineDetectionTypeId == pipelineDetectionTypeId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加管线探伤类型明细信息
|
||||
/// </summary>
|
||||
/// <param name="Components"></param>
|
||||
public static void AddPipelineDetectionType(Model.Pipeline_PipelineDetectionType pipelineDetectionType)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_PipelineDetectionType newPipelineDetectionType = new Pipeline_PipelineDetectionType
|
||||
{
|
||||
PipelineDetectionTypeId = pipelineDetectionType.PipelineDetectionTypeId,
|
||||
PipelineId = pipelineDetectionType.PipelineId,
|
||||
WeldTypeId = pipelineDetectionType.WeldTypeId,
|
||||
DetectionTypeId = pipelineDetectionType.DetectionTypeId,
|
||||
DetectionRateId = pipelineDetectionType.DetectionRateId,
|
||||
QualificationLevel = pipelineDetectionType.QualificationLevel,
|
||||
MinThickness = pipelineDetectionType.MinThickness,
|
||||
MaxThickness = pipelineDetectionType.MaxThickness,
|
||||
MinDia = pipelineDetectionType.MinDia,
|
||||
MaxDia = pipelineDetectionType.MaxDia,
|
||||
};
|
||||
|
||||
db.Pipeline_PipelineDetectionType.InsertOnSubmit(newPipelineDetectionType);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改管线探伤类型明细信息
|
||||
/// </summary>
|
||||
/// <param name="Components"></param>
|
||||
public static void UpdatePipelineDetectionType(Model.Pipeline_PipelineDetectionType pipelineDetectionType)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_PipelineDetectionType newPipelineDetectionType = db.Pipeline_PipelineDetectionType.FirstOrDefault(e => e.PipelineDetectionTypeId == pipelineDetectionType.PipelineDetectionTypeId);
|
||||
if (newPipelineDetectionType != null)
|
||||
{
|
||||
newPipelineDetectionType.WeldTypeId = pipelineDetectionType.WeldTypeId;
|
||||
newPipelineDetectionType.DetectionTypeId = pipelineDetectionType.DetectionTypeId;
|
||||
newPipelineDetectionType.DetectionRateId = pipelineDetectionType.DetectionRateId;
|
||||
newPipelineDetectionType.QualificationLevel = pipelineDetectionType.QualificationLevel;
|
||||
newPipelineDetectionType.MinThickness = pipelineDetectionType.MinThickness;
|
||||
newPipelineDetectionType.MaxThickness = pipelineDetectionType.MaxThickness;
|
||||
newPipelineDetectionType.MinDia = pipelineDetectionType.MinDia;
|
||||
newPipelineDetectionType.MaxDia = pipelineDetectionType.MaxDia;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据管线探伤类型明细Id删除一个管线探伤类型明细信息
|
||||
/// </summary>
|
||||
/// <param name="ComponentsId"></param>
|
||||
public static void DeletePipelineDetectionTypeById(string pipelineDetectionTypeId)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_PipelineDetectionType del = db.Pipeline_PipelineDetectionType.FirstOrDefault(e => e.PipelineDetectionTypeId == pipelineDetectionTypeId);
|
||||
if (del != null)
|
||||
{
|
||||
db.Pipeline_PipelineDetectionType.DeleteOnSubmit(del);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据管线Id删除对应所有管线探伤类型明细信息
|
||||
/// </summary>
|
||||
/// <param name="ComponentsId"></param>
|
||||
public static void DeletePipelineDetectionTypeByPipelineId(string pipelineId)
|
||||
{
|
||||
var del = from x in Funs.DB.Pipeline_PipelineDetectionType where x.PipelineId == pipelineId select x;
|
||||
if (del.Count() > 0)
|
||||
{
|
||||
Funs.DB.Pipeline_PipelineDetectionType.DeleteAllOnSubmit(del);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按管线探伤类型明细项
|
||||
/// </summary>
|
||||
/// <param name="ComponentsType"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.View_Pipeline_PipelineDetectionType> GetPipelineDetectionTypeList(string pipelineId)
|
||||
{
|
||||
var list = (from x in Funs.DB.View_Pipeline_PipelineDetectionType
|
||||
where x.PipelineId == pipelineId
|
||||
select x).ToList();
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,330 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class Pipeline_PipelineService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据管线ID获取管线信息
|
||||
/// </summary>
|
||||
/// <param name="pipelineName"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Pipeline_Pipeline GetPipelineByPipelineId(string pipelineId)
|
||||
{
|
||||
return Funs.DB.Pipeline_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据管线ID获取管线信息
|
||||
/// </summary>
|
||||
/// <param name="pipelineName"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.View_Pipeline_Pipeline GetViewPipelineByPipelineId(string pipelineId)
|
||||
{
|
||||
return Funs.DB.View_Pipeline_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据管线Code获取管线信息
|
||||
/// </summary>
|
||||
/// <param name="isoNo"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExistPipelineCode(string pipelineCode, string workAreaId, string PipelineId)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_Pipeline q = null;
|
||||
if (!string.IsNullOrEmpty(PipelineId))
|
||||
{
|
||||
q = Funs.DB.Pipeline_Pipeline.FirstOrDefault(x => x.PipelineCode == pipelineCode && x.WorkAreaId == workAreaId && x.PipelineId != PipelineId);
|
||||
}
|
||||
else
|
||||
{
|
||||
q = Funs.DB.Pipeline_Pipeline.FirstOrDefault(x => x.PipelineCode == pipelineCode && x.WorkAreaId == workAreaId);
|
||||
}
|
||||
|
||||
if (q != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加作业管线
|
||||
/// </summary>
|
||||
/// <param name="pipeline"></param>
|
||||
public static void AddPipeline(Model.Pipeline_Pipeline pipeline)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_Pipeline newPipeline = new Model.Pipeline_Pipeline();
|
||||
newPipeline.PipelineId = pipeline.PipelineId;
|
||||
newPipeline.ProjectId = pipeline.ProjectId;
|
||||
newPipeline.InstallationId = pipeline.InstallationId;
|
||||
newPipeline.UnitId = pipeline.UnitId;
|
||||
newPipeline.WorkAreaId = pipeline.WorkAreaId;
|
||||
newPipeline.PipelineCode = pipeline.PipelineCode;
|
||||
newPipeline.SingleNumber = pipeline.SingleNumber;
|
||||
newPipeline.PipingClassId = pipeline.PipingClassId;
|
||||
newPipeline.PIPClassId = pipeline.PIPClassId;
|
||||
newPipeline.MainMaterialId = pipeline.MainMaterialId;
|
||||
newPipeline.MediumId = pipeline.MediumId;
|
||||
newPipeline.Specification = pipeline.Specification;
|
||||
newPipeline.SystemNumber = pipeline.SystemNumber;
|
||||
newPipeline.WorkPackageCode = pipeline.WorkPackageCode;
|
||||
newPipeline.SubSystemNumber = pipeline.SubSystemNumber;
|
||||
newPipeline.TestPackageCode = pipeline.TestPackageCode;
|
||||
newPipeline.PipelineLength = pipeline.PipelineLength;
|
||||
newPipeline.Sheet = pipeline.Sheet;
|
||||
newPipeline.PipeSegment = pipeline.PipeSegment;
|
||||
newPipeline.DrawingsNum = pipeline.DrawingsNum;
|
||||
newPipeline.PaintingCategory = pipeline.PaintingCategory;
|
||||
newPipeline.AdiabaticCategory = pipeline.AdiabaticCategory;
|
||||
newPipeline.DesignPressure = pipeline.DesignPressure;
|
||||
newPipeline.DesignTemperature = pipeline.DesignTemperature;
|
||||
newPipeline.TestPressure = pipeline.TestPressure;
|
||||
newPipeline.TestTemperature = pipeline.TestTemperature;
|
||||
newPipeline.ModifierId = pipeline.ModifierId;
|
||||
newPipeline.ModifyDate = pipeline.ModifyDate;
|
||||
newPipeline.CreatorId = pipeline.CreatorId;
|
||||
newPipeline.CreateDate = pipeline.CreateDate;
|
||||
newPipeline.PenetrationRatio = pipeline.PenetrationRatio;
|
||||
newPipeline.PenetrationClass = pipeline.PenetrationClass;
|
||||
newPipeline.IfPickling = pipeline.IfPickling;
|
||||
newPipeline.IfChasing = pipeline.IfChasing;
|
||||
newPipeline.DetectionRateId = pipeline.DetectionRateId;
|
||||
newPipeline.QueClass = pipeline.QueClass;
|
||||
newPipeline.ExecStandard = pipeline.ExecStandard;
|
||||
newPipeline.Remark = pipeline.Remark;
|
||||
|
||||
db.Pipeline_Pipeline.InsertOnSubmit(newPipeline);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改作业管线
|
||||
/// </summary>
|
||||
/// <param name="pipeline"></param>
|
||||
public static void UpdatePipeline(Model.Pipeline_Pipeline pipeline)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_Pipeline newPipeline = db.Pipeline_Pipeline.FirstOrDefault(e => e.PipelineId == pipeline.PipelineId);
|
||||
if (newPipeline != null)
|
||||
{
|
||||
newPipeline.InstallationId = pipeline.InstallationId;
|
||||
newPipeline.UnitId = pipeline.UnitId;
|
||||
newPipeline.WorkAreaId = pipeline.WorkAreaId;
|
||||
newPipeline.PipelineCode = pipeline.PipelineCode;
|
||||
newPipeline.SingleNumber = pipeline.SingleNumber;
|
||||
newPipeline.PipingClassId = pipeline.PipingClassId;
|
||||
newPipeline.PIPClassId = pipeline.PIPClassId;
|
||||
newPipeline.MainMaterialId = pipeline.MainMaterialId;
|
||||
newPipeline.MediumId = pipeline.MediumId;
|
||||
newPipeline.Specification = pipeline.Specification;
|
||||
newPipeline.SystemNumber = pipeline.SystemNumber;
|
||||
newPipeline.WorkPackageCode = pipeline.WorkPackageCode;
|
||||
newPipeline.SubSystemNumber = pipeline.SubSystemNumber;
|
||||
newPipeline.TestPackageCode = pipeline.TestPackageCode;
|
||||
newPipeline.PipelineLength = pipeline.PipelineLength;
|
||||
newPipeline.Sheet = pipeline.Sheet;
|
||||
newPipeline.PipeSegment = pipeline.PipeSegment;
|
||||
newPipeline.DrawingsNum = pipeline.DrawingsNum;
|
||||
newPipeline.PaintingCategory = pipeline.PaintingCategory;
|
||||
newPipeline.AdiabaticCategory = pipeline.AdiabaticCategory;
|
||||
newPipeline.DesignPressure = pipeline.DesignPressure;
|
||||
newPipeline.DesignTemperature = pipeline.DesignTemperature;
|
||||
newPipeline.TestPressure = pipeline.TestPressure;
|
||||
newPipeline.TestTemperature = pipeline.TestTemperature;
|
||||
newPipeline.ModifierId = pipeline.ModifierId;
|
||||
newPipeline.ModifyDate = pipeline.ModifyDate;
|
||||
newPipeline.CreatorId = pipeline.CreatorId;
|
||||
newPipeline.CreateDate = pipeline.CreateDate;
|
||||
newPipeline.PenetrationRatio = pipeline.PenetrationRatio;
|
||||
newPipeline.PenetrationClass = pipeline.PenetrationClass;
|
||||
newPipeline.IfPickling = pipeline.IfPickling;
|
||||
newPipeline.IfChasing = pipeline.IfChasing;
|
||||
newPipeline.DetectionRateId = pipeline.DetectionRateId;
|
||||
newPipeline.QueClass = pipeline.QueClass;
|
||||
newPipeline.ExecStandard = pipeline.ExecStandard;
|
||||
newPipeline.Remark = pipeline.Remark;
|
||||
try
|
||||
{
|
||||
db.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict);
|
||||
}
|
||||
catch (System.Data.Linq.ChangeConflictException ex)
|
||||
{
|
||||
foreach (System.Data.Linq.ObjectChangeConflict occ in db.ChangeConflicts)
|
||||
{
|
||||
// 使用Linq缓存中实体对象的值,覆盖当前数据库中的值
|
||||
occ.Resolve(System.Data.Linq.RefreshMode.KeepCurrentValues);
|
||||
}
|
||||
// 这个地方要注意,Catch方法中,我们前面只是指明了怎样来解决冲突,这个地方还需要再次提交更新,这样的话,值 //才会提交到数据库。
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 修改部分管线信息
|
||||
/// </summary>
|
||||
/// <param name="pipeline"></param>
|
||||
public static void UpdateDepartPipeline(Model.Pipeline_Pipeline pipeline)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_Pipeline newPipeline = db.Pipeline_Pipeline.FirstOrDefault(e => e.PipelineId == pipeline.PipelineId);
|
||||
if (newPipeline != null)
|
||||
{
|
||||
newPipeline.InstallationId = pipeline.InstallationId;
|
||||
newPipeline.UnitId = pipeline.UnitId;
|
||||
newPipeline.WorkAreaId = pipeline.WorkAreaId;
|
||||
newPipeline.PipelineCode = pipeline.PipelineCode;
|
||||
newPipeline.SingleNumber = pipeline.SingleNumber;
|
||||
//newPipeline.PipingClassId = pipeline.PipingClassId;
|
||||
newPipeline.PIPClassId = pipeline.PIPClassId;
|
||||
newPipeline.MainMaterialId = pipeline.MainMaterialId;
|
||||
newPipeline.MediumId = pipeline.MediumId;
|
||||
newPipeline.Specification = pipeline.Specification;
|
||||
newPipeline.SystemNumber = pipeline.SystemNumber;
|
||||
newPipeline.WorkPackageCode = pipeline.WorkPackageCode;
|
||||
newPipeline.SubSystemNumber = pipeline.SubSystemNumber;
|
||||
newPipeline.TestPackageCode = pipeline.TestPackageCode;
|
||||
newPipeline.PipelineLength = pipeline.PipelineLength;
|
||||
newPipeline.Sheet = pipeline.Sheet;
|
||||
newPipeline.PipeSegment = pipeline.PipeSegment;
|
||||
newPipeline.DrawingsNum = pipeline.DrawingsNum;
|
||||
newPipeline.PaintingCategory = pipeline.PaintingCategory;
|
||||
newPipeline.AdiabaticCategory = pipeline.AdiabaticCategory;
|
||||
newPipeline.DesignPressure = pipeline.DesignPressure;
|
||||
newPipeline.DesignTemperature = pipeline.DesignTemperature;
|
||||
newPipeline.TestPressure = pipeline.TestPressure;
|
||||
newPipeline.TestTemperature = pipeline.TestTemperature;
|
||||
newPipeline.ModifierId = pipeline.ModifierId;
|
||||
newPipeline.ModifyDate = pipeline.ModifyDate;
|
||||
newPipeline.CreatorId = pipeline.CreatorId;
|
||||
newPipeline.CreateDate = pipeline.CreateDate;
|
||||
newPipeline.PenetrationRatio = pipeline.PenetrationRatio;
|
||||
newPipeline.PenetrationClass = pipeline.PenetrationClass;
|
||||
newPipeline.IfPickling = pipeline.IfPickling;
|
||||
newPipeline.IfChasing = pipeline.IfChasing;
|
||||
//newPipeline.DetectionRateId = pipeline.DetectionRateId;
|
||||
newPipeline.QueClass = pipeline.QueClass;
|
||||
newPipeline.ExecStandard = pipeline.ExecStandard;
|
||||
newPipeline.Remark = pipeline.Remark;
|
||||
try
|
||||
{
|
||||
db.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict);
|
||||
}
|
||||
catch (System.Data.Linq.ChangeConflictException ex)
|
||||
{
|
||||
foreach (System.Data.Linq.ObjectChangeConflict occ in db.ChangeConflicts)
|
||||
{
|
||||
// 使用Linq缓存中实体对象的值,覆盖当前数据库中的值
|
||||
occ.Resolve(System.Data.Linq.RefreshMode.KeepCurrentValues);
|
||||
}
|
||||
// 这个地方要注意,Catch方法中,我们前面只是指明了怎样来解决冲突,这个地方还需要再次提交更新,这样的话,值 //才会提交到数据库。
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新管线产生的RT随机数
|
||||
/// </summary>
|
||||
/// <param name="pipeline"></param>
|
||||
public static void UpdatePipelineRTRandom(string pipelineId, string randomNum)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_Pipeline newPipeline = db.Pipeline_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId);
|
||||
if (newPipeline != null)
|
||||
{
|
||||
newPipeline.RandomNum = randomNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新管线产生的PT随机数
|
||||
/// </summary>
|
||||
/// <param name="pipeline"></param>
|
||||
public static void UpdatePipelinePTRandom(string pipelineId, string randomNum)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_Pipeline newPipeline = db.Pipeline_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId);
|
||||
if (newPipeline != null)
|
||||
{
|
||||
newPipeline.PTRandomNum = randomNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新管线产生的固定口随机数
|
||||
/// </summary>
|
||||
/// <param name="pipeline"></param>
|
||||
public static void UpdatePipelineGDRandom(string pipelineId, string randomNum)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_Pipeline newPipeline = db.Pipeline_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId);
|
||||
if (newPipeline != null)
|
||||
{
|
||||
newPipeline.GDRandomNum = randomNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据作业管线Id删除一个作业管线信息
|
||||
/// </summary>
|
||||
/// <param name="pipelineId"></param>
|
||||
public static void DeletePipeline(string pipelineId)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_Pipeline pipeline = db.Pipeline_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId);
|
||||
var jot = db.Pipeline_WeldJoint.Where(e => e.PipelineId == pipelineId);
|
||||
if (pipeline != null)
|
||||
{
|
||||
db.Pipeline_WeldJoint.DeleteAllOnSubmit(jot);
|
||||
Pipeline_PipelineDetectionTypeService.DeletePipelineDetectionTypeByPipelineId(pipelineId);
|
||||
db.Pipeline_Pipeline.DeleteOnSubmit(pipeline);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据工区获取管线信息
|
||||
/// </summary>
|
||||
/// <param name="workAreaId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Pipeline_Pipeline> GetPipelineList(string workAreaId)
|
||||
{
|
||||
var list = (from x in Funs.DB.Pipeline_Pipeline
|
||||
where x.WorkAreaId == workAreaId
|
||||
orderby x.PipelineCode
|
||||
select x).ToList();
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据工区获取管线下拉列表
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="workAreaId"></param>
|
||||
public static void InitPipelineDropDownList(FineUIPro.DropDownList dropName,string workAreaId)
|
||||
{
|
||||
dropName.DataValueField = "PipelineId";
|
||||
dropName.DataTextField = "PipelineCode";
|
||||
dropName.DataSource = GetPipelineList(workAreaId);
|
||||
dropName.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,558 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class Pipeline_WeldJointService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据焊口Id获取焊口信息
|
||||
/// </summary>
|
||||
/// <param name="weldJointId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Pipeline_WeldJoint GetWeldJointByWeldJointId(string weldJointId)
|
||||
{
|
||||
return Funs.DB.Pipeline_WeldJoint.FirstOrDefault(e => e.WeldJointId == weldJointId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断焊口号是否已存在
|
||||
/// </summary>
|
||||
/// <param name="isoNo"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExistWeldJointCode(string weldJointCode, string pipelineId, string weldJointId)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
var q = Funs.DB.Pipeline_WeldJoint.FirstOrDefault(x => x.WeldJointCode == weldJointCode && x.PipelineId == pipelineId && x.WeldJointId != weldJointId);
|
||||
if (q != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据焊接日报获取焊口数
|
||||
/// </summary>
|
||||
/// <param name="weldingDailyId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Pipeline_WeldJoint> GetWeldlinesByWeldingDailyId(string weldingDailyId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Pipeline_WeldJoint where x.WeldingDailyId == weldingDailyId orderby x.PipelineId, x.WeldJointCode select x).ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="weldJoint"></param>
|
||||
public static void AddWeldJoint(Model.Pipeline_WeldJoint weldJoint)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_WeldJoint newWeldJoint = new Model.Pipeline_WeldJoint
|
||||
{
|
||||
WeldJointId = SQLHelper.GetNewID(typeof(Model.Pipeline_WeldJoint)),
|
||||
ProjectId = weldJoint.ProjectId,
|
||||
PipelineId = weldJoint.PipelineId,
|
||||
WeldJointCode = weldJoint.WeldJointCode,
|
||||
WeldTypeId = weldJoint.WeldTypeId,
|
||||
Material1Id = weldJoint.Material1Id,
|
||||
Material2Id = weldJoint.Material2Id,
|
||||
Thickness = weldJoint.Thickness,
|
||||
Dia = weldJoint.Dia,
|
||||
Size = weldJoint.Size,
|
||||
JointAttribute = weldJoint.JointAttribute,
|
||||
JointArea = weldJoint.JointArea,
|
||||
WeldingMethodId = weldJoint.WeldingMethodId,
|
||||
IsHotProess = weldJoint.IsHotProess,
|
||||
WeldingLocationId = weldJoint.WeldingLocationId,
|
||||
WeldMatId = weldJoint.WeldMatId,
|
||||
WeldSilkId = weldJoint.WeldSilkId,
|
||||
GrooveTypeId = weldJoint.GrooveTypeId,
|
||||
PipeSegment = weldJoint.PipeSegment,
|
||||
PipeAssembly1Id = weldJoint.PipeAssembly1Id,
|
||||
PipeAssembly2Id = weldJoint.PipeAssembly2Id,
|
||||
PipeAssemblyCount = weldJoint.PipeAssemblyCount,
|
||||
HeartNo1 = weldJoint.HeartNo1,
|
||||
HeartNo2 = weldJoint.HeartNo2,
|
||||
LastTemp = weldJoint.LastTemp,
|
||||
CellTemp = weldJoint.CellTemp,
|
||||
PrepareTemp = weldJoint.PrepareTemp,
|
||||
Electricity = weldJoint.Electricity,
|
||||
Voltage = weldJoint.Voltage,
|
||||
TestPackageNo = weldJoint.TestPackageNo,
|
||||
WeldingDailyCode = weldJoint.WeldingDailyCode,
|
||||
BackingWelderId = weldJoint.BackingWelderId,
|
||||
CoverWelderId = weldJoint.CoverWelderId,
|
||||
WeldingDailyId = weldJoint.WeldingDailyId,
|
||||
PipingClassId = weldJoint.PipingClassId,
|
||||
Specification = weldJoint.Specification,
|
||||
DoneDin = weldJoint.DoneDin,
|
||||
SystemNumber = weldJoint.SystemNumber,
|
||||
Remark = weldJoint.Remark,
|
||||
IsGoldJoint = weldJoint.IsGoldJoint,
|
||||
WPQId = weldJoint.WPQId,
|
||||
DetectionType = weldJoint.DetectionType,
|
||||
PageNum = weldJoint.PageNum,
|
||||
ANSISCH = weldJoint.ANSISCH
|
||||
|
||||
};
|
||||
|
||||
db.Pipeline_WeldJoint.InsertOnSubmit(newWeldJoint);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="weldJoint"></param>
|
||||
public static void UpdateWeldJoint(Model.Pipeline_WeldJoint weldJoint)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_WeldJoint newWeldJoint = db.Pipeline_WeldJoint.FirstOrDefault(e => e.WeldJointId == weldJoint.WeldJointId);
|
||||
if (newWeldJoint != null)
|
||||
{
|
||||
newWeldJoint.WeldJointCode = weldJoint.WeldJointCode;
|
||||
newWeldJoint.WeldTypeId = weldJoint.WeldTypeId;
|
||||
newWeldJoint.Material1Id = weldJoint.Material1Id;
|
||||
newWeldJoint.Material2Id = weldJoint.Material2Id;
|
||||
newWeldJoint.Thickness = weldJoint.Thickness;
|
||||
newWeldJoint.Dia = weldJoint.Dia;
|
||||
newWeldJoint.Size = weldJoint.Size;
|
||||
newWeldJoint.JointAttribute = weldJoint.JointAttribute;
|
||||
newWeldJoint.JointArea = weldJoint.JointArea;
|
||||
newWeldJoint.WeldingMethodId = weldJoint.WeldingMethodId;
|
||||
newWeldJoint.IsHotProess = weldJoint.IsHotProess;
|
||||
newWeldJoint.WeldingLocationId = weldJoint.WeldingLocationId;
|
||||
newWeldJoint.WeldMatId = weldJoint.WeldMatId;
|
||||
newWeldJoint.WeldSilkId = weldJoint.WeldSilkId;
|
||||
newWeldJoint.GrooveTypeId = weldJoint.GrooveTypeId;
|
||||
newWeldJoint.PipeSegment = weldJoint.PipeSegment;
|
||||
newWeldJoint.PipeAssembly1Id = weldJoint.PipeAssembly1Id;
|
||||
newWeldJoint.PipeAssembly2Id = weldJoint.PipeAssembly2Id;
|
||||
newWeldJoint.PipeAssemblyCount = weldJoint.PipeAssemblyCount;
|
||||
newWeldJoint.HeartNo1 = weldJoint.HeartNo1;
|
||||
newWeldJoint.HeartNo2 = weldJoint.HeartNo2;
|
||||
newWeldJoint.LastTemp = weldJoint.LastTemp;
|
||||
newWeldJoint.CellTemp = weldJoint.CellTemp;
|
||||
newWeldJoint.PrepareTemp = weldJoint.PrepareTemp;
|
||||
newWeldJoint.Electricity = weldJoint.Electricity;
|
||||
newWeldJoint.Voltage = weldJoint.Voltage;
|
||||
newWeldJoint.TestPackageNo = weldJoint.TestPackageNo;
|
||||
newWeldJoint.WeldingDailyCode = weldJoint.WeldingDailyCode;
|
||||
newWeldJoint.BackingWelderId = weldJoint.BackingWelderId;
|
||||
newWeldJoint.CoverWelderId = weldJoint.CoverWelderId;
|
||||
newWeldJoint.WeldingDate = weldJoint.WeldingDate;
|
||||
newWeldJoint.WeldingDailyId = weldJoint.WeldingDailyId;
|
||||
newWeldJoint.PipingClassId = weldJoint.PipingClassId;
|
||||
newWeldJoint.Specification = weldJoint.Specification;
|
||||
newWeldJoint.DoneDin = weldJoint.DoneDin;
|
||||
newWeldJoint.SystemNumber = weldJoint.SystemNumber;
|
||||
newWeldJoint.Remark = weldJoint.Remark;
|
||||
newWeldJoint.IsCancel = weldJoint.IsCancel;
|
||||
newWeldJoint.IsGoldJoint = weldJoint.IsGoldJoint;
|
||||
newWeldJoint.WPQId = weldJoint.WPQId;
|
||||
newWeldJoint.DetectionType = weldJoint.DetectionType;
|
||||
newWeldJoint.PageNum = weldJoint.PageNum;
|
||||
newWeldJoint.ANSISCH = weldJoint.ANSISCH;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改部分内容
|
||||
/// </summary>
|
||||
/// <param name="weldJoint"></param>
|
||||
public static void UpdateDepartWeldJoint(Model.Pipeline_WeldJoint weldJoint)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_WeldJoint newWeldJoint = db.Pipeline_WeldJoint.FirstOrDefault(e => e.WeldJointId == weldJoint.WeldJointId);
|
||||
if (newWeldJoint != null)
|
||||
{
|
||||
newWeldJoint.WeldJointCode = weldJoint.WeldJointCode;
|
||||
newWeldJoint.WeldTypeId = weldJoint.WeldTypeId;
|
||||
newWeldJoint.Material1Id = weldJoint.Material1Id;
|
||||
newWeldJoint.Material2Id = weldJoint.Material2Id;
|
||||
if (weldJoint.Thickness != null)
|
||||
{
|
||||
newWeldJoint.Thickness = weldJoint.Thickness;
|
||||
}
|
||||
newWeldJoint.Dia = weldJoint.Dia;
|
||||
newWeldJoint.Size = weldJoint.Size;
|
||||
newWeldJoint.JointAttribute = weldJoint.JointAttribute;
|
||||
if (!string.IsNullOrEmpty(weldJoint.JointArea))
|
||||
{
|
||||
newWeldJoint.JointArea = weldJoint.JointArea;
|
||||
}
|
||||
|
||||
newWeldJoint.WeldingMethodId = weldJoint.WeldingMethodId;
|
||||
if (weldJoint.IsHotProess != null)
|
||||
{
|
||||
newWeldJoint.IsHotProess = weldJoint.IsHotProess;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.WeldingLocationId))
|
||||
{
|
||||
newWeldJoint.WeldingLocationId = weldJoint.WeldingLocationId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.WeldMatId))
|
||||
{
|
||||
newWeldJoint.WeldMatId = weldJoint.WeldMatId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.WeldSilkId))
|
||||
{
|
||||
newWeldJoint.WeldSilkId = weldJoint.WeldSilkId;
|
||||
}
|
||||
|
||||
newWeldJoint.GrooveTypeId = weldJoint.GrooveTypeId;
|
||||
if (!string.IsNullOrEmpty(weldJoint.PipeSegment))
|
||||
{
|
||||
newWeldJoint.PipeSegment = weldJoint.PipeSegment;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.PipeAssembly1Id))
|
||||
{
|
||||
newWeldJoint.PipeAssembly1Id = weldJoint.PipeAssembly1Id;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.PipeAssembly2Id))
|
||||
{
|
||||
newWeldJoint.PipeAssembly2Id = weldJoint.PipeAssembly2Id;
|
||||
}
|
||||
if (weldJoint.PipeAssemblyCount != null)
|
||||
{
|
||||
newWeldJoint.PipeAssemblyCount = weldJoint.PipeAssemblyCount;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.HeartNo1))
|
||||
{
|
||||
newWeldJoint.HeartNo1 = weldJoint.HeartNo1;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.HeartNo2))
|
||||
{
|
||||
newWeldJoint.HeartNo2 = weldJoint.HeartNo2;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.LastTemp))
|
||||
{
|
||||
newWeldJoint.LastTemp = weldJoint.LastTemp;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.CellTemp))
|
||||
{
|
||||
newWeldJoint.CellTemp = weldJoint.CellTemp;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.PrepareTemp))
|
||||
{
|
||||
newWeldJoint.PrepareTemp = weldJoint.PrepareTemp;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.Electricity))
|
||||
{
|
||||
newWeldJoint.Electricity = weldJoint.Electricity;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.Voltage))
|
||||
{
|
||||
newWeldJoint.Voltage = weldJoint.Voltage;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.TestPackageNo))
|
||||
{
|
||||
newWeldJoint.TestPackageNo = weldJoint.TestPackageNo;
|
||||
}
|
||||
|
||||
//newWeldJoint.WeldingDailyCode = weldJoint.WeldingDailyCode;
|
||||
//newWeldJoint.BackingWelderId = weldJoint.BackingWelderId;
|
||||
//newWeldJoint.CoverWelderId = weldJoint.CoverWelderId;
|
||||
//newWeldJoint.WeldingDate = weldJoint.WeldingDate;
|
||||
//newWeldJoint.WeldingDailyId = weldJoint.WeldingDailyId;
|
||||
newWeldJoint.PipingClassId = weldJoint.PipingClassId;
|
||||
newWeldJoint.Specification = weldJoint.Specification;
|
||||
newWeldJoint.DoneDin = weldJoint.DoneDin;
|
||||
if (!string.IsNullOrEmpty(weldJoint.SystemNumber))
|
||||
{
|
||||
newWeldJoint.SystemNumber = weldJoint.SystemNumber;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.Remark))
|
||||
{
|
||||
newWeldJoint.Remark = weldJoint.Remark;
|
||||
}
|
||||
|
||||
//newWeldJoint.IsCancel = weldJoint.IsCancel;
|
||||
newWeldJoint.IsGoldJoint = weldJoint.IsGoldJoint;
|
||||
newWeldJoint.WPQId = weldJoint.WPQId;
|
||||
newWeldJoint.DetectionType = weldJoint.DetectionType;
|
||||
if (!string.IsNullOrEmpty(weldJoint.PageNum))
|
||||
{
|
||||
newWeldJoint.PageNum = weldJoint.PageNum;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.ANSISCH))
|
||||
{
|
||||
newWeldJoint.ANSISCH = weldJoint.ANSISCH;
|
||||
}
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改部分内容TCC11,暂时
|
||||
/// </summary>
|
||||
/// <param name="weldJoint"></param>
|
||||
public static void UpdateDepartWeldJointToTCC11(Model.Pipeline_WeldJoint weldJoint)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_WeldJoint newWeldJoint = db.Pipeline_WeldJoint.FirstOrDefault(e => e.WeldJointId == weldJoint.WeldJointId);
|
||||
if (newWeldJoint != null)
|
||||
{
|
||||
newWeldJoint.WeldJointCode = weldJoint.WeldJointCode;
|
||||
//newWeldJoint.WeldTypeId = weldJoint.WeldTypeId;
|
||||
//newWeldJoint.Material1Id = weldJoint.Material1Id;
|
||||
//newWeldJoint.Material2Id = weldJoint.Material2Id;
|
||||
if (weldJoint.Thickness != null)
|
||||
{
|
||||
newWeldJoint.Thickness = weldJoint.Thickness;
|
||||
}
|
||||
if (weldJoint.Dia != null)
|
||||
{
|
||||
newWeldJoint.Dia = weldJoint.Dia;
|
||||
}
|
||||
if (weldJoint.Size != null)
|
||||
{
|
||||
newWeldJoint.Size = weldJoint.Size;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.JointAttribute))
|
||||
{
|
||||
newWeldJoint.JointAttribute = weldJoint.JointAttribute;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(weldJoint.JointArea))
|
||||
{
|
||||
newWeldJoint.JointArea = weldJoint.JointArea;
|
||||
}
|
||||
|
||||
//newWeldJoint.WeldingMethodId = weldJoint.WeldingMethodId;
|
||||
if (weldJoint.IsHotProess != null)
|
||||
{
|
||||
newWeldJoint.IsHotProess = weldJoint.IsHotProess;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.WeldingLocationId))
|
||||
{
|
||||
newWeldJoint.WeldingLocationId = weldJoint.WeldingLocationId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.WeldMatId))
|
||||
{
|
||||
newWeldJoint.WeldMatId = weldJoint.WeldMatId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.WeldSilkId))
|
||||
{
|
||||
newWeldJoint.WeldSilkId = weldJoint.WeldSilkId;
|
||||
}
|
||||
//newWeldJoint.GrooveTypeId = weldJoint.GrooveTypeId;
|
||||
if (!string.IsNullOrEmpty(weldJoint.PipeSegment))
|
||||
{
|
||||
newWeldJoint.PipeSegment = weldJoint.PipeSegment;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.PipeAssembly1Id))
|
||||
{
|
||||
newWeldJoint.PipeAssembly1Id = weldJoint.PipeAssembly1Id;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.PipeAssembly2Id))
|
||||
{
|
||||
newWeldJoint.PipeAssembly2Id = weldJoint.PipeAssembly2Id;
|
||||
}
|
||||
if (weldJoint.PipeAssemblyCount != null)
|
||||
{
|
||||
newWeldJoint.PipeAssemblyCount = weldJoint.PipeAssemblyCount;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.HeartNo1))
|
||||
{
|
||||
newWeldJoint.HeartNo1 = weldJoint.HeartNo1;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.HeartNo2))
|
||||
{
|
||||
newWeldJoint.HeartNo2 = weldJoint.HeartNo2;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.LastTemp))
|
||||
{
|
||||
newWeldJoint.LastTemp = weldJoint.LastTemp;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.CellTemp))
|
||||
{
|
||||
newWeldJoint.CellTemp = weldJoint.CellTemp;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.PrepareTemp))
|
||||
{
|
||||
newWeldJoint.PrepareTemp = weldJoint.PrepareTemp;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.Electricity))
|
||||
{
|
||||
newWeldJoint.Electricity = weldJoint.Electricity;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.Voltage))
|
||||
{
|
||||
newWeldJoint.Voltage = weldJoint.Voltage;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.TestPackageNo))
|
||||
{
|
||||
newWeldJoint.TestPackageNo = weldJoint.TestPackageNo;
|
||||
}
|
||||
//newWeldJoint.WeldingDailyCode = weldJoint.WeldingDailyCode;
|
||||
//newWeldJoint.BackingWelderId = weldJoint.BackingWelderId;
|
||||
//newWeldJoint.CoverWelderId = weldJoint.CoverWelderId;
|
||||
//newWeldJoint.WeldingDate = weldJoint.WeldingDate;
|
||||
//newWeldJoint.WeldingDailyId = weldJoint.WeldingDailyId;
|
||||
//newWeldJoint.PipingClassId = weldJoint.PipingClassId;
|
||||
if (!string.IsNullOrEmpty(weldJoint.Specification))
|
||||
{
|
||||
newWeldJoint.Specification = weldJoint.Specification;
|
||||
}
|
||||
//newWeldJoint.DoneDin = weldJoint.DoneDin;
|
||||
if (!string.IsNullOrEmpty(weldJoint.SystemNumber))
|
||||
{
|
||||
newWeldJoint.SystemNumber = weldJoint.SystemNumber;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.Remark))
|
||||
{
|
||||
newWeldJoint.Remark = weldJoint.Remark;
|
||||
}
|
||||
//newWeldJoint.IsCancel = weldJoint.IsCancel;
|
||||
if (weldJoint.IsGoldJoint != null)
|
||||
{
|
||||
newWeldJoint.IsGoldJoint = weldJoint.IsGoldJoint;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.WPQId))
|
||||
{
|
||||
newWeldJoint.WPQId = weldJoint.WPQId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.DetectionType))
|
||||
{
|
||||
newWeldJoint.DetectionType = weldJoint.DetectionType;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.PageNum))
|
||||
{
|
||||
newWeldJoint.PageNum = weldJoint.PageNum;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJoint.ANSISCH))
|
||||
{
|
||||
newWeldJoint.ANSISCH = weldJoint.ANSISCH;
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除焊口信息
|
||||
/// </summary>
|
||||
/// <param name="weldJointId"></param>
|
||||
public static void DeleteWeldJointById(string weldJointId)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_WeldJoint weldline = db.Pipeline_WeldJoint.FirstOrDefault(e => e.WeldJointId == weldJointId);
|
||||
if (weldline != null)
|
||||
{
|
||||
db.Pipeline_WeldJoint.DeleteOnSubmit(weldline);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新焊口号 固定焊口号后 +G
|
||||
/// </summary>
|
||||
/// <param name="jotId">焊口id</param>
|
||||
/// <param name="jointAttribute">焊口属性</param>
|
||||
/// <param name="operateState">日报操作(增加、删除)</param>
|
||||
public static void UpdateWeldJointAddG(string weldJointId, string jointAttribute, string operateState)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
if (operateState == Const.BtnDelete || jointAttribute != "固定")
|
||||
{
|
||||
Model.Pipeline_WeldJoint deleteWeldJoint = db.Pipeline_WeldJoint.FirstOrDefault(e => e.WeldJointId == weldJointId);
|
||||
if (deleteWeldJoint.WeldJointCode.Last() == 'G')
|
||||
{
|
||||
deleteWeldJoint.WeldJointCode = deleteWeldJoint.WeldJointCode.Substring(0, deleteWeldJoint.WeldJointCode.Length - 1);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Pipeline_WeldJoint addJointInfo = db.Pipeline_WeldJoint.FirstOrDefault(e => e.WeldJointId == weldJointId);
|
||||
if (addJointInfo.WeldJointCode.Last() != 'G')
|
||||
{
|
||||
addJointInfo.WeldJointCode += "G";
|
||||
}
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取焊口信息视图
|
||||
/// </summary>
|
||||
/// <param name="weldJointId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.View_Pipeline_WeldJoint GetViewWeldJointById(string weldJointId)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
return db.View_Pipeline_WeldJoint.FirstOrDefault(e => e.WeldJointId == weldJointId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据焊接日报获取焊口数
|
||||
/// </summary>
|
||||
/// <param name="weldingDailyId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Pipeline_WeldJoint> GetWeldJointsByWeldingDailyId(string weldingDailyId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Pipeline_WeldJoint where x.WeldingDailyId == weldingDailyId orderby x.PipelineId, x.WeldJointCode select x).ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据焊接日报获取焊口数
|
||||
/// </summary>
|
||||
/// <param name="dreportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.View_Pipeline_WeldJoint> GetViewWeldJointsByWeldingDailyId(string weldingDailyId)
|
||||
{
|
||||
var q = (from x in Funs.DB.View_Pipeline_WeldJoint where x.WeldingDailyId == weldingDailyId orderby x.PipelineCode, x.WeldJointCode select x).ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前焊工工作量是否超过60寸的焊接人员
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <param name="unitId">单位id</param>
|
||||
/// <param name="jot_Id">焊口ID</param>
|
||||
/// <param name="jotDate">焊接日期</param>
|
||||
/// <returns></returns>
|
||||
public static bool GetWelderLimitDN(string projectId, string welderId, DateTime weldingDate)
|
||||
{
|
||||
var jots = from x in Funs.DB.Pipeline_WeldJoint
|
||||
join y in Funs.DB.Pipeline_WeldingDaily on x.WeldingDailyId equals y.WeldingDailyId
|
||||
where x.ProjectId == projectId && y.WeldingDate == weldingDate && (welderId == x.CoverWelderId || welderId == x.BackingWelderId)
|
||||
select x;
|
||||
decimal? count = jots.Sum(x => x.Size);
|
||||
if (count >= 60)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据管线ID获取焊口信息
|
||||
/// </summary>
|
||||
/// <param name="pipelineId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.View_Pipeline_WeldJoint> GetViewWeldJointsByPipelineId(string pipelineId)
|
||||
{
|
||||
var q = (from x in Funs.DB.View_Pipeline_WeldJoint where x.PipelineId == pipelineId orderby x.WeldJointCode select x).ToList();
|
||||
return q;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,375 @@
|
||||
using Model;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public partial class Pipeline_WeldingDailyService
|
||||
{
|
||||
/// <summary>
|
||||
///获取焊接日报信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Model.Pipeline_WeldingDaily GetPipeline_WeldingDailyByWeldingDailyId(string WeldingDailyId)
|
||||
{
|
||||
return Funs.DB.Pipeline_WeldingDaily.FirstOrDefault(e => e.WeldingDailyId == WeldingDailyId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据焊接日报主键获取焊接日报信息
|
||||
/// </summary>
|
||||
/// <param name="weldReportNo">焊接日报编号</param>
|
||||
/// <returns>焊接日报信息</returns>
|
||||
public static bool IsExistWeldingDailyCode(string weldingDailyCode, string weldingDailyId, string projectId)
|
||||
{
|
||||
var q = Funs.DB.Pipeline_WeldingDaily.FirstOrDefault(x => x.WeldingDailyCode == weldingDailyCode && x.ProjectId == projectId && x.WeldingDailyId != weldingDailyId);
|
||||
if (q != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据焊接日报Id获取焊接日报明细信息
|
||||
/// </summary>
|
||||
/// <param name="ManagerTotalId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.SpWeldingDailyItem> GetWeldingDailyItem(string weldingDailyId)
|
||||
{
|
||||
List<Model.SpWeldingDailyItem> returnViewMatch = new List<Model.SpWeldingDailyItem>();
|
||||
var weldlineLists = from x in Funs.DB.View_Pipeline_WeldJoint
|
||||
where x.WeldingDailyId == weldingDailyId
|
||||
select x;
|
||||
if (weldlineLists.Count() > 0)
|
||||
{
|
||||
foreach (var item in weldlineLists)
|
||||
{
|
||||
Model.SpWeldingDailyItem newWeldReportItem = new Model.SpWeldingDailyItem();
|
||||
newWeldReportItem.WeldJointId = item.WeldJointId;
|
||||
newWeldReportItem.WeldJointCode = item.WeldJointCode;
|
||||
newWeldReportItem.ConvertWeldJoint = item.ConvertWeldJoint;
|
||||
newWeldReportItem.PipelineCode = item.PipelineCode;
|
||||
newWeldReportItem.CoverWelderCode = item.CoverWelderCode;
|
||||
newWeldReportItem.CoverWelderId = item.CoverWelderId;
|
||||
newWeldReportItem.BackingWelderCode = item.BackingWelderCode;
|
||||
newWeldReportItem.BackingWelderId = item.BackingWelderId;
|
||||
newWeldReportItem.WeldTypeId = item.WeldTypeCode;
|
||||
newWeldReportItem.JointArea = item.JointArea;
|
||||
newWeldReportItem.WeldingLocationId = item.WeldingLocationId;
|
||||
newWeldReportItem.WeldingLocationCode = item.WeldingLocationCode;
|
||||
newWeldReportItem.JointAttribute = item.JointAttribute;
|
||||
newWeldReportItem.DoneDin = item.DoneDin;
|
||||
newWeldReportItem.Dia = item.Dia;
|
||||
newWeldReportItem.Thickness = item.Thickness;
|
||||
newWeldReportItem.Specification = item.Specification;
|
||||
//newWeldReportItem.WeldingMethodCode = item.WeldingMethodCode;
|
||||
newWeldReportItem.HeartNo1 = item.HeartNo1;
|
||||
newWeldReportItem.HeartNo2 = item.HeartNo2;
|
||||
newWeldReportItem.Components1Code = item.ComponentsCode1;
|
||||
newWeldReportItem.Components2Code = item.ComponentsCode2;
|
||||
newWeldReportItem.Material1Code = item.Material1Code;
|
||||
newWeldReportItem.Material2Code = item.Material2Code;
|
||||
//if (!string.IsNullOrEmpty(item.WeldSilkId))
|
||||
//{
|
||||
// newWeldReportItem.WeldSilkCode = GetWeldSilkCode(item.WeldSilkId);
|
||||
//}
|
||||
//newWeldReportItem.WeldSilkCode = item.WeldSilkCode;
|
||||
//newWeldReportItem.WeldMatCode = item.WeldMatCode;
|
||||
newWeldReportItem.PipeSegment = item.PipeSegment;
|
||||
newWeldReportItem.WPQCode = item.WPQCode;
|
||||
newWeldReportItem.ANSISCH = item.ANSISCH;
|
||||
returnViewMatch.Add(newWeldReportItem);
|
||||
}
|
||||
}
|
||||
|
||||
return returnViewMatch;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找后返回集合增加到列表集团中
|
||||
/// </summary>
|
||||
/// <param name="hdItemsString"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.SpWeldingDailyItem> GetWeldReportAddItem(string hdItemsString)
|
||||
{
|
||||
List<Model.SpWeldingDailyItem> returnViewMatch = new List<Model.SpWeldingDailyItem>(); //= getWeldReportItem;
|
||||
if (!string.IsNullOrEmpty(hdItemsString))
|
||||
{
|
||||
List<string> list = Funs.GetStrListByStr(hdItemsString, '#');
|
||||
if (list.Count() == 2)
|
||||
{
|
||||
string CoverWelderCode = string.Empty; //盖面焊工号
|
||||
string BackingWelderCode = string.Empty; //打底焊工号
|
||||
|
||||
string welderLists = list[0];
|
||||
List<string> welderIds = Funs.GetStrListByStr(welderLists, '|');
|
||||
if (welderIds.Count() == 2)
|
||||
{
|
||||
var welderCell = BLL.WelderService.GetWelderById(welderIds[0]);
|
||||
if (welderCell != null)
|
||||
{
|
||||
CoverWelderCode = welderCell.WelderCode;
|
||||
}
|
||||
var welderFloor = BLL.WelderService.GetWelderById(welderIds[1]);
|
||||
if (welderFloor != null)
|
||||
{
|
||||
BackingWelderCode = welderFloor.WelderCode;
|
||||
}
|
||||
}
|
||||
|
||||
string weldlineIdLists = list[1];
|
||||
List<string> weldlineIds = Funs.GetStrListByStr(weldlineIdLists, '|');
|
||||
foreach (var weldlineItem in weldlineIds)
|
||||
{
|
||||
//if (returnViewMatch.FirstOrDefault(x => x.JOT_ID == jotItem) == null)
|
||||
//{
|
||||
var weldline = BLL.Pipeline_WeldJointService.GetViewWeldJointById(weldlineItem);
|
||||
if (weldline != null)
|
||||
{
|
||||
Model.SpWeldingDailyItem newWeldReportItem = new Model.SpWeldingDailyItem();
|
||||
newWeldReportItem.WeldJointId = weldline.WeldJointId;
|
||||
newWeldReportItem.WeldJointCode = weldline.WeldJointCode;
|
||||
newWeldReportItem.PipelineCode = weldline.PipelineCode;
|
||||
newWeldReportItem.CoverWelderCode = CoverWelderCode;
|
||||
newWeldReportItem.CoverWelderId = welderIds[0];
|
||||
newWeldReportItem.BackingWelderCode = BackingWelderCode;
|
||||
newWeldReportItem.BackingWelderId = welderIds[1];
|
||||
newWeldReportItem.WeldTypeId = weldline.WeldTypeCode;
|
||||
newWeldReportItem.JointArea = weldline.JointArea;
|
||||
newWeldReportItem.WeldingLocationId = weldline.WeldingLocationId;
|
||||
newWeldReportItem.WeldingLocationCode = weldline.WeldingLocationCode;
|
||||
newWeldReportItem.JointAttribute = weldline.JointAttribute;
|
||||
|
||||
newWeldReportItem.HeartNo1 = weldline.HeartNo1;
|
||||
newWeldReportItem.HeartNo2 = weldline.HeartNo2;
|
||||
newWeldReportItem.Components1Code = weldline.ComponentsCode1;
|
||||
newWeldReportItem.Components2Code = weldline.ComponentsCode2;
|
||||
newWeldReportItem.Material1Code = weldline.Material1Code;
|
||||
newWeldReportItem.Material2Code = weldline.Material2Code;
|
||||
//if (!string.IsNullOrEmpty(weldline.WeldSilkId))
|
||||
//{
|
||||
// newWeldReportItem.WeldSilkCode = GetWeldSilkCode(weldline.WeldSilkId);
|
||||
//}
|
||||
|
||||
//newWeldReportItem.WeldMatCode = weldline.WeldMatCode;
|
||||
|
||||
if (weldline.DoneDin == null)
|
||||
{
|
||||
newWeldReportItem.DoneDin = weldline.Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
newWeldReportItem.DoneDin = weldline.DoneDin;
|
||||
}
|
||||
newWeldReportItem.Dia = weldline.Dia;
|
||||
newWeldReportItem.Thickness = weldline.Thickness;
|
||||
newWeldReportItem.Specification = weldline.Specification;
|
||||
//newWeldReportItem.WeldingMethodCode = weldline.WeldingMethodCode;
|
||||
newWeldReportItem.PipeSegment = weldline.PipeSegment;
|
||||
newWeldReportItem.WPQCode = weldline.WPQCode;
|
||||
newWeldReportItem.ANSISCH = weldline.ANSISCH;
|
||||
|
||||
// 如存在日报,默认还是原日报焊工
|
||||
if (!string.IsNullOrEmpty(weldline.WeldingDailyId))
|
||||
{
|
||||
newWeldReportItem.CoverWelderId = weldline.CoverWelderId;
|
||||
newWeldReportItem.BackingWelderId = weldline.BackingWelderId;
|
||||
var welderCover = BLL.WelderService.GetWelderById(weldline.CoverWelderId);
|
||||
if (welderCover != null)
|
||||
{
|
||||
newWeldReportItem.CoverWelderCode = welderCover.WelderCode;
|
||||
}
|
||||
var welderBacking = BLL.WelderService.GetWelderById(weldline.BackingWelderId);
|
||||
if (welderBacking != null)
|
||||
{
|
||||
newWeldReportItem.BackingWelderCode = welderBacking.WelderCode;
|
||||
}
|
||||
}
|
||||
returnViewMatch.Add(newWeldReportItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnViewMatch;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取未焊接焊口信息,不用
|
||||
/// </summary>
|
||||
/// <param name="ManagerTotalId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.SpWeldingDailyItem> GetWeldReportItemFind(string projectId, string weldingDailyId, string pipelineId)
|
||||
{
|
||||
List<Model.SpWeldingDailyItem> returnViewMatch = new List<Model.SpWeldingDailyItem>();
|
||||
// 组批条件的字段不能为空
|
||||
//var jotLists = from x in Funs.DB.HJGL_PW_JointInfo
|
||||
// join y in Funs.DB.HJGL_PW_IsoInfo on x.ISO_ID equals y.ISO_ID
|
||||
// where x.InstallationId != null && x.JOTY_ID != null && x.NDTR_ID != null && x.IsSpecial != null
|
||||
// && y.ISC_ID != null && y.SER_ID != null && y.STE_ID != null && y.ISO_Executive != null
|
||||
// && x.ProjectId == projectId && x.ISO_ID == pipelineId
|
||||
// && (x.DReportID == null || x.DReportID == weldingDailyId)
|
||||
// select x;
|
||||
|
||||
// 预提交焊口
|
||||
var preJotId = (from x in Funs.DB.Pipeline_PreWeldingDaily
|
||||
join y in Funs.DB.Pipeline_WeldJoint on x.WeldJointId equals y.WeldJointId
|
||||
where x.ProjectId == projectId && y.PipelineId == pipelineId
|
||||
select x.WeldJointId).Distinct();
|
||||
|
||||
|
||||
var weldlineLists = from x in Funs.DB.Pipeline_WeldJoint
|
||||
join y in Funs.DB.Base_WeldingMethod on x.WeldingMethodId equals y.WeldingMethodId
|
||||
where x.PipelineId == pipelineId &&
|
||||
(x.WeldingDailyId == null || x.WeldingDailyId == weldingDailyId)
|
||||
&& (x.IsCancel == null || x.IsCancel == false)
|
||||
select new
|
||||
{
|
||||
x.WeldJointId,
|
||||
x.WeldJointCode,
|
||||
x.Dia,
|
||||
x.Thickness,
|
||||
y.WeldingMethodCode
|
||||
};
|
||||
if (weldlineLists.Count() > 0)
|
||||
{
|
||||
foreach (var item in weldlineLists)
|
||||
{
|
||||
if (!preJotId.Contains(item.WeldJointId))
|
||||
{
|
||||
Model.SpWeldingDailyItem newWeldReportItem = new Model.SpWeldingDailyItem();
|
||||
newWeldReportItem.WeldJointId = item.WeldJointId;
|
||||
newWeldReportItem.WeldJointCode = item.WeldJointCode;
|
||||
newWeldReportItem.Dia = item.Dia;
|
||||
newWeldReportItem.Thickness = item.Thickness;
|
||||
newWeldReportItem.WeldingMethodCode = item.WeldingMethodCode;
|
||||
returnViewMatch.Add(newWeldReportItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnViewMatch;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加焊接日报信息
|
||||
/// </summary>
|
||||
/// <param name="WeldingDaily"></param>
|
||||
public static void AddPipeline_WeldingDaily(Model.Pipeline_WeldingDaily WeldingDaily)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_WeldingDaily newWeldingDaily = new Pipeline_WeldingDaily
|
||||
{
|
||||
WeldingDailyId = WeldingDaily.WeldingDailyId,
|
||||
WeldingDailyCode = WeldingDaily.WeldingDailyCode,
|
||||
ProjectId = WeldingDaily.ProjectId,
|
||||
InstallationId = WeldingDaily.InstallationId,
|
||||
UnitId = WeldingDaily.UnitId,
|
||||
WeldingDate = WeldingDaily.WeldingDate,
|
||||
Tabler = WeldingDaily.Tabler,
|
||||
TableDate = WeldingDaily.TableDate,
|
||||
Remark = WeldingDaily.Remark,
|
||||
};
|
||||
|
||||
db.Pipeline_WeldingDaily.InsertOnSubmit(newWeldingDaily);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改焊接日报信息
|
||||
/// </summary>
|
||||
/// <param name="WeldingDaily"></param>
|
||||
public static void UpdatePipeline_WeldingDaily(Model.Pipeline_WeldingDaily WeldingDaily)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_WeldingDaily newWeldingDaily = db.Pipeline_WeldingDaily.FirstOrDefault(e => e.WeldingDailyId == WeldingDaily.WeldingDailyId);
|
||||
if (newWeldingDaily != null)
|
||||
{
|
||||
newWeldingDaily.WeldingDailyCode = WeldingDaily.WeldingDailyCode;
|
||||
newWeldingDaily.InstallationId = WeldingDaily.InstallationId;
|
||||
newWeldingDaily.UnitId = WeldingDaily.UnitId;
|
||||
newWeldingDaily.WeldingDate = WeldingDaily.WeldingDate;
|
||||
newWeldingDaily.Tabler = WeldingDaily.Tabler;
|
||||
newWeldingDaily.TableDate = WeldingDaily.TableDate;
|
||||
newWeldingDaily.Remark = WeldingDaily.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据焊接日报Id删除一个焊接日报信息
|
||||
/// </summary>
|
||||
/// <param name="WeldingDailyId"></param>
|
||||
public static void DeleteWeldingDailyByWeldingDailyId(string WeldingDailyId)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_WeldingDaily delWeldingDaily = db.Pipeline_WeldingDaily.FirstOrDefault(e => e.WeldingDailyId == WeldingDailyId);
|
||||
if (delWeldingDaily != null)
|
||||
{
|
||||
db.Pipeline_WeldingDaily.DeleteOnSubmit(delWeldingDaily);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按类型获取焊接日报项
|
||||
/// </summary>
|
||||
/// <param name="WeldingDailyType"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Pipeline_WeldingDaily> GetPipeline_WeldingDailyList(string unitId)
|
||||
{
|
||||
var list = (from x in Funs.DB.Pipeline_WeldingDaily
|
||||
where x.UnitId == unitId
|
||||
orderby x.WeldingDailyCode
|
||||
select x).ToList();
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
// 获取焊丝名称
|
||||
public static string GetWeldSilkCode(string weldSilkId)
|
||||
{
|
||||
string weldSilkCode = string.Empty;
|
||||
if (!string.IsNullOrEmpty(weldSilkId))
|
||||
{
|
||||
string[] weldSilkIds = weldSilkId.Split(',');
|
||||
if (weldSilkIds.Count() > 0)
|
||||
{
|
||||
foreach (string s in weldSilkIds)
|
||||
{
|
||||
var silk = BLL.Base_ConsumablesService.GetConsumablesByConsumablesId(s);
|
||||
weldSilkCode = weldSilkCode + silk.ConsumablesCode + ',';
|
||||
}
|
||||
if (weldSilkCode.Length > 0)
|
||||
{
|
||||
weldSilkCode = weldSilkCode.Substring(0, weldSilkCode.Length - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return weldSilkCode;
|
||||
}
|
||||
|
||||
#region 焊接日报下拉项
|
||||
/// <summary>
|
||||
/// 焊接日报下拉项
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名称</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
/// <param name="WeldingDailyType">耗材类型</param>
|
||||
public static void InitWeldingDailyDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease, string unitId)
|
||||
{
|
||||
dropName.DataValueField = "WeldingDailyId";
|
||||
dropName.DataTextField = "WeldingDailyCode";
|
||||
dropName.DataSource = GetPipeline_WeldingDailyList(unitId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class PreWeldReportService
|
||||
{
|
||||
public static Model.Pipeline_PreWeldingDaily GetPreWeldingDaily(string preWeldingDailyId)
|
||||
{
|
||||
return Funs.DB.Pipeline_PreWeldingDaily.FirstOrDefault(e => e.PreWeldingDailyId == preWeldingDailyId);
|
||||
}
|
||||
|
||||
public static void DeletePreWeldingDaily(string preWeldingDailyId)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Pipeline_PreWeldingDaily daily = db.Pipeline_PreWeldingDaily.FirstOrDefault(e => e.PreWeldingDailyId == preWeldingDailyId);
|
||||
if (daily != null)
|
||||
{
|
||||
db.Pipeline_PreWeldingDaily.DeleteOnSubmit(daily);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Data.Linq;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI.WebControls;
|
||||
using Model;
|
||||
using BLL;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class UserShowColumnsService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据用户ID获取信息
|
||||
/// </summary>
|
||||
/// <param name="userId">用户ID</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Sys_UserShowColumns GetColumnsByUserId(string userId, string type)
|
||||
{
|
||||
return Funs.DB.Sys_UserShowColumns.FirstOrDefault(x => x.UserId == userId && x.ShowType == type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加用户对应显示列信息
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="opUserShowColumns"></param>
|
||||
public static void AddUserShowColumns(Model.Sys_UserShowColumns showColumns)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Sys_UserShowColumns newShowColumns = new Model.Sys_UserShowColumns();
|
||||
|
||||
newShowColumns.ShowColumnId = SQLHelper.GetNewID(typeof(Model.Sys_UserShowColumns));
|
||||
newShowColumns.UserId = showColumns.UserId;
|
||||
newShowColumns.Columns = showColumns.Columns;
|
||||
newShowColumns.ShowType = showColumns.ShowType;
|
||||
db.Sys_UserShowColumns.InsertOnSubmit(newShowColumns);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改用户对应显示列信息
|
||||
/// </summary>
|
||||
/// <param name="roleId"></param>
|
||||
/// <param name="roleName"></param>
|
||||
/// <param name="def"></param>
|
||||
public static void UpdateUserShowColumns(Model.Sys_UserShowColumns showColumns)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Sys_UserShowColumns newShowColumns = db.Sys_UserShowColumns.First(e => e.ShowColumnId == showColumns.ShowColumnId);
|
||||
newShowColumns.Columns = showColumns.Columns;
|
||||
newShowColumns.ShowType = showColumns.ShowType;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除用户对应显示列信息
|
||||
/// </summary>
|
||||
/// <param name="roleId"></param>
|
||||
public static void DeleteUserShowColumns(string showColumnId)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.Sys_UserShowColumns newShowColumns = db.Sys_UserShowColumns.First(e => e.ShowColumnId == showColumnId);
|
||||
db.Sys_UserShowColumns.DeleteOnSubmit(newShowColumns);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user