94 lines
3.7 KiB
C#
94 lines
3.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 特岗证书
|
|
/// </summary>
|
|
public static class PerfomanceContentService
|
|
{
|
|
public static Model.SGGLDB db = Funs.DB;
|
|
|
|
/// <summary>
|
|
/// 根据主键获取特岗证书
|
|
/// </summary>
|
|
/// <param name="certificateId"></param>
|
|
/// <returns></returns>
|
|
public static Model.Perfomance_PerfomanceContent GetPerfomanceContentById(string perfomanceId)
|
|
{
|
|
return Funs.DB.Perfomance_PerfomanceContent.FirstOrDefault(e => e.PerfomanceId == perfomanceId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加特岗证书
|
|
/// </summary>
|
|
/// <param name="certificate"></param>
|
|
public static void AddPerfomanceContent(Model.Perfomance_PerfomanceContent perfomanceContent)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Perfomance_PerfomanceContent newCertificate = new Model.Perfomance_PerfomanceContent
|
|
{
|
|
PerfomanceType = perfomanceContent.PerfomanceType,
|
|
PerfomanceValue = perfomanceContent.PerfomanceValue,
|
|
PerfomanceContent = perfomanceContent.PerfomanceContent,
|
|
PerfomanceId = perfomanceContent.PerfomanceId,
|
|
ProjectId = perfomanceContent.ProjectId,
|
|
ShowIndex = perfomanceContent.ShowIndex,
|
|
ReMark = perfomanceContent.ReMark
|
|
};
|
|
db.Perfomance_PerfomanceContent.InsertOnSubmit(newCertificate);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改特岗证书
|
|
/// </summary>
|
|
/// <param name="perfomanceContent"></param>
|
|
public static void UpdatePerfomanceContent(Model.Perfomance_PerfomanceContent perfomanceContent)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Perfomance_PerfomanceContent newPerfomanceConten = db.Perfomance_PerfomanceContent.FirstOrDefault(e => e.PerfomanceId == perfomanceContent.PerfomanceId);
|
|
if (newPerfomanceConten != null)
|
|
{
|
|
newPerfomanceConten.PerfomanceType = perfomanceContent.PerfomanceType;
|
|
newPerfomanceConten.PerfomanceValue = perfomanceContent.PerfomanceValue;
|
|
newPerfomanceConten.PerfomanceContent = perfomanceContent.PerfomanceContent;
|
|
newPerfomanceConten.PerfomanceId = perfomanceContent.PerfomanceId;
|
|
newPerfomanceConten.ProjectId = perfomanceContent.ProjectId;
|
|
newPerfomanceConten.ShowIndex = perfomanceContent.ShowIndex;
|
|
newPerfomanceConten.ReMark = perfomanceContent.ReMark;
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除特岗证书
|
|
/// </summary>
|
|
/// <param name="perfomanceId"></param>
|
|
public static void DeletePerfomanceContentById(string perfomanceId)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Perfomance_PerfomanceContent perfomanceContent = db.Perfomance_PerfomanceContent.FirstOrDefault(e => e.PerfomanceId == perfomanceId);
|
|
if (perfomanceContent != null)
|
|
{
|
|
db.Perfomance_PerfomanceContent.DeleteOnSubmit(perfomanceContent);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取特岗证书列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static List<Model.Perfomance_PerfomanceContent> GetCertificateList(int perfomanceType)
|
|
{
|
|
return (from x in Funs.DB.Perfomance_PerfomanceContent where x.PerfomanceType == perfomanceType orderby x.ShowIndex select x).ToList();
|
|
}
|
|
|
|
|
|
}
|
|
}
|