2022-03-15 17:36:38 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Data.Linq;
|
|
|
|
|
using System.Web.Security;
|
|
|
|
|
using System.Web.UI.WebControls;
|
|
|
|
|
using Model;
|
|
|
|
|
using BLL;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace BLL
|
|
|
|
|
{
|
|
|
|
|
public class CnProfessionService
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据专业Id获取专业信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="unitProjectId">专业Id</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static Model.WBS_CnProfession GetCnProfessionByCnProfessionId(string cnProfessionId)
|
|
|
|
|
{
|
|
|
|
|
return Funs.DB.WBS_CnProfession.FirstOrDefault(e => e.CnProfessionId == cnProfessionId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 增加专业
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="user">专业</param>
|
|
|
|
|
public static void AddCnProfession(Model.WBS_CnProfession cnProfession)
|
|
|
|
|
{
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
Model.WBS_CnProfession newCnP = new Model.WBS_CnProfession();
|
|
|
|
|
newCnP.CnProfessionId = SQLHelper.GetNewID(typeof(Model.WBS_CnProfession));
|
|
|
|
|
newCnP.CnProfessionName = cnProfession.CnProfessionName;
|
|
|
|
|
newCnP.CnProfessionCode = cnProfession.CnProfessionCode;
|
|
|
|
|
newCnP.InstallationId = cnProfession.InstallationId;
|
|
|
|
|
newCnP.ProjectId = cnProfession.ProjectId;
|
|
|
|
|
newCnP.StartDate = cnProfession.StartDate;
|
|
|
|
|
newCnP.EndDate = cnProfession.EndDate;
|
|
|
|
|
newCnP.Weights = cnProfession.Weights;
|
|
|
|
|
newCnP.OldId = cnProfession.OldId;
|
|
|
|
|
newCnP.UnitId = cnProfession.UnitId;
|
|
|
|
|
|
|
|
|
|
db.WBS_CnProfession.InsertOnSubmit(newCnP);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 修改专业
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="user">专业</param>
|
|
|
|
|
public static void UpdateCnProfession(Model.WBS_CnProfession cnProfession)
|
|
|
|
|
{
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
Model.WBS_CnProfession newCnP = db.WBS_CnProfession.First(e => e.CnProfessionId == cnProfession.CnProfessionId);
|
|
|
|
|
|
|
|
|
|
newCnP.CnProfessionName = cnProfession.CnProfessionName;
|
|
|
|
|
newCnP.CnProfessionCode = cnProfession.CnProfessionCode;
|
|
|
|
|
newCnP.StartDate = cnProfession.StartDate;
|
|
|
|
|
newCnP.EndDate = cnProfession.EndDate;
|
|
|
|
|
newCnP.Weights = cnProfession.Weights;
|
|
|
|
|
newCnP.WeightsMoney = cnProfession.WeightsMoney;
|
|
|
|
|
newCnP.IsWeightsApprove = cnProfession.IsWeightsApprove;
|
|
|
|
|
newCnP.UnitId = cnProfession.UnitId;
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据Id删除专业信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
|
public static void DeleteCnProfession(string cnProfessionId)
|
|
|
|
|
{
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
Model.WBS_CnProfession CnP = db.WBS_CnProfession.First(e => e.CnProfessionId == cnProfessionId);
|
|
|
|
|
db.WBS_CnProfession.DeleteOnSubmit(CnP);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取装置下所有专业
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.WBS_CnProfession> GetCnProfessionByInstallation(string ins)
|
|
|
|
|
{
|
|
|
|
|
var list = (from x in Funs.DB.WBS_CnProfession where x.InstallationId == ins orderby x.CnProfessionId select x).ToList();
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取专业下拉选项
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.WBS_CnProfessionInit> GetCnProfessionDropDownList()
|
|
|
|
|
{
|
|
|
|
|
var list = (from x in Funs.DB.WBS_CnProfessionInit orderby x.CnProfessionId select x).ToList();
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取专业下拉选项(不含总图)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.WBS_CnProfessionInit> GetCnProfessionDropDownList2()
|
|
|
|
|
{
|
2022-12-20 09:32:32 +08:00
|
|
|
|
var list = (from x in Funs.DB.WBS_CnProfessionInit where x.CnProfessionId != 23 orderby x.CnProfessionId select x).ToList();
|
2022-03-15 17:36:38 +08:00
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|