进度管理增加设备材料分类
This commit is contained in:
@@ -63,6 +63,7 @@ namespace BLL
|
||||
newUP.CostControlName = costControl.CostControlName;
|
||||
newUP.Unit = costControl.Unit;
|
||||
newUP.IsSelected = costControl.IsSelected;
|
||||
newUP.EquipmentMaterialTypeId = costControl.EquipmentMaterialTypeId;
|
||||
newUP.TotalNum = costControl.TotalNum;
|
||||
newUP.RealPrice = costControl.RealPrice;
|
||||
|
||||
@@ -84,6 +85,7 @@ namespace BLL
|
||||
newUP.Unit = costControl.Unit;
|
||||
newUP.TotalNum = costControl.TotalNum;
|
||||
newUP.IsSelected = costControl.IsSelected;
|
||||
newUP.EquipmentMaterialTypeId = costControl.EquipmentMaterialTypeId;
|
||||
newUP.RealPrice = costControl.RealPrice;
|
||||
newUP.PlanPrice = costControl.PlanPrice;
|
||||
newUP.PlanStartDate = costControl.PlanStartDate;
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class EquipmentMaterialTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取实体集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.WBS_EquipmentMaterialType> GetList()
|
||||
{
|
||||
var q = (from x in Funs.DB.WBS_EquipmentMaterialType orderby x.EquipmentMaterialTypeCode select x).ToList();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="?"></param>
|
||||
public static void AddEquipmentMaterialType(Model.WBS_EquipmentMaterialType equipmentMaterialType)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.WBS_EquipmentMaterialType newEquipmentMaterialType = new Model.WBS_EquipmentMaterialType
|
||||
{
|
||||
EquipmentMaterialTypeId = equipmentMaterialType.EquipmentMaterialTypeId,
|
||||
EquipmentMaterialTypeCode = equipmentMaterialType.EquipmentMaterialTypeCode,
|
||||
EquipmentMaterialTypeName = equipmentMaterialType.EquipmentMaterialTypeName,
|
||||
Remark = equipmentMaterialType.Remark
|
||||
};
|
||||
|
||||
db.WBS_EquipmentMaterialType.InsertOnSubmit(newEquipmentMaterialType);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="teamGroup"></param>
|
||||
public static void UpdateEquipmentMaterialType(Model.WBS_EquipmentMaterialType equipmentMaterialType)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.WBS_EquipmentMaterialType newEquipmentMaterialType = db.WBS_EquipmentMaterialType.FirstOrDefault(e => e.EquipmentMaterialTypeId == equipmentMaterialType.EquipmentMaterialTypeId);
|
||||
if (newEquipmentMaterialType != null)
|
||||
{
|
||||
newEquipmentMaterialType.EquipmentMaterialTypeCode = equipmentMaterialType.EquipmentMaterialTypeCode;
|
||||
newEquipmentMaterialType.EquipmentMaterialTypeName = equipmentMaterialType.EquipmentMaterialTypeName;
|
||||
newEquipmentMaterialType.Remark = equipmentMaterialType.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除信息
|
||||
/// </summary>
|
||||
/// <param name="equipmentMaterialTypeId"></param>
|
||||
public static void DeleteEquipmentMaterialTypeById(string equipmentMaterialTypeId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.WBS_EquipmentMaterialType equipmentMaterialType = db.WBS_EquipmentMaterialType.FirstOrDefault(e => e.EquipmentMaterialTypeId == equipmentMaterialTypeId);
|
||||
{
|
||||
db.WBS_EquipmentMaterialType.DeleteOnSubmit(equipmentMaterialType);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static void InitEquipmentMaterialTypeDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetEquipmentMaterialTypeItem();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 设备材料分类下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitEquipmentMaterialType(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Text";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetEquipmentMaterialTypeItem();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取设备材料分类集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetEquipmentMaterialTypeItem()
|
||||
{
|
||||
var q = (from x in Funs.DB.WBS_EquipmentMaterialType orderby x.EquipmentMaterialTypeCode select x).ToList();
|
||||
ListItem[] list = new ListItem[q.Count()];
|
||||
for (int i = 0; i < q.Count(); i++)
|
||||
{
|
||||
list[i] = new ListItem(q[i].EquipmentMaterialTypeName ?? "", q[i].EquipmentMaterialTypeId);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个设备材料分类信息
|
||||
/// </summary>
|
||||
/// <param name="postId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.WBS_EquipmentMaterialType GetEquipmentMaterialType(string EquipmentMaterialTypeId)
|
||||
{
|
||||
return Funs.DB.WBS_EquipmentMaterialType.FirstOrDefault(e => e.EquipmentMaterialTypeId == EquipmentMaterialTypeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user