74 lines
3.3 KiB
C#
74 lines
3.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BLL
|
|
{
|
|
public class TestRunMonthSummaryReportService
|
|
{
|
|
/// <summary>
|
|
/// 根据主键获取开车月技术总结
|
|
/// </summary>
|
|
/// <param name="TestRunMonthSummaryReportId"></param>
|
|
/// <returns></returns>
|
|
public static Model.ZHGL_TestRunMonthSummaryReport GetTestRunMonthSummaryReportById(string TestRunMonthSummaryReportId)
|
|
{
|
|
return Funs.DB.ZHGL_TestRunMonthSummaryReport.FirstOrDefault(e => e.TestRunMonthSummaryReportId == TestRunMonthSummaryReportId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加开车月技术总结
|
|
/// </summary>
|
|
/// <param name="TestRunMonthSummaryReport"></param>
|
|
public static void AddTestRunMonthSummaryReport(Model.ZHGL_TestRunMonthSummaryReport TestRunMonthSummaryReport)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.ZHGL_TestRunMonthSummaryReport newTestRunMonthSummaryReport = new Model.ZHGL_TestRunMonthSummaryReport
|
|
{
|
|
TestRunMonthSummaryReportId = TestRunMonthSummaryReport.TestRunMonthSummaryReportId,
|
|
Year = TestRunMonthSummaryReport.Year,
|
|
UserId = TestRunMonthSummaryReport.UserId,
|
|
CompileMan = TestRunMonthSummaryReport.CompileMan,
|
|
CompileDate = TestRunMonthSummaryReport.CompileDate
|
|
};
|
|
db.ZHGL_TestRunMonthSummaryReport.InsertOnSubmit(newTestRunMonthSummaryReport);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改开车月技术总结
|
|
/// </summary>
|
|
/// <param name="TestRunMonthSummaryReport"></param>
|
|
public static void UpdateTestRunMonthSummaryReport(Model.ZHGL_TestRunMonthSummaryReport TestRunMonthSummaryReport)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.ZHGL_TestRunMonthSummaryReport newTestRunMonthSummaryReport = db.ZHGL_TestRunMonthSummaryReport.FirstOrDefault(e => e.TestRunMonthSummaryReportId == TestRunMonthSummaryReport.TestRunMonthSummaryReportId);
|
|
if (newTestRunMonthSummaryReport != null)
|
|
{
|
|
newTestRunMonthSummaryReport.Year = TestRunMonthSummaryReport.Year;
|
|
newTestRunMonthSummaryReport.UserId = TestRunMonthSummaryReport.UserId;
|
|
newTestRunMonthSummaryReport.CompileMan = TestRunMonthSummaryReport.CompileMan;
|
|
newTestRunMonthSummaryReport.CompileDate = TestRunMonthSummaryReport.CompileDate;
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除开车月技术总结
|
|
/// </summary>
|
|
/// <param name="TestRunMonthSummaryReportId"></param>
|
|
public static void DeleteTestRunMonthSummaryReportById(string TestRunMonthSummaryReportId)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.ZHGL_TestRunMonthSummaryReport TestRunMonthSummaryReport = db.ZHGL_TestRunMonthSummaryReport.FirstOrDefault(e => e.TestRunMonthSummaryReportId == TestRunMonthSummaryReportId);
|
|
if (TestRunMonthSummaryReport != null)
|
|
{
|
|
db.ZHGL_TestRunMonthSummaryReport.DeleteOnSubmit(TestRunMonthSummaryReport);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|