80 lines
3.2 KiB
C#
80 lines
3.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace BLL
|
|
{
|
|
public class AreaConcernService
|
|
{
|
|
public static Model.Editor_AreaConcern GetAreaConcernById(string areaConcernId)
|
|
{
|
|
return Funs.DB.Editor_AreaConcern.FirstOrDefault(e => e.AreaConcernId == areaConcernId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加
|
|
/// </summary>
|
|
/// <param name="areaConcern"></param>
|
|
public static void AddAreaConcern(Model.Editor_AreaConcern areaConcern)
|
|
{
|
|
Model.Editor_AreaConcern newAreaConcern = new Model.Editor_AreaConcern();
|
|
newAreaConcern.AreaConcernId = areaConcern.AreaConcernId;
|
|
newAreaConcern.EProjectId = areaConcern.EProjectId;
|
|
newAreaConcern.SN = areaConcern.SN;
|
|
newAreaConcern.EntryDate = areaConcern.EntryDate;
|
|
newAreaConcern.CreatedById = areaConcern.CreatedById;
|
|
newAreaConcern.CreatedByName = areaConcern.CreatedByName;
|
|
newAreaConcern.CategoryCauseId = areaConcern.CategoryCauseId;
|
|
newAreaConcern.CategoryCauseName = areaConcern.CategoryCauseName;
|
|
newAreaConcern.Remark = areaConcern.Remark;
|
|
Funs.DB.Editor_AreaConcern.InsertOnSubmit(newAreaConcern);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改
|
|
/// </summary>
|
|
/// <param name="areaConcern"></param>
|
|
public static void UpdateAreaConcern(Model.Editor_AreaConcern areaConcern)
|
|
{
|
|
Model.Editor_AreaConcern newAreaConcern = Funs.DB.Editor_AreaConcern.FirstOrDefault(e => e.AreaConcernId == areaConcern.AreaConcernId);
|
|
if (newAreaConcern != null)
|
|
{
|
|
newAreaConcern.SN = areaConcern.SN;
|
|
newAreaConcern.EntryDate = areaConcern.EntryDate;
|
|
newAreaConcern.CreatedById = areaConcern.CreatedById;
|
|
newAreaConcern.CreatedByName = areaConcern.CreatedByName;
|
|
newAreaConcern.CategoryCauseId = areaConcern.CategoryCauseId;
|
|
newAreaConcern.CategoryCauseName = areaConcern.CategoryCauseName;
|
|
newAreaConcern.Remark = areaConcern.Remark;
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="areaConcernId"></param>
|
|
public static void DeleteAreaConcernById(string areaConcernId)
|
|
{
|
|
Model.Editor_AreaConcern areaConcern = Funs.DB.Editor_AreaConcern.FirstOrDefault(e => e.AreaConcernId == areaConcernId);
|
|
if (areaConcern != null)
|
|
{
|
|
Funs.DB.Editor_AreaConcern.DeleteOnSubmit(areaConcern);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据项目Id获取AreaConcern信息
|
|
/// </summary>
|
|
/// <param name="eprojectId"></param>
|
|
/// <returns></returns>
|
|
public static List<Model.Editor_AreaConcern> GetAreaConcernListByEprojectId(string eprojectId)
|
|
{
|
|
return (from x in Funs.DB.Editor_AreaConcern where x.EProjectId == eprojectId orderby x.EntryDate descending select x).ToList();
|
|
}
|
|
}
|
|
}
|