140 lines
6.1 KiB
C#
140 lines
6.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 焊工考试申请
|
|
/// </summary>
|
|
public class TestApplicationService
|
|
{
|
|
/// <summary>
|
|
/// 根据主键获取焊工考试申请
|
|
/// </summary>
|
|
/// <param name="testApplicationId"></param>
|
|
/// <returns></returns>
|
|
public static Model.Welder_TestApplication GetTestApplicationById(string testApplicationId)
|
|
{
|
|
return Funs.DB.Welder_TestApplication.FirstOrDefault(e => e.ApplicationTestId == testApplicationId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据预考试时间和身份证号获取焊工考试申请
|
|
/// </summary>
|
|
/// <param name="preTestDate"></param>
|
|
/// <param name="identityCard"></param>
|
|
/// <returns></returns>
|
|
|
|
public static Model.Welder_TestApplication GetTestApplicationByTestDateAndIdentityCard(string projectId, string preTestDate, string identityCard)
|
|
{
|
|
return Funs.DB.Welder_TestApplication.FirstOrDefault(e => e.ProjectId == projectId && e.PreTestDate == Convert.ToDateTime(preTestDate) && e.IdentityCard == identityCard);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据身份证号获取焊工考试申请
|
|
/// </summary>
|
|
/// <param name="preTestDate"></param>
|
|
/// <param name="identityCard"></param>
|
|
/// <returns></returns>
|
|
public static Model.Welder_TestApplication GetTestApplicationByIdentityCard(string projectId,string identityCard)
|
|
{
|
|
return Funs.DB.Welder_TestApplication.FirstOrDefault(e => e.ProjectId == projectId && e.IdentityCard == identityCard);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加焊工考试申请
|
|
/// </summary>
|
|
/// <param name="test"></param>
|
|
public static void AddTestApplication(Model.Welder_TestApplication test)
|
|
{
|
|
Model.Welder_TestApplication newTest = new Model.Welder_TestApplication
|
|
{
|
|
ApplicationTestId = test.ApplicationTestId,
|
|
ProjectId = test.ProjectId,
|
|
ConUnit = test.ConUnit,
|
|
ConUnitWeldingEngineer = test.ConUnitWeldingEngineer,
|
|
Certificate = test.Certificate,
|
|
CertificateValidity = test.CertificateValidity,
|
|
PreTestDate = test.PreTestDate,
|
|
WelderClass = test.WelderClass,
|
|
WelderCode = test.WelderCode,
|
|
WelderName = test.WelderName,
|
|
IdentityCard = test.IdentityCard,
|
|
WeldingPosition = test.WeldingPosition,
|
|
WeldingMethod = test.WeldingMethod,
|
|
SpecimenSize = test.SpecimenSize,
|
|
MaterialCategory = test.MaterialCategory,
|
|
AppearanceEvaluation = test.AppearanceEvaluation,
|
|
FirstExamination = test.FirstExamination,
|
|
SecondExamination = test.SecondExamination,
|
|
WelderCondition = test.WelderCondition,
|
|
ExamDate = test.ExamDate,
|
|
InvigilatorConfirmed = test.InvigilatorConfirmed,
|
|
Area = test.Area,
|
|
ExamTrustDate = test.ExamTrustDate,
|
|
ExamTrustCode = test.ExamTrustCode,
|
|
CheckDate = test.CheckDate,
|
|
CheckResult = test.CheckResult,
|
|
NDTFilm = test.NDTFilm,
|
|
CheckUnit = test.CheckUnit,
|
|
OwnerNum = test.OwnerNum,
|
|
};
|
|
Funs.DB.Welder_TestApplication.InsertOnSubmit(newTest);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
|
|
public static void UpdateTestApplication(Model.Welder_TestApplication test)
|
|
{
|
|
Model.Welder_TestApplication newTest = Funs.DB.Welder_TestApplication.FirstOrDefault(e => e.ApplicationTestId == test.ApplicationTestId);
|
|
if (newTest != null)
|
|
{
|
|
newTest.ConUnit = test.ConUnit;
|
|
newTest.ConUnitWeldingEngineer = test.ConUnitWeldingEngineer;
|
|
newTest.Certificate = test.Certificate;
|
|
newTest.CertificateValidity = test.CertificateValidity;
|
|
newTest.PreTestDate = test.PreTestDate;
|
|
newTest.WelderClass = test.WelderClass;
|
|
newTest.WelderCode = test.WelderCode;
|
|
newTest.WelderName = test.WelderName;
|
|
newTest.IdentityCard = test.IdentityCard;
|
|
newTest.WeldingPosition = test.WeldingPosition;
|
|
newTest.WeldingMethod = test.WeldingMethod;
|
|
newTest.SpecimenSize = test.SpecimenSize;
|
|
newTest.MaterialCategory = test.MaterialCategory;
|
|
newTest.AppearanceEvaluation = test.AppearanceEvaluation;
|
|
newTest.FirstExamination = test.FirstExamination;
|
|
newTest.SecondExamination = test.SecondExamination;
|
|
newTest.WelderCondition = test.WelderCondition;
|
|
newTest.ExamDate = test.ExamDate;
|
|
newTest.InvigilatorConfirmed = test.InvigilatorConfirmed;
|
|
newTest.Area = test.Area;
|
|
newTest.ExamTrustDate = test.ExamTrustDate;
|
|
newTest.ExamTrustCode = test.ExamTrustCode;
|
|
newTest.CheckDate = test.CheckDate;
|
|
newTest.CheckResult = test.CheckResult;
|
|
newTest.NDTFilm = test.NDTFilm;
|
|
newTest.CheckUnit = test.CheckUnit;
|
|
newTest.OwnerNum = test.OwnerNum;
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除焊工考试申请
|
|
/// </summary>
|
|
/// <param name="testApplicationId"></param>
|
|
public static void DeleteTestApplicationById(string testApplicationId)
|
|
{
|
|
Model.Welder_TestApplication testApplication = Funs.DB.Welder_TestApplication.FirstOrDefault(e => e.ApplicationTestId == testApplicationId);
|
|
if (testApplication != null)
|
|
{
|
|
Funs.DB.Welder_TestApplication.DeleteOnSubmit(testApplication);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|