1
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user