80 lines
2.7 KiB
C#
80 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Collections;
|
|
|
|
namespace BLL
|
|
{
|
|
public static class FLDataService
|
|
{
|
|
public static Model.SGGLDB db = Funs.DB;
|
|
|
|
/// <summary>
|
|
/// 根据主键获取资料发放登记
|
|
/// </summary>
|
|
/// <param name="specialDataId"></param>
|
|
/// <returns></returns>
|
|
public static Model.HJGL_FL_Data GetDataById(string Id)
|
|
{
|
|
return Funs.DB.HJGL_FL_Data.FirstOrDefault(e => e.Id == Id);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加资料发放登记
|
|
/// </summary>
|
|
/// <param name="Data"></param>
|
|
public static void AddData(Model.HJGL_FL_Data Data)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_FL_Data newData = new Model.HJGL_FL_Data();
|
|
newData.Id = Data.Id;
|
|
newData.ProjectId = Data.ProjectId;
|
|
newData.TotalWeldQuantity = Data.TotalWeldQuantity;
|
|
newData.TotalCompleted = Data.TotalCompleted;
|
|
newData.OneTimeFilmAmount = Data.OneTimeFilmAmount;
|
|
newData.OneTimeFilmQualifiedAmount = Data.OneTimeFilmQualifiedAmount;
|
|
newData.CompileMan = Data.CompileMan;
|
|
newData.CompileDate = Data.CompileDate;
|
|
db.HJGL_FL_Data.InsertOnSubmit(newData);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改资料发放登记
|
|
/// </summary>
|
|
/// <param name="Data"></param>
|
|
public static void UpdateData(Model.HJGL_FL_Data Data)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_FL_Data newData = db.HJGL_FL_Data.FirstOrDefault(e => e.Id == Data.Id);
|
|
if (newData != null)
|
|
{
|
|
newData.ProjectId = Data.ProjectId;
|
|
newData.TotalWeldQuantity = Data.TotalWeldQuantity;
|
|
newData.TotalCompleted = Data.TotalCompleted;
|
|
newData.OneTimeFilmAmount = Data.OneTimeFilmAmount;
|
|
newData.OneTimeFilmQualifiedAmount = Data.OneTimeFilmQualifiedAmount;
|
|
newData.CompileMan = Data.CompileMan;
|
|
newData.CompileDate = Data.CompileDate;
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除资料发放登记
|
|
/// </summary>
|
|
/// <param name="specialDataId"></param>
|
|
public static void DeleteData(string Id)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_FL_Data Data = db.HJGL_FL_Data.FirstOrDefault(e => e.Id == Id);
|
|
if (Data != null)
|
|
{
|
|
db.HJGL_FL_Data.DeleteOnSubmit(Data);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|