20241213 Key Quantity
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class QuantityDesctiptionService
|
||||
{
|
||||
public static Model.Base_QuantityDesctiption GetQuantityDesctiptionById(string keyId)
|
||||
{
|
||||
return Funs.DB.Base_QuantityDesctiption.FirstOrDefault(e => e.KeyId == keyId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加
|
||||
/// </summary>
|
||||
/// <param name="des"></param>
|
||||
public static void AddQuantityDesctiption(Model.Base_QuantityDesctiption des)
|
||||
{
|
||||
Model.Base_QuantityDesctiption newDes = new Model.Base_QuantityDesctiption();
|
||||
newDes.KeyId = des.KeyId;
|
||||
newDes.DepartId = des.DepartId;
|
||||
newDes.DisciplinesWBSId = des.DisciplinesWBSId;
|
||||
newDes.QuantityDesctiption = des.QuantityDesctiption;
|
||||
newDes.PlanMHRsUnit = des.PlanMHRsUnit;
|
||||
Funs.DB.Base_QuantityDesctiption.InsertOnSubmit(newDes);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="des"></param>
|
||||
public static void UpdateQuantityDesctiption(Model.Base_QuantityDesctiption des)
|
||||
{
|
||||
Model.Base_QuantityDesctiption newDes = Funs.DB.Base_QuantityDesctiption.FirstOrDefault(e => e.KeyId == des.KeyId);
|
||||
if (newDes != null)
|
||||
{
|
||||
newDes.DepartId = des.DepartId;
|
||||
newDes.DisciplinesWBSId = des.DisciplinesWBSId;
|
||||
newDes.QuantityDesctiption = des.QuantityDesctiption;
|
||||
newDes.PlanMHRsUnit = des.PlanMHRsUnit;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="keyId"></param>
|
||||
public static void DeleteQuantityDesctiptionById(string keyId)
|
||||
{
|
||||
Model.Base_QuantityDesctiption newDes = Funs.DB.Base_QuantityDesctiption.FirstOrDefault(e => e.KeyId == keyId);
|
||||
if (newDes != null)
|
||||
{
|
||||
Funs.DB.Base_QuantityDesctiption.DeleteOnSubmit(newDes);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证是否存在
|
||||
/// </summary>
|
||||
/// <param name="departId"></param>
|
||||
/// <param name="DisciplinesWBSId"></param>
|
||||
/// <param name="quantityDesctiption"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExitQuantityDesctiption(string departId, string DisciplinesWBSId, string quantityDesctiption, string id)
|
||||
{
|
||||
var q = Funs.DB.Base_QuantityDesctiption.FirstOrDefault(x => x.DepartId == departId && x.DisciplinesWBSId == DisciplinesWBSId && x.QuantityDesctiption == quantityDesctiption && x.KeyId != id);
|
||||
if (q != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user