89 lines
4.3 KiB
C#
89 lines
4.3 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
|
|||
|
namespace BLL
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 评优评奖加分项
|
|||
|
/// </summary>
|
|||
|
public static class ExcellentEvaluationAndBonusPointsService
|
|||
|
{
|
|||
|
public static Model.SUBQHSEDB db = Funs.DB;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据主键获取评优评奖加分项信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="Id"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static Model.Check_ExcellentEvaluationAndBonusPoints GetExcellentEvaluationAndBonusPointsById(string Id)
|
|||
|
{
|
|||
|
return Funs.DB.Check_ExcellentEvaluationAndBonusPoints.FirstOrDefault(e => e.Id == Id);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 添加评优评奖加分项
|
|||
|
/// </summary>
|
|||
|
/// <param name="ExcellentEvaluationAndBonusPoints"></param>
|
|||
|
public static void AddExcellentEvaluationAndBonusPoints(Model.Check_ExcellentEvaluationAndBonusPoints ExcellentEvaluationAndBonusPoints)
|
|||
|
{
|
|||
|
Model.SUBQHSEDB db = Funs.DB;
|
|||
|
Model.Check_ExcellentEvaluationAndBonusPoints newExcellentEvaluationAndBonusPoints = new Model.Check_ExcellentEvaluationAndBonusPoints
|
|||
|
{
|
|||
|
Id = ExcellentEvaluationAndBonusPoints.Id,
|
|||
|
ProjectId = ExcellentEvaluationAndBonusPoints.ProjectId,
|
|||
|
UnitId = ExcellentEvaluationAndBonusPoints.UnitId,
|
|||
|
Title = ExcellentEvaluationAndBonusPoints.Title,
|
|||
|
CompileDate = ExcellentEvaluationAndBonusPoints.CompileDate,
|
|||
|
EndTime = ExcellentEvaluationAndBonusPoints.EndTime,
|
|||
|
CompileMan = ExcellentEvaluationAndBonusPoints.CompileMan,
|
|||
|
Remark = ExcellentEvaluationAndBonusPoints.Remark,
|
|||
|
AttachUrl = ExcellentEvaluationAndBonusPoints.AttachUrl,
|
|||
|
SeeFile = ExcellentEvaluationAndBonusPoints.SeeFile
|
|||
|
};
|
|||
|
db.Check_ExcellentEvaluationAndBonusPoints.InsertOnSubmit(newExcellentEvaluationAndBonusPoints);
|
|||
|
db.SubmitChanges();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 修改
|
|||
|
/// </summary>
|
|||
|
/// <param name="ExcellentEvaluationAndBonusPoints"></param>
|
|||
|
public static void UpdateExcellentEvaluationAndBonusPoints(Model.Check_ExcellentEvaluationAndBonusPoints ExcellentEvaluationAndBonusPoints)
|
|||
|
{
|
|||
|
Model.SUBQHSEDB db = Funs.DB;
|
|||
|
Model.Check_ExcellentEvaluationAndBonusPoints newExcellentEvaluationAndBonusPoints = db.Check_ExcellentEvaluationAndBonusPoints.FirstOrDefault(e => e.Id == ExcellentEvaluationAndBonusPoints.Id);
|
|||
|
if (newExcellentEvaluationAndBonusPoints != null)
|
|||
|
{
|
|||
|
newExcellentEvaluationAndBonusPoints.Title = ExcellentEvaluationAndBonusPoints.Title;
|
|||
|
newExcellentEvaluationAndBonusPoints.CompileDate = ExcellentEvaluationAndBonusPoints.CompileDate;
|
|||
|
newExcellentEvaluationAndBonusPoints.EndTime = ExcellentEvaluationAndBonusPoints.EndTime;
|
|||
|
newExcellentEvaluationAndBonusPoints.CompileMan = ExcellentEvaluationAndBonusPoints.CompileMan;
|
|||
|
newExcellentEvaluationAndBonusPoints.Remark = ExcellentEvaluationAndBonusPoints.Remark;
|
|||
|
newExcellentEvaluationAndBonusPoints.AttachUrl = ExcellentEvaluationAndBonusPoints.AttachUrl;
|
|||
|
newExcellentEvaluationAndBonusPoints.SeeFile = ExcellentEvaluationAndBonusPoints.SeeFile;
|
|||
|
db.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 删除
|
|||
|
/// </summary>
|
|||
|
/// <param name="Id"></param>
|
|||
|
public static void DeleteExcellentEvaluationAndBonusPointsById(string Id)
|
|||
|
{
|
|||
|
Model.SUBQHSEDB db = Funs.DB;
|
|||
|
Model.Check_ExcellentEvaluationAndBonusPoints ExcellentEvaluationAndBonusPoints = db.Check_ExcellentEvaluationAndBonusPoints.FirstOrDefault(e => e.Id == Id);
|
|||
|
if (ExcellentEvaluationAndBonusPoints != null)
|
|||
|
{
|
|||
|
if (!string.IsNullOrEmpty(ExcellentEvaluationAndBonusPoints.AttachUrl))
|
|||
|
{
|
|||
|
BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, ExcellentEvaluationAndBonusPoints.AttachUrl);//删除附件
|
|||
|
}
|
|||
|
db.Check_ExcellentEvaluationAndBonusPoints.DeleteOnSubmit(ExcellentEvaluationAndBonusPoints);
|
|||
|
db.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|