163 lines
6.0 KiB
C#
163 lines
6.0 KiB
C#
using Model;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace BLL
|
|
{
|
|
public static class Base_DNCompareService
|
|
{
|
|
/// <summary>
|
|
///获取直径寸径对照信息
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static Model.Base_DNCompare GetDNCompareByDNCompareId(string dNCompareId)
|
|
{
|
|
return Funs.DB.Base_DNCompare.FirstOrDefault(e => e.DNCompareId == dNCompareId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 增加直径寸径对照信息
|
|
/// </summary>
|
|
/// <param name="dNCompare"></param>
|
|
public static void AddDNCompare(Model.Base_DNCompare dNCompare)
|
|
{
|
|
Model.HJGLDB db = Funs.DB;
|
|
Model.Base_DNCompare newDNCompare = new Base_DNCompare
|
|
{
|
|
DNCompareId = dNCompare.DNCompareId,
|
|
|
|
PipeSize = dNCompare.PipeSize,
|
|
OutSizeDia = dNCompare.OutSizeDia,
|
|
DN = dNCompare.DN,
|
|
OutSize_FB = dNCompare.OutSize_FB,
|
|
DN_FB = dNCompare.DN_FB,
|
|
SCH_FB = dNCompare.SCH_FB,
|
|
|
|
SCH5 =dNCompare.SCH5,
|
|
SCH5S=dNCompare.SCH5S,
|
|
SCH10 = dNCompare.SCH10,
|
|
SCH10S=dNCompare.SCH10S,
|
|
SCH20 = dNCompare.SCH20,
|
|
SCH30 = dNCompare.SCH30,
|
|
SCH40 = dNCompare.SCH40,
|
|
SCH40S=dNCompare.SCH40S,
|
|
STD = dNCompare.STD,
|
|
SCH60 = dNCompare.SCH60,
|
|
SCH80 = dNCompare.SCH80,
|
|
SCH80S=dNCompare.SCH80S,
|
|
XS = dNCompare.XS,
|
|
SCH100 = dNCompare.SCH100,
|
|
SCH120 = dNCompare.SCH120,
|
|
SCH140 = dNCompare.SCH140,
|
|
SCH160 = dNCompare.SCH160,
|
|
XXS = dNCompare.XXS
|
|
};
|
|
|
|
db.Base_DNCompare.InsertOnSubmit(newDNCompare);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改直径寸径对照信息
|
|
/// </summary>
|
|
/// <param name="dNCompare"></param>
|
|
public static void UpdateDNCompare(Model.Base_DNCompare dNCompare)
|
|
{
|
|
Model.HJGLDB db = Funs.DB;
|
|
Model.Base_DNCompare newDNCompare = db.Base_DNCompare.FirstOrDefault(e => e.DNCompareId == dNCompare.DNCompareId);
|
|
if (newDNCompare != null)
|
|
{
|
|
newDNCompare.PipeSize = dNCompare.PipeSize;
|
|
newDNCompare.OutSizeDia = dNCompare.OutSizeDia;
|
|
newDNCompare.DN = dNCompare.DN;
|
|
|
|
newDNCompare.OutSize_FB = dNCompare.OutSize_FB;
|
|
newDNCompare.DN_FB = dNCompare.DN_FB;
|
|
newDNCompare.SCH_FB = dNCompare.SCH_FB;
|
|
|
|
newDNCompare.SCH5 = dNCompare.SCH5;
|
|
newDNCompare.SCH5S = dNCompare.SCH5S;
|
|
newDNCompare.SCH10 = dNCompare.SCH10;
|
|
newDNCompare.SCH10S = dNCompare.SCH10S;
|
|
newDNCompare.SCH20 = dNCompare.SCH20;
|
|
newDNCompare.SCH30 = dNCompare.SCH30;
|
|
newDNCompare.SCH40 = dNCompare.SCH40;
|
|
newDNCompare.SCH40S = dNCompare.SCH40S;
|
|
newDNCompare.STD = dNCompare.STD;
|
|
newDNCompare.SCH60 = dNCompare.SCH60;
|
|
newDNCompare.SCH80 = dNCompare.SCH80;
|
|
newDNCompare.SCH80S = dNCompare.SCH80S;
|
|
newDNCompare.XS = dNCompare.XS;
|
|
newDNCompare.SCH100 = dNCompare.SCH100;
|
|
newDNCompare.SCH120 = dNCompare.SCH120;
|
|
newDNCompare.SCH140 = dNCompare.SCH140;
|
|
newDNCompare.SCH160 = dNCompare.SCH160;
|
|
newDNCompare.XXS = dNCompare.XXS;
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据直径寸径对照Id删除一个直径寸径对照信息
|
|
/// </summary>
|
|
/// <param name="dNCompareId"></param>
|
|
public static void DeleteDNCompareByDNCompareId(string dNCompareId)
|
|
{
|
|
Model.HJGLDB db = Funs.DB;
|
|
Model.Base_DNCompare delDNCompare = db.Base_DNCompare.FirstOrDefault(e => e.DNCompareId == dNCompareId);
|
|
if (delDNCompare != null)
|
|
{
|
|
db.Base_DNCompare.DeleteOnSubmit(delDNCompare);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
#region 直径寸径对照下拉项
|
|
|
|
public static ListItem[] GetDNCompareList()
|
|
{
|
|
ListItem[] list = new ListItem[19];
|
|
list[0] = new ListItem("5", "5");
|
|
list[1] = new ListItem("5S", "5S");
|
|
list[2] = new ListItem("10", "10");
|
|
list[3] = new ListItem("10S", "10S");
|
|
list[4] = new ListItem("20", "20");
|
|
list[5] = new ListItem("30", "30");
|
|
list[6] = new ListItem("40", "40");
|
|
list[7] = new ListItem("40S", "40S");
|
|
list[8] = new ListItem("STD", "STD");
|
|
list[9] = new ListItem("60", "60");
|
|
list[10] = new ListItem("80", "80");
|
|
list[11] = new ListItem("80S", "80S");
|
|
list[12] = new ListItem("XS", "XS");
|
|
list[13] = new ListItem("100", "100");
|
|
list[14] = new ListItem("120", "120");
|
|
list[15] = new ListItem("140", "140");
|
|
list[16] = new ListItem("160", "160");
|
|
list[17] = new ListItem("XXS", "XXS");
|
|
list[18] = new ListItem("FB", "FB");
|
|
|
|
return list;
|
|
}
|
|
/// <summary>
|
|
/// 直径寸径对照下拉项
|
|
/// </summary>
|
|
/// <param name="dropName">下拉框名称</param>
|
|
/// <param name="isShowPlease">是否显示请选择</param>
|
|
public static void InitDNCompareDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
|
{
|
|
dropName.DataValueField = "Text";
|
|
dropName.DataTextField = "Value";
|
|
dropName.DataSource = GetDNCompareList();
|
|
dropName.DataBind();
|
|
if (isShowPlease)
|
|
{
|
|
Funs.FineUIPleaseSelect(dropName);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|