This commit is contained in:
2025-06-27 14:31:50 +08:00
parent fded5d4485
commit e12e7ed448
13 changed files with 832 additions and 26 deletions
+52
View File
@@ -53,6 +53,43 @@ namespace BLL
}
}
/// <summary>
/// 添加费用类型明细
/// </summary>
/// <param name="costType"></param>
public static void AddCostTypeItem(Model.Base_CostTypeItem costTypeItem)
{
Model.SGGLDB db = Funs.DB;
Model.Base_CostTypeItem newCostType = new Model.Base_CostTypeItem
{
CostTypeItemId= costTypeItem.CostTypeItemId,
CostTypeId = costTypeItem.CostTypeId,
SortIndex = costTypeItem.SortIndex,
CostTypeItemName = costTypeItem.CostTypeItemName,
Remark = costTypeItem.Remark
};
db.Base_CostTypeItem.InsertOnSubmit(newCostType);
db.SubmitChanges();
}
/// <summary>
/// 修改费用类型明细
/// </summary>
/// <param name="costType"></param>
public static void UpdateCostTypeItem(Model.Base_CostTypeItem costTypeItem)
{
Model.SGGLDB db = Funs.DB;
Model.Base_CostTypeItem newCostType = db.Base_CostTypeItem.FirstOrDefault(e => e.CostTypeId == costTypeItem.CostTypeId);
if (newCostType != null)
{
newCostType.CostTypeId = costTypeItem.CostTypeId;
newCostType.SortIndex = costTypeItem.SortIndex;
newCostType.CostTypeItemName = costTypeItem.CostTypeItemName;
newCostType.Remark = costTypeItem.Remark;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除费用类型
/// </summary>
@@ -68,6 +105,21 @@ namespace BLL
}
}
/// <summary>
/// 根据主键删除费用类型
/// </summary>
/// <param name="costTypeId"></param>
public static void DeleteCostTypeItemById(string costTypeItemId)
{
Model.SGGLDB db = Funs.DB;
Model.Base_CostTypeItem costTypeItem = db.Base_CostTypeItem.FirstOrDefault(e => e.CostTypeItemId == costTypeItemId);
if (costTypeItem != null)
{
db.Base_CostTypeItem.DeleteOnSubmit(costTypeItem);
db.SubmitChanges();
}
}
/// <summary>
///
/// </summary>