151 lines
6.0 KiB
C#
151 lines
6.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Collections;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace BLL
|
|
{
|
|
public class HJGL_RepairService
|
|
{
|
|
/// <summary>
|
|
/// 根据委托Id获取用于委托的委托信息
|
|
/// </summary>
|
|
/// <param name="jot_id"></param>
|
|
/// <returns></returns>
|
|
public static Model.HJGL_CH_Repair GetCH_RepairByID(string CH_RepairID)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
var view = db.HJGL_CH_Repair.FirstOrDefault(e => e.CH_RepairID == CH_RepairID);
|
|
return view;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 增加委托信息
|
|
/// </summary>
|
|
/// <param name="cH_Trust">委托实体</param>
|
|
public static void AddCH_Repair(Model.HJGL_CH_Repair repair)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_CH_Repair newRepair = new Model.HJGL_CH_Repair();
|
|
newRepair.CH_RepairID = repair.CH_RepairID;
|
|
newRepair.ProjectId = repair.ProjectId;
|
|
newRepair.TrustItemID = repair.TrustItemID;
|
|
newRepair.ISO_ID = repair.ISO_ID;
|
|
newRepair.JOT_ID = repair.JOT_ID;
|
|
newRepair.NDT_ID = repair.NDT_ID;
|
|
newRepair.RepairTrustDate = repair.RepairTrustDate;
|
|
newRepair.BSU_ID = repair.BSU_ID;
|
|
newRepair.BatchId = repair.BatchId;
|
|
newRepair.CH_TrustUnit = repair.CH_TrustUnit;
|
|
newRepair.InstallationId = repair.InstallationId;
|
|
newRepair.CH_TrustType = repair.CH_TrustType;
|
|
newRepair.CH_ItemName = repair.CH_ItemName;
|
|
newRepair.CH_RepairDate = repair.CH_RepairDate;
|
|
newRepair.CH_RepairNo = repair.CH_RepairNo;
|
|
newRepair.CH_Tabler = repair.CH_Tabler;
|
|
newRepair.CH_TableDate = repair.CH_TableDate;
|
|
newRepair.CH_Printer = repair.CH_Printer;
|
|
newRepair.CH_PrintDate = repair.CH_PrintDate;
|
|
newRepair.CH_Remark = repair.CH_Remark;
|
|
newRepair.CH_AcceptGrade = repair.CH_AcceptGrade;
|
|
newRepair.CH_NDTCriteria = repair.CH_NDTCriteria;
|
|
newRepair.CH_SlopeType = repair.CH_SlopeType;
|
|
newRepair.CH_WeldMethod = repair.CH_WeldMethod;
|
|
|
|
db.HJGL_CH_Repair.InsertOnSubmit(newRepair);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改焊接信息
|
|
/// </summary>
|
|
/// <param name="weldReport">焊接实体</param>
|
|
public static void UpdateCH_Trust(Model.HJGL_CH_Repair repair)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_CH_Repair newRepair = db.HJGL_CH_Repair.FirstOrDefault(e => e.CH_RepairID == repair.CH_RepairID);
|
|
if (newRepair != null)
|
|
{
|
|
newRepair.ProjectId = repair.ProjectId;
|
|
newRepair.TrustItemID = repair.TrustItemID;
|
|
newRepair.JOT_ID = repair.JOT_ID;
|
|
newRepair.RepairTrustDate = repair.RepairTrustDate;
|
|
newRepair.BSU_ID = repair.BSU_ID;
|
|
newRepair.CH_RepairDate = repair.CH_RepairDate;
|
|
newRepair.CH_AcceptGrade = repair.CH_AcceptGrade;
|
|
newRepair.CH_NDTCriteria = repair.CH_NDTCriteria;
|
|
newRepair.CH_CheckUnit = repair.CH_CheckUnit;
|
|
newRepair.CH_SlopeType = repair.CH_SlopeType;
|
|
newRepair.CH_WeldMethod = repair.CH_WeldMethod;
|
|
newRepair.CH_RepairNo = repair.CH_RepairNo;
|
|
newRepair.CH_Tabler = repair.CH_Tabler;
|
|
newRepair.CH_TableDate = repair.CH_TableDate;
|
|
newRepair.CH_Printer = repair.CH_Printer;
|
|
newRepair.CH_PrintDate = repair.CH_PrintDate;
|
|
newRepair.CH_Remark = repair.CH_Remark;
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 委托单打印信息修改
|
|
/// </summary>
|
|
/// <param name="cH_Trust"></param>
|
|
public static void PrintCH_Repair(Model.HJGL_CH_Repair cH_Repair)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_CH_Repair newCH_Repair = db.HJGL_CH_Repair.FirstOrDefault(e => e.CH_RepairID == cH_Repair.CH_RepairID);
|
|
if (newCH_Repair != null)
|
|
{
|
|
newCH_Repair.CH_Printer = cH_Repair.CH_Printer;
|
|
newCH_Repair.CH_PrintDate = cH_Repair.CH_PrintDate;
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 委托单打印信息修改
|
|
/// </summary>
|
|
/// <param name="cH_Trust"></param>
|
|
public static void RecordPrintCH_Repair(Model.HJGL_CH_Repair cH_Repair)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_CH_Repair newCH_Repair = db.HJGL_CH_Repair.FirstOrDefault(e => e.CH_RepairID == cH_Repair.CH_RepairID);
|
|
if (newCH_Repair != null)
|
|
{
|
|
newCH_Repair.Record_Printer = cH_Repair.Record_Printer;
|
|
newCH_Repair.Record_PrintDate = cH_Repair.Record_PrintDate;
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除委托信息
|
|
/// </summary>
|
|
/// <param name="cH_TrustID">委托主键</param>
|
|
public static void DeleteRepairByCH_RepairID(string cH_RepairID)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_CH_Repair cH_Repair = db.HJGL_CH_Repair.FirstOrDefault(e => e.CH_RepairID == cH_RepairID);
|
|
if (cH_Repair != null)
|
|
{
|
|
db.HJGL_CH_Repair.DeleteOnSubmit(cH_Repair);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="projectId"></param>
|
|
/// <returns></returns>
|
|
public static List<Model.HJGL_CH_Repair> GetRepairByProjectId(string projectId)
|
|
{
|
|
return (from x in Funs.DB.HJGL_CH_Repair where x.ProjectId == projectId && x.Record_PrintDate == null select x).ToList();
|
|
}
|
|
}
|
|
}
|