Before Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 247 KiB |
Before Width: | Height: | Size: 427 KiB |
Before Width: | Height: | Size: 1.8 MiB |
@ -1,352 +0,0 @@ |
|||||
{ |
|
||||
"Version":"6.6.0.2", |
|
||||
"SharePrintSetupOptions":"[SelectedPrinter]", |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":105000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Printer":{ |
|
||||
"Size":256, |
|
||||
"Width":8.8, |
|
||||
"Height":10, |
|
||||
"Oriention":"Landscape", |
|
||||
"LeftMargin":0, |
|
||||
"TopMargin":0, |
|
||||
"RightMargin":0, |
|
||||
"BottomMargin":0 |
|
||||
}, |
|
||||
"Parameter":[ |
|
||||
{ |
|
||||
"Name":"BarCode" |
|
||||
}, |
|
||||
{ |
|
||||
"Name":"BatchNo" |
|
||||
}, |
|
||||
{ |
|
||||
"Name":"Qty" |
|
||||
} |
|
||||
], |
|
||||
"ReportHeader":[ |
|
||||
{ |
|
||||
"Name":"ReportHeader1", |
|
||||
"Height":8.99583, |
|
||||
"Control":[ |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line1", |
|
||||
"Left":0.211667, |
|
||||
"Top":0.132292, |
|
||||
"Height":8.78417 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line2", |
|
||||
"Left":9.78958, |
|
||||
"Top":0.13, |
|
||||
"Height":8.78 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line3", |
|
||||
"Left":2.19604, |
|
||||
"Top":0.13, |
|
||||
"Height":8.78 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line4", |
|
||||
"Left":0.211667, |
|
||||
"Top":0.132292, |
|
||||
"Width":9.57792 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line5", |
|
||||
"Left":0.211667, |
|
||||
"Top":8.89, |
|
||||
"Width":9.57792 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line6", |
|
||||
"Left":0.211667, |
|
||||
"Top":1.32292, |
|
||||
"Width":9.57792 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line7", |
|
||||
"Left":0.211667, |
|
||||
"Top":2.96333, |
|
||||
"Width":9.57792 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line8", |
|
||||
"Left":0.211667, |
|
||||
"Top":4.28625, |
|
||||
"Width":9.57792 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox1", |
|
||||
"Left":0.396875, |
|
||||
"Top":0.291042, |
|
||||
"Width":1.61396, |
|
||||
"Height":0.79375, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"TextAlign":"MiddleCenter", |
|
||||
"Text":"包装单号" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"MemoBox", |
|
||||
"Name":"MemoBox1", |
|
||||
"Left":2.32833, |
|
||||
"Top":0.291042, |
|
||||
"Width":7.3025, |
|
||||
"Height":0.79375, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":105000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"[#{BarCode}#]" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox2", |
|
||||
"Left":0.396875, |
|
||||
"Top":1.56104, |
|
||||
"Width":1.61396, |
|
||||
"Height":1.05833, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"TextAlign":"MiddleCenter", |
|
||||
"Text":"物料描述" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox3", |
|
||||
"Left":2.40771, |
|
||||
"Top":1.56104, |
|
||||
"Width":6.985, |
|
||||
"Height":1.00542, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":105000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"V214行李槽总成" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox4", |
|
||||
"Left":0.396875, |
|
||||
"Top":3.14854, |
|
||||
"Width":1.61396, |
|
||||
"Height":0.79375, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"TextAlign":"MiddleCenter", |
|
||||
"Text":"客户物料" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line9", |
|
||||
"Left":0.211667, |
|
||||
"Top":5.44917, |
|
||||
"Width":5.58271, |
|
||||
"Height":0.00125 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox5", |
|
||||
"Left":0.396875, |
|
||||
"Top":4.445, |
|
||||
"Width":1.61396, |
|
||||
"Height":0.79375, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"TextAlign":"MiddleCenter", |
|
||||
"Text":"物料号" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox6", |
|
||||
"Left":2.35479, |
|
||||
"Top":4.445, |
|
||||
"Width":3.43958, |
|
||||
"Height":0.978958, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":142500, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"A2146103301" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox7", |
|
||||
"Left":0.396875, |
|
||||
"Top":5.66208, |
|
||||
"Width":1.61396, |
|
||||
"Height":0.79375, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"TextAlign":"MiddleCenter", |
|
||||
"Text":"批次" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line10", |
|
||||
"Left":0.211667, |
|
||||
"Top":6.58813, |
|
||||
"Width":5.58 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox8", |
|
||||
"Left":0.396875, |
|
||||
"Top":6.85271, |
|
||||
"Width":1.61396, |
|
||||
"Height":0.820208, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"TextAlign":"MiddleCenter", |
|
||||
"Text":"包装数量" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line11", |
|
||||
"Left":0.211667, |
|
||||
"Top":7.80521, |
|
||||
"Width":5.58 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox9", |
|
||||
"Left":0.396875, |
|
||||
"Top":7.99042, |
|
||||
"Width":1.61396, |
|
||||
"Height":0.79375, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"TextAlign":"MiddleCenter", |
|
||||
"Text":"生产线" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Line", |
|
||||
"Name":"Line12", |
|
||||
"Left":5.79438, |
|
||||
"Top":4.29, |
|
||||
"Height":4.60001 |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Barcode", |
|
||||
"Name":"Barcode1", |
|
||||
"Left":5.90021, |
|
||||
"Top":4.78896, |
|
||||
"Width":3.81, |
|
||||
"Height":3.7, |
|
||||
"BarcodeType":"QRCode", |
|
||||
"CaptionPosition":"None", |
|
||||
"Text":"[#{BarCode}#]" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"MemoBox", |
|
||||
"Name":"MemoBox2", |
|
||||
"Left":2.32833, |
|
||||
"Top":5.60917, |
|
||||
"Width":3.20146, |
|
||||
"Height":0.978958, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":142500, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"[#{BatchNo}#]" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"MemoBox", |
|
||||
"Name":"MemoBox3", |
|
||||
"Left":2.30188, |
|
||||
"Top":6.77333, |
|
||||
"Width":1.69333, |
|
||||
"Height":1.00542, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":142500, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"[#{Qty}#]" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"MemoBox", |
|
||||
"Name":"MemoBox4", |
|
||||
"Left":4.20688, |
|
||||
"Top":6.79979, |
|
||||
"Width":1.40229, |
|
||||
"Height":1.00542, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":142500, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"EA" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox10", |
|
||||
"Left":2.32833, |
|
||||
"Top":7.96396, |
|
||||
"Width":3.33375, |
|
||||
"Height":0.767292, |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":105000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"3200T-2(天兴)" |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
] |
|
||||
} |
|
@ -1,44 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<configuration> |
|
||||
<connectionStrings> |
|
||||
<add name="SqlConnString" connectionString="Persist Security Info=true;Initial Catalog=BBMPT1;Data Source=10.60.101.60;User ID=sa;Password=a1+"/> |
|
||||
<add name="report" connectionString="Provider=SQLOLEDB.1;Password=a1+;Persist Security Info=True;User ID=sa;Initial Catalog=BBMPT1;Data Source=10.60.101.60;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=PC201904081405E;Use Encryption for Data=False;Tag with column collation when possible=False"/> |
|
||||
<add name="BBMPTEntities" connectionString="metadata=res://*/EFModel.BBMPT.csdl|res://*/EFModel.BBMPT.ssdl|res://*/EFModel.BBMPT.msl;provider=System.Data.SqlClient;provider connection string="data source=10.60.101.60;initial catalog=BBMPT1;user id=sa;password=a1+;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" /> |
|
||||
</connectionStrings> |
|
||||
<appSettings> |
|
||||
|
|
||||
<add key="Station" value="IM17"/> |
|
||||
<add key="StationMode" value="1"/> |
|
||||
<add key="InterVal" value="5000"/> |
|
||||
<!--<add key="PictureFolder" value="pdf"/> |
|
||||
<add key="PictureUser" value="Administrator"/> |
|
||||
<add key="PicturePsw" value="Messystem!@#1"/>--> |
|
||||
<add key="RemoteIP" value="10.60.101.10"/> |
|
||||
<add key="PicturePath" value="http://10.60.101.59:8001/PDF/"/> |
|
||||
<add key="ClientSettingsProvider.ServiceUri" value=""/> |
|
||||
<add key="Printer1" value="Microsoft XPS Document Writer"/> |
|
||||
<add key="Printer2" value="Microsoft XPS Document Writer"/> |
|
||||
<add key="Printer3" value="Microsoft XPS Document Writer"/> |
|
||||
<add key="Printer4" value="Microsoft XPS Document Writer"/> |
|
||||
<add key="PrinterName" value="Microsoft XPS Document Writer"/> |
|
||||
<add key="PrinterName1" value="Microsoft XPS Document Writer"/> |
|
||||
<add key="tableName" value="tb_BarCode5"/> |
|
||||
<add key="LineID" value="2207"/> |
|
||||
<add key="Mode" value="2"/> |
|
||||
<add key="PortName" value="COM3"/> |
|
||||
<add key="IsLast" value="0"/> |
|
||||
<add key="InterVal2" value="500000"/> |
|
||||
</appSettings> |
|
||||
<system.web> |
|
||||
<membership defaultProvider="ClientAuthenticationMembershipProvider"> |
|
||||
<providers> |
|
||||
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/> |
|
||||
</providers> |
|
||||
</membership> |
|
||||
<roleManager defaultProvider="ClientRoleProvider" enabled="true"> |
|
||||
<providers> |
|
||||
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/> |
|
||||
</providers> |
|
||||
</roleManager> |
|
||||
</system.web> |
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> |
|
@ -1,11 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> |
|
||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> |
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> |
|
||||
<security> |
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> |
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/> |
|
||||
</requestedPrivileges> |
|
||||
</security> |
|
||||
</trustInfo> |
|
||||
</assembly> |
|
@ -1,135 +0,0 @@ |
|||||
{ |
|
||||
"Version":"6.6.2.0", |
|
||||
"SharePrintSetupOptions":"[PaperOrientation]", |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":105000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Printer":{ |
|
||||
"Size":256, |
|
||||
"Width":5, |
|
||||
"Height":4, |
|
||||
"LeftMargin":0, |
|
||||
"TopMargin":0, |
|
||||
"RightMargin":0, |
|
||||
"BottomMargin":0 |
|
||||
}, |
|
||||
"Parameter":[ |
|
||||
{ |
|
||||
"Name":"PrintTime" |
|
||||
}, |
|
||||
{ |
|
||||
"Name":"PartNo" |
|
||||
}, |
|
||||
{ |
|
||||
"Name":"PartName" |
|
||||
}, |
|
||||
{ |
|
||||
"Name":"OneBarCode" |
|
||||
}, |
|
||||
{ |
|
||||
"Name":"BarCode" |
|
||||
}, |
|
||||
{ |
|
||||
"Name":"Station" |
|
||||
} |
|
||||
], |
|
||||
"ReportHeader":[ |
|
||||
{ |
|
||||
"Name":"ReportHeader1", |
|
||||
"Height":3.81, |
|
||||
"Control":[ |
|
||||
{ |
|
||||
"Type":"MemoBox", |
|
||||
"Name":"MemoBox1", |
|
||||
"Left":0.58, |
|
||||
"Top":0.211667, |
|
||||
"Width":2.78, |
|
||||
"Height":0.4, |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":52500, |
|
||||
"Bold":true, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"[#PrintTime#]" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"MemoBox", |
|
||||
"Name":"MemoBox2", |
|
||||
"Left":0.58, |
|
||||
"Top":1.00542, |
|
||||
"Width":1.59, |
|
||||
"Height":0.4, |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":52500, |
|
||||
"Bold":true, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"[#{PartNo}#]" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"MemoBox", |
|
||||
"Name":"MemoBox3", |
|
||||
"Left":0.582083, |
|
||||
"Top":1.40229, |
|
||||
"Width":2.2225, |
|
||||
"Height":0.396875, |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":52500, |
|
||||
"Bold":true, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"WordWrap":true, |
|
||||
"Text":"[#{PartName}#]" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Barcode", |
|
||||
"Name":"Barcode1", |
|
||||
"Left":0.58, |
|
||||
"Top":2.67229, |
|
||||
"Width":4.2, |
|
||||
"Height":1.00542, |
|
||||
"BarcodeType":"Code128Auto", |
|
||||
"Text":"[#{OneBarCode}#]", |
|
||||
"Font":{ |
|
||||
"Name":"微软雅黑", |
|
||||
"Size":67500, |
|
||||
"Bold":true, |
|
||||
"Charset":134 |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Barcode", |
|
||||
"Name":"Barcode2", |
|
||||
"Left":2.93688, |
|
||||
"Top":0.687917, |
|
||||
"Width":1.8, |
|
||||
"Height":1.8, |
|
||||
"BarcodeType":"QRCode", |
|
||||
"CaptionPosition":"None", |
|
||||
"Text":"[#{OneBarCode}#]" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"MemoBox", |
|
||||
"Name":"MemoBox4", |
|
||||
"Left":0.608542, |
|
||||
"Top":0.608542, |
|
||||
"Width":1.5875, |
|
||||
"Height":0.396875, |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":52500, |
|
||||
"Bold":true, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"[#{Station}#]" |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
] |
|
||||
} |
|
@ -1,9 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<configuration> |
|
||||
<startup> |
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> |
|
||||
</startup> |
|
||||
<appSettings> |
|
||||
<add key="DefaultArgs" value ="'http://10.60.101.59:8013/','InjectionPC.exe','1.0.0.0','InjectionUpdate','1.0.0.0.zip','2016-03-15','初始版本'"/> |
|
||||
</appSettings> |
|
||||
</configuration> |
|
Before Width: | Height: | Size: 68 KiB |
@ -1,18 +0,0 @@ |
|||||
e IMG;* |
|
||||
; LABEL -> = C:\Users\SIEMENS\Desktop\test.stc |
|
||||
; CREATED: 2023/2/27 15:52:40, Driver version: 1.0.7.3, Target model: HERMES Q4R/300-2 |
|
||||
l ZH |
|
||||
m m |
|
||||
zO |
|
||||
J |
|
||||
j 3172168412706050 |
|
||||
S l1;0,0,36.2,36.2,45 |
|
||||
H 100,0,T,R0,B0 |
|
||||
O R,D,A1=270 |
|
||||
P |
|
||||
T:Pdate;3.69,4.34,0,3,2.89,k;{0} |
|
||||
T:MNumber;34.38,4.13,0,3,2.69,k;{1} |
|
||||
T:BPNumber;3.45,7.46,0,3,2.57,k;{2} |
|
||||
B:Barcode;4.67,7.84,0,CODE128,8.47,0.25;{4} |
|
||||
T:PartName;24.41,7.07,0,3,2.61,k;{3} |
|
||||
A 1 |
|
@ -1,18 +0,0 @@ |
|||||
e IMG;* |
|
||||
; LABEL -> = C:\Users\SIEMENS\Desktop\test.stc |
|
||||
; CREATED: 2023/2/27 15:52:40, Driver version: 1.0.7.3, Target model: HERMES Q4R/300-2 |
|
||||
l ZH |
|
||||
m m |
|
||||
zO |
|
||||
J |
|
||||
j 3172168412706050 |
|
||||
S l1;0,0,36.2,36.2,45 |
|
||||
H 100,0,T,R0,B0 |
|
||||
O R,D,A1=270 |
|
||||
P |
|
||||
T:Pdate;3.69,4.34,0,3,2.89,k;2021/12/29 19:20:30 |
|
||||
T:MNumber;34.38,4.13,0,3,2.69,k;IM17 |
|
||||
T:BPNumber;3.45,7.46,0,3,2.57,k;A2146106203KZ |
|
||||
B:Barcode;4.67,7.84,0,CODE128,8.47,0.25;60000001162112290001 |
|
||||
T:PartName;24.41,7.07,0,3,2.61,k;TrunnBox行李箱 |
|
||||
A 1 |
|
@ -1,45 +0,0 @@ |
|||||
m m |
|
||||
zO |
|
||||
J |
|
||||
j 3172421814000606 |
|
||||
S l1;0,0,18,21,50 |
|
||||
H 100,0,T,R0,B0 |
|
||||
O R,D,A1=270 |
|
||||
P |
|
||||
T:Pdate;0,4.34,0,3,2.89,k;{0} |
|
||||
B:Barcode;4.67,8,0,CODE128,8.47,0.25;{1} |
|
||||
T:MNumber;34.38,4.13,0,3,2.69,k;{2} |
|
||||
T:PartName;24.41,7.07,0,3,2.61,k;{3} |
|
||||
T:BPNumber;0,7.46,0,3,2.57,k;{4} |
|
||||
A 1 |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
注塑大码 78,admin 123 |
|
||||
质检 80 Sk 123 |
|
||||
打螺钉 74 administrator 123 |
|
||||
|
|
||||
|
|
||||
|
|
||||
2022-09-21无法下载回单 |
|
||||
|
|
||||
|
|
||||
|
|
||||
印度件 |
|
||||
|
|
||||
打印的判断是否选择的是印度件,印度件是另一个模板 |
|
||||
|
|
||||
22000000992311040709 |
|
||||
|
|
||||
|
|
||||
60000001762311090068 |
|
||||
|
|
||||
|
|
||||
用一码到底的程序 4种配置 |
|
||||
根据零件号判断是否带摄像头 摄像头配置也不一样 |
|
||||
下计划、有摄像头的需要扫描摄像头条码做核对,打印条码。切计划时亮摄像头 2个灯。 |
|
||||
|
|
||||
|
|
||||
https://blog.csdn.net/weixin_44964841/article/details/123784351?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-123784351-blog-132689731.235%5Ev38%5Epc_relevant_anti_t3_base&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-123784351-blog-132689731.235%5Ev38%5Epc_relevant_anti_t3_base&utm_relevant_index=1 |
|
||||
|
|
@ -1,121 +0,0 @@ |
|||||
{ |
|
||||
"Version":"6.6.2.0", |
|
||||
"SharePrintSetupOptions":"[PaperOrientation]", |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":105000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Printer":{ |
|
||||
"Size":256, |
|
||||
"Width":5, |
|
||||
"Height":4, |
|
||||
"LeftMargin":0, |
|
||||
"TopMargin":0, |
|
||||
"RightMargin":0, |
|
||||
"BottomMargin":0 |
|
||||
}, |
|
||||
"Parameter":[ |
|
||||
{ |
|
||||
"Name":"barCode" |
|
||||
} |
|
||||
], |
|
||||
"ReportHeader":[ |
|
||||
{ |
|
||||
"Name":"ReportHeader1", |
|
||||
"Height":3.99521, |
|
||||
"Control":[ |
|
||||
{ |
|
||||
"Type":"Barcode", |
|
||||
"Name":"Barcode1", |
|
||||
"Left":0.582083, |
|
||||
"Top":0.105833, |
|
||||
"Width":1.5, |
|
||||
"Height":1.5, |
|
||||
"BarcodeType":"QRCode", |
|
||||
"CaptionPosition":"None", |
|
||||
"Text":"[#{barCode}#]" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox1", |
|
||||
"Left":2.40771, |
|
||||
"Top":0.079375, |
|
||||
"Width":1.98438, |
|
||||
"Height":0.608542, |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"A2146103301" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox2", |
|
||||
"Left":2.35479, |
|
||||
"Top":1.03188, |
|
||||
"Width":0.608542, |
|
||||
"Height":0.396875, |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"TextAlign":"TopLeft", |
|
||||
"Text":"Q01" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox3", |
|
||||
"Left":3.14854, |
|
||||
"Top":1.03188, |
|
||||
"Width":1.21708, |
|
||||
"Height":0.608542, |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"TextAlign":"TopLeft", |
|
||||
"Text":"ZGS007" |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"Barcode", |
|
||||
"Name":"Barcode2", |
|
||||
"Left":0.211667, |
|
||||
"Top":2.01083, |
|
||||
"Width":4.57729, |
|
||||
"Height":1.40229, |
|
||||
"BarcodeType":"Code128Auto", |
|
||||
"Text":"[#{barCode}#]", |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":67500, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
"Type":"StaticBox", |
|
||||
"Name":"StaticBox4", |
|
||||
"Left":2.98979, |
|
||||
"Top":3.46604, |
|
||||
"Width":1.79917, |
|
||||
"Height":0.396875, |
|
||||
"Font":{ |
|
||||
"Name":"宋体", |
|
||||
"Size":90000, |
|
||||
"Weight":400, |
|
||||
"Charset":134 |
|
||||
}, |
|
||||
"Text":"有效期12周" |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
] |
|
||||
} |
|
@ -1 +0,0 @@ |
|||||
<%@ WebHandler Language="C#" CodeBehind="ForeignColorMapHandler.ashx.cs" Class="MESWebSite.HttpHandlers.StationHandler" %> |
|
@ -1,151 +0,0 @@ |
|||||
using MESClassLibrary.BLL.BasicInfo; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Web; |
|
||||
|
|
||||
namespace MESWebSite.HttpHandlers |
|
||||
{ |
|
||||
/// <summary>
|
|
||||
/// StationHandler 的摘要说明
|
|
||||
/// </summary>
|
|
||||
public class ForeignColorMapHandler : IHttpHandler |
|
||||
{ |
|
||||
|
|
||||
HttpRequest Request = null; |
|
||||
HttpResponse Response = null; |
|
||||
|
|
||||
public void ProcessRequest(HttpContext context) |
|
||||
{ |
|
||||
context.Response.ContentType = "text/plain"; |
|
||||
Request = context.Request; |
|
||||
Response = context.Response; |
|
||||
|
|
||||
string method = Request.Params["method"]; |
|
||||
switch (method) |
|
||||
{ |
|
||||
|
|
||||
case "QueryList": |
|
||||
QueryList(); |
|
||||
break; |
|
||||
case "SaveInfo": |
|
||||
SaveInfo(); |
|
||||
break; |
|
||||
case "DelInfo": |
|
||||
DelInfo(); |
|
||||
break; |
|
||||
case "QueryForCombobox": |
|
||||
QueryForCombobox(); |
|
||||
break; |
|
||||
case "QueryForComboboxByLineID": |
|
||||
QueryForComboboxByLineID(); |
|
||||
break; |
|
||||
default: |
|
||||
break; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
public bool IsReusable |
|
||||
{ |
|
||||
get |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
void QueryList() |
|
||||
{ |
|
||||
string page = Request.Params["page"]; |
|
||||
string pagesize = Request.Params["rows"]; |
|
||||
string PartCode = Request.Params["PartCode"]; |
|
||||
string TypeCode = Request.Params["TypeCode"]; |
|
||||
|
|
||||
|
|
||||
if (string.IsNullOrEmpty(page)) |
|
||||
{ |
|
||||
page = "0"; |
|
||||
} |
|
||||
if (string.IsNullOrEmpty(pagesize)) |
|
||||
{ |
|
||||
pagesize = "15"; |
|
||||
} |
|
||||
StationBLL bll = new StationBLL(); |
|
||||
//Response.Write(bll.SearchInfo(page, pagesize, StationNo, LineID));
|
|
||||
//Response.End();
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
void SaveInfo() |
|
||||
{ |
|
||||
string StationID = Request.Params["StationID"]; |
|
||||
string LineID = Request.Params["LineID"]; |
|
||||
string StationNo = Request.Params["StationNo"]; |
|
||||
string Des = Request.Params["Des"]; |
|
||||
string time = Request.Params["time"]; |
|
||||
|
|
||||
StationBLL bll = new StationBLL(); |
|
||||
tb_Station md = new tb_Station(); |
|
||||
|
|
||||
md.LineID = LineID; |
|
||||
md.StationNo = StationNo; |
|
||||
md.Des = Des; |
|
||||
md.ChangeMould = Convert.ToInt32(time); |
|
||||
var info = Request.Cookies.Get("LoginUserInfo"); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
md.UserID = info["UserID"].ToUpper(); |
|
||||
} |
|
||||
if (StationID == "0") |
|
||||
{ |
|
||||
//新增
|
|
||||
md.StationID = Guid.NewGuid().ToString(); |
|
||||
Response.Write(bll.AddInfo(md) == true ? "true" : "false"); |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
//修改
|
|
||||
md.StationID = StationID; |
|
||||
Response.Write(bll.UpdateInfo(md) == true ? "true" : "false"); |
|
||||
} |
|
||||
Response.End(); |
|
||||
} |
|
||||
void DelInfo() |
|
||||
{ |
|
||||
string StationID = Request.Params["StationID"]; |
|
||||
|
|
||||
StationBLL bll = new StationBLL(); |
|
||||
tb_Station md = new tb_Station(); |
|
||||
md.StationID = StationID; |
|
||||
var info = Request.Cookies.Get("LoginUserInfo"); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
md.UserID = info["UserID"].ToUpper(); |
|
||||
} |
|
||||
Response.Write(bll.DelInfo(md) == true ? "true" : "false"); |
|
||||
Response.End(); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
void QueryForCombobox() |
|
||||
{ |
|
||||
string StationNo = Request.Params["StationNo"]; |
|
||||
|
|
||||
StationBLL bll = new StationBLL(); |
|
||||
Response.Write(bll.GetComboboxData(StationNo)); |
|
||||
Response.End(); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
void QueryForComboboxByLineID() |
|
||||
{ |
|
||||
string LineID = "68dd1857-5e78-43f9-a065-6be76335e7fe"; |
|
||||
|
|
||||
StationBLL bll = new StationBLL(); |
|
||||
Response.Write(bll.GetComboboxDataByLine(LineID)); |
|
||||
Response.End(); |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,399 +0,0 @@ |
|||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ForeignColorMap.aspx.cs" Inherits="MESWebSite.Manage.ForeignColorMap" %> |
|
||||
|
|
||||
|
|
||||
<!DOCTYPE html> |
|
||||
|
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
||||
<head runat="server"> |
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|
||||
<link href="/CSS/Basics.css" rel="stylesheet" /> |
|
||||
<link href="/Scripts/jquery-easyui-1.4.3/themes/metro/easyui.css" rel="stylesheet" type="text/css" /> |
|
||||
<link href="/Scripts/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" type="text/css" /> |
|
||||
<link href="/Scripts/jquery-easyui-1.4.3/themes/color.css" rel="stylesheet" type="text/css" /> |
|
||||
<script src="/Scripts/jquery-easyui-1.4.3/jquery.min.js" type="text/javascript"></script> |
|
||||
<script src="/Scripts/jquery-easyui-1.4.3/jquery.easyui.min.js" type="text/javascript"></script> |
|
||||
<script src="/Scripts/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js" type="text/javascript"></script> |
|
||||
<script src="/Scripts/MyJs.js" type="text/javascript"></script> |
|
||||
<style> |
|
||||
#w td { |
|
||||
padding: 5px 5px; |
|
||||
text-align: left; |
|
||||
vertical-align: middle; |
|
||||
} |
|
||||
|
|
||||
#w .title { |
|
||||
vertical-align: middle; |
|
||||
text-align: right; |
|
||||
width: 80px; |
|
||||
height: 40px; |
|
||||
} |
|
||||
|
|
||||
p { |
|
||||
padding: 5px; |
|
||||
font-size: small; |
|
||||
font-family: 微软雅黑; |
|
||||
} |
|
||||
|
|
||||
.datagrid { |
|
||||
text-align: center; |
|
||||
} |
|
||||
|
|
||||
.search_first{ |
|
||||
margin-left: 29% |
|
||||
} |
|
||||
|
|
||||
/* 中等屏幕 桌面显示器 992至1400 */ |
|
||||
@media screen and (min-width:992px) and (max-width:1400px){ |
|
||||
.search_first{ |
|
||||
margin-left: 1% |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
</style> |
|
||||
<title>工位信息</title> |
|
||||
</head> |
|
||||
<body> |
|
||||
<form id="form1" runat="server"> |
|
||||
<div class="top"> |
|
||||
<table style="width: 110%"> |
|
||||
<tr style="display: flex;flex-direction: row; flex-wrap: wrap;" > |
|
||||
|
|
||||
<td><span class="title" style="width: 100px">工位信息</span> |
|
||||
</td> |
|
||||
<td style="width: 235px;"></td> |
|
||||
<td style="width: 235px;">程序号: |
|
||||
<%-- <select id="fl_id_s" class="easyui-combobox" style="width: 160px; height: 30px;" |
|
||||
data-options="valueField: 'TypeCode',textField: 'LineName'"> |
|
||||
</select>--%> |
|
||||
<input type="text" id="fl_id_s" style="width: 140px;" /> |
|
||||
|
|
||||
</td> |
|
||||
<td style="width: 235px;">零件号: |
|
||||
<input type="text" id="PartCode_s" style="width: 140px;" /></td> |
|
||||
<td style="width: "></td> |
|
||||
<td> |
|
||||
<td style="width: 80px" ><a class="topsearchBtn">查询</a></td> |
|
||||
<td style="width: 80px"> |
|
||||
<a class="topaddBtn">新增</a> |
|
||||
</td> |
|
||||
<td style="width: 80px"> |
|
||||
<a class="toppenBtn">编辑</a> |
|
||||
</td> |
|
||||
<td style="width: 80px"> |
|
||||
<a class="topdelBtn">删除</a> |
|
||||
</td> |
|
||||
</td> |
|
||||
</tr> |
|
||||
</table> |
|
||||
</div> |
|
||||
<table id="tb" title="工位信息" style="width: 99%;"> |
|
||||
</table> |
|
||||
<!-- 编辑窗口 --> |
|
||||
<div id="w" style="padding: 10px; visibility: hidden" title="编辑"> |
|
||||
<table> |
|
||||
<tr> |
|
||||
<td class="title" style="width: 110px;"> |
|
||||
<p> |
|
||||
程序号: |
|
||||
</p> |
|
||||
</td> |
|
||||
<td colspan="2"> |
|
||||
<select id="fl_id" class="easyui-combobox" style="width: 234px; height: 36px;" |
|
||||
data-options="valueField: 'TypeCode',textField: 'LineName'"> |
|
||||
</select><span style="color: red; font-size: 18px; vertical-align: middle;">*</span> |
|
||||
</td> |
|
||||
</tr> |
|
||||
<tr> |
|
||||
<td class="title" style="width: 110px;"> |
|
||||
<p> |
|
||||
零件号: |
|
||||
</p> |
|
||||
</td> |
|
||||
<td colspan="2"> |
|
||||
<input id="PartCode" type="text" class="text" style="width: 230px; height: 30px;" /> |
|
||||
</td> |
|
||||
</tr> |
|
||||
<tr> |
|
||||
<td class="title" style="width: 110px;"> |
|
||||
<p> |
|
||||
零件名称: |
|
||||
</p> |
|
||||
</td> |
|
||||
<td colspan="2"> |
|
||||
<input id="PartName" type="text" class="text" style="width: 230px; height: 30px;" /> |
|
||||
</td> |
|
||||
</tr> |
|
||||
<tr> |
|
||||
<td class="title" style="width: 110px;"> |
|
||||
<p> |
|
||||
颜色: |
|
||||
</p> |
|
||||
</td> |
|
||||
<td colspan="2"> |
|
||||
<input id="Color" type="text" class="text" style="width: 230px; height: 30px;" /> |
|
||||
</td> |
|
||||
</tr> |
|
||||
</table> |
|
||||
</div> |
|
||||
<!-- 编辑窗口 - footer --> |
|
||||
<div id="ft" style="padding: 10px; text-align: center; background-color: #f9f9f9; visibility: hidden"> |
|
||||
<a class="saveBtn" id="saveBtn">保存</a> |
|
||||
</div> |
|
||||
|
|
||||
<div hidden="hidden"> |
|
||||
<asp:Label ID="lblMessage" runat="server" Text=""></asp:Label> |
|
||||
</div> |
|
||||
<input id="UserID" type="text" hidden="hidden" runat="server" /> |
|
||||
<script> |
|
||||
|
|
||||
/**************** 全局变量 ***************/ |
|
||||
var PrimaryID; //要编辑的id |
|
||||
var dg = $('#tb'); //表格 |
|
||||
var isEdit = false; //是否为编辑状态 |
|
||||
|
|
||||
/**************** DOM加载 ***************/ |
|
||||
$(function () { |
|
||||
$.ajaxSetup({ |
|
||||
cache: false //关闭AJAX缓存 |
|
||||
}); |
|
||||
|
|
||||
//下拉框加载 |
|
||||
//reloadfl_ids(); |
|
||||
|
|
||||
//新增按钮点击 |
|
||||
$('.topaddBtn').first().click(function () { |
|
||||
isEdit = false; |
|
||||
$('#w').window('open'); |
|
||||
}); |
|
||||
|
|
||||
//编辑按钮点击 |
|
||||
$('.toppenBtn').first().click(function () { |
|
||||
isEdit = true; |
|
||||
initEidtWidget(); |
|
||||
}); |
|
||||
|
|
||||
//删除按钮 |
|
||||
$('.topdelBtn').first().click(function () { |
|
||||
$.messager.confirm('提示框', '你确定要删除吗?', function (r) { |
|
||||
if (r) { |
|
||||
deleteInfos(); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
//搜索按钮 |
|
||||
$('.topsearchBtn').first().click(function () { |
|
||||
SearchInfo(); |
|
||||
}); |
|
||||
|
|
||||
//保存按钮 |
|
||||
$('#saveBtn').bind('click', function () { |
|
||||
SaveInfo(isEdit); |
|
||||
}); |
|
||||
|
|
||||
//编辑窗口加载 |
|
||||
$('#w').window({ |
|
||||
modal: true, |
|
||||
closed: true, |
|
||||
minimizable: false, |
|
||||
maximizable: false, |
|
||||
collapsible: false, |
|
||||
width: 460, |
|
||||
height: 520, |
|
||||
footer: '#ft', |
|
||||
top: 20, |
|
||||
onBeforeClose: function () { clearw(); }, |
|
||||
onBeforeOpen: function () { |
|
||||
$('#w').css('visibility', 'visible'); $('#ft').css('visibility', 'visible'); |
|
||||
//reloadfl_id(); |
|
||||
} |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
dg = $('#tb').datagrid({ |
|
||||
fitColumns: true, |
|
||||
nowrap: false, |
|
||||
striped: true, |
|
||||
collapsible: false, |
|
||||
url: "/HttpHandlers/ForeignColorMapHandler.ashx?method=QueryList", |
|
||||
//sortName: 'sortNumber', |
|
||||
//sortOrder: 'asc', |
|
||||
remoteSort: false, |
|
||||
columns: [[ |
|
||||
{ field: 'ID', title: 'ID', hidden: true }, |
|
||||
{ field: 'TypeCode', title: '程序号', sortable: 'true', width: 10 }, |
|
||||
{ field: 'PartCode', title: '零件号', sortable: 'true', width: 10 }, |
|
||||
{ field: 'PartName', title: '零件名称', sortable: 'true', width: 30 }, |
|
||||
{ field: 'Color', title: 'Color', sortable: 'true', width: 10 } |
|
||||
]], |
|
||||
|
|
||||
pagination: true,//表示在datagrid设置分页 |
|
||||
rownumbers: true, |
|
||||
singleSelect: true |
|
||||
}); |
|
||||
|
|
||||
dg.datagrid('getPager').pagination({ |
|
||||
pageSize: 10, |
|
||||
pageNumber: 1, |
|
||||
pageList: [10, 20, 30, 40, 50], |
|
||||
beforePageText: '第',//页数文本框前显示的汉字 |
|
||||
afterPageText: '页 共 {pages} 页', |
|
||||
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录', |
|
||||
}); |
|
||||
}); |
|
||||
|
|
||||
/**************** 主要业务程序 ***************/ |
|
||||
//新增 / 编辑 |
|
||||
function SaveInfo(isEdit) { |
|
||||
|
|
||||
var ID = isEdit == true ? PrimaryID : 0; |
|
||||
var TypeCode = $('#fl_id').combo('getValue'); |
|
||||
var PartCode = $('#PartCode_s').val(); |
|
||||
var PartName = $('#PartName').val(); |
|
||||
var Color = $('#Color').val(); |
|
||||
|
|
||||
if (TypeCode == "") { |
|
||||
$.messager.alert('提示', '程序号不能为空,请重新输入', 'warning'); |
|
||||
return; |
|
||||
} |
|
||||
if (PartCode == "") { |
|
||||
$.messager.alert('提示', '零件号不能为空,请重新输入', 'warning'); |
|
||||
return; |
|
||||
} |
|
||||
var r = /^\+?[1-9][0-9]*$/; //正整数 |
|
||||
|
|
||||
if (!r.test(PartName)) { |
|
||||
$.messager.alert('提示', '换模时间必须为正整数,请重新输入', 'warning'); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
var model = { |
|
||||
ID: ID, |
|
||||
TypeCode: TypeCode, |
|
||||
PartCode: PartCode, |
|
||||
PartName: PartName, |
|
||||
Color: Color, |
|
||||
method: 'SaveInfo' |
|
||||
}; |
|
||||
SaveModel(model); |
|
||||
} |
|
||||
function SaveModel(model) { |
|
||||
$.ajax({ |
|
||||
type: "POST", |
|
||||
async: false, |
|
||||
url: "/HttpHandlers/ForeignColorMapHandler.ashx", |
|
||||
data: model, |
|
||||
success: function (data) { |
|
||||
if (data == 'true') { |
|
||||
$.messager.alert('提示', '已保存', 'info'); |
|
||||
dg.datagrid('reload'); |
|
||||
$('#w').window('close'); |
|
||||
} |
|
||||
else { |
|
||||
$.messager.alert('提示', '保存失败,请查看是否编号重复', 'warning'); |
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
error: function () { |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
//查询方法 |
|
||||
function SearchInfo() { |
|
||||
var TypeCode = $('#fl_id_s').combo('getValue'); |
|
||||
var PartCode = $('#PartCode_s').val(); |
|
||||
|
|
||||
var queryParams = { |
|
||||
TypeCode: TypeCode, |
|
||||
PartCode: PartCode |
|
||||
}; |
|
||||
dg.datagrid({ |
|
||||
queryParams: queryParams |
|
||||
}); |
|
||||
dg.datagrid('reload'); |
|
||||
|
|
||||
} |
|
||||
//编辑时加载窗体数据 |
|
||||
function initEidtWidget() { |
|
||||
var selRows = dg.datagrid('getSelections'); |
|
||||
if (selRows.length > 1) { |
|
||||
$.messager.alert('提示', '每次只能编辑一条记录,请重新选取', 'warning'); |
|
||||
return; |
|
||||
} else if (selRows.length == 0) { |
|
||||
$.messager.alert('提示', '请选择一条记录进行编辑', 'warning'); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
//窗体数据初始化 |
|
||||
var row = selRows[0]; |
|
||||
PrimaryID = row.ID; |
|
||||
$('#fl_id').combobox('select', row.TypeCode); |
|
||||
$('#PartCode_s').val(row.PartCode); |
|
||||
$('#Color').val(row.Color); |
|
||||
$('#PartName').val(row.PartName); |
|
||||
$('#w').window('open'); |
|
||||
|
|
||||
} |
|
||||
//删除方法 |
|
||||
function deleteInfos() { |
|
||||
var selRows = dg.datagrid('getSelections'); |
|
||||
if (selRows.length > 1) { |
|
||||
$.messager.alert('提示', '每次只能删除一条记录,请重新选取', 'warning'); |
|
||||
return; |
|
||||
} else if (selRows.length == 0) { |
|
||||
$.messager.alert('提示', '请选择一条记录进行删除', 'warning'); |
|
||||
return; |
|
||||
} |
|
||||
var row = selRows[0]; |
|
||||
|
|
||||
var model = { |
|
||||
ID: row.ID, |
|
||||
method: 'DelInfo' |
|
||||
}; |
|
||||
|
|
||||
$.ajax({ |
|
||||
url: "/HttpHandlers/ForeignColorMapHandler.ashx", |
|
||||
data: model, |
|
||||
async: false, |
|
||||
success: function (data) { |
|
||||
if (data == 'true') { |
|
||||
$.messager.alert('提示', '已删除', 'info'); |
|
||||
dg.datagrid('reload'); |
|
||||
} |
|
||||
else { |
|
||||
$.messager.alert('提示', '由于有关联数据,删除失败', 'warning'); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
/**************** 辅助业务程序 ***************/ |
|
||||
/**********************************************/ |
|
||||
/***************** 窗体程序 *******************/ |
|
||||
/**********************************************/ |
|
||||
//编辑窗口关闭清空数据 |
|
||||
function clearw() { |
|
||||
|
|
||||
$('#fl_id').combo('clear'); |
|
||||
$('#PartCode_s').val(''); |
|
||||
$('#PartName').val(''); |
|
||||
$('#Color').val(''); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
function reloadfl_id() { |
|
||||
$('#fl_id').combobox('reload', '/HttpHandlers/LineHandler.ashx?method=QueryForCombobox'); |
|
||||
} |
|
||||
|
|
||||
//function reloadfl_ids() { |
|
||||
// $('#fl_id_s').combobox('reload', '/HttpHandlers/LineHandler.ashx?method=QueryForCombobox'); |
|
||||
//} |
|
||||
|
|
||||
</script> |
|
||||
</form> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,20 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Web; |
|
||||
using System.Web.UI; |
|
||||
using System.Web.UI.WebControls; |
|
||||
|
|
||||
namespace MESWebSite.Manage |
|
||||
{ |
|
||||
public partial class ForeignColorMap : System.Web.UI.Page |
|
||||
{ |
|
||||
protected void Page_Load(object sender, EventArgs e) |
|
||||
{ |
|
||||
if (Request.Cookies["LoginUserInfo"] == null) |
|
||||
{ |
|
||||
Response.Write("<script language=javascript>alert('您的登录信息已过期,请重新登录!');top.location.href='../Login.aspx';</script>"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,44 +0,0 @@ |
|||||
//------------------------------------------------------------------------------
|
|
||||
// <自动生成>
|
|
||||
// 此代码由工具生成。
|
|
||||
//
|
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
|
||||
// 重新生成代码,则所做更改将丢失。
|
|
||||
// </自动生成>
|
|
||||
//------------------------------------------------------------------------------
|
|
||||
|
|
||||
namespace MESWebSite.Manage |
|
||||
{ |
|
||||
|
|
||||
|
|
||||
public partial class ForeignColorMap |
|
||||
{ |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// form1 控件。
|
|
||||
/// </summary>
|
|
||||
/// <remarks>
|
|
||||
/// 自动生成的字段。
|
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|
||||
/// </remarks>
|
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// lblMessage 控件。
|
|
||||
/// </summary>
|
|
||||
/// <remarks>
|
|
||||
/// 自动生成的字段。
|
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|
||||
/// </remarks>
|
|
||||
protected global::System.Web.UI.WebControls.Label lblMessage; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// UserID 控件。
|
|
||||
/// </summary>
|
|
||||
/// <remarks>
|
|
||||
/// 自动生成的字段。
|
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|
||||
/// </remarks>
|
|
||||
protected global::System.Web.UI.HtmlControls.HtmlInputText UserID; |
|
||||
} |
|
||||
} |
|
@ -1,85 +0,0 @@ |
|||||
|
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|
||||
# Visual Studio Version 17 |
|
||||
VisualStudioVersion = 17.8.34330.188 |
|
||||
MinimumVisualStudioVersion = 10.0.40219.1 |
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MESClassLibrary", "MESClassLibrary\MESClassLibrary.csproj", "{867989D8-6837-41DC-9BF1-4658F5D6CFEF}" |
|
||||
EndProject |
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaintingPC", "PaintingPC\PaintingPC.csproj", "{BA977F8C-A368-48B9-AD23-965246580D4C}" |
|
||||
EndProject |
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebService", "WebService\WebService.csproj", "{61D9D50E-F645-40DE-8C7A-B4039D840C52}" |
|
||||
EndProject |
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0D128182-FB8C-4E0B-A42F-DF3767E4DE39}" |
|
||||
ProjectSection(SolutionItems) = preProject |
|
||||
数据结构修改记录.txt = 数据结构修改记录.txt |
|
||||
EndProjectSection |
|
||||
EndProject |
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaintingScreen", "PaintingScreen\PaintingScreen.csproj", "{14A52CF0-E299-459C-9EDA-E86F47B2C8E8}" |
|
||||
EndProject |
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaintingView", "PaintingView\PaintingView.csproj", "{3054D10F-3296-41E1-8ACD-628F33AC97EF}" |
|
||||
EndProject |
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Updater", "Updater\Updater.csproj", "{B2A5892E-A99E-4E26-B298-CE36488213CC}" |
|
||||
EndProject |
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "foda", "foda\foda.csproj", "{C246AE3F-AE49-45CB-B2CF-C56C6D228C6B}" |
|
||||
EndProject |
|
||||
Global |
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|
||||
Debug|Any CPU = Debug|Any CPU |
|
||||
Debug|x86 = Debug|x86 |
|
||||
Release|Any CPU = Release|Any CPU |
|
||||
Release|x86 = Release|x86 |
|
||||
EndGlobalSection |
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|
||||
{867989D8-6837-41DC-9BF1-4658F5D6CFEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
||||
{867989D8-6837-41DC-9BF1-4658F5D6CFEF}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
||||
{867989D8-6837-41DC-9BF1-4658F5D6CFEF}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
||||
{867989D8-6837-41DC-9BF1-4658F5D6CFEF}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
||||
{867989D8-6837-41DC-9BF1-4658F5D6CFEF}.Release|Any CPU.Build.0 = Release|Any CPU |
|
||||
{867989D8-6837-41DC-9BF1-4658F5D6CFEF}.Release|x86.ActiveCfg = Release|Any CPU |
|
||||
{BA977F8C-A368-48B9-AD23-965246580D4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
||||
{BA977F8C-A368-48B9-AD23-965246580D4C}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
||||
{BA977F8C-A368-48B9-AD23-965246580D4C}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
||||
{BA977F8C-A368-48B9-AD23-965246580D4C}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
||||
{BA977F8C-A368-48B9-AD23-965246580D4C}.Release|Any CPU.Build.0 = Release|Any CPU |
|
||||
{BA977F8C-A368-48B9-AD23-965246580D4C}.Release|x86.ActiveCfg = Release|Any CPU |
|
||||
{61D9D50E-F645-40DE-8C7A-B4039D840C52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
||||
{61D9D50E-F645-40DE-8C7A-B4039D840C52}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
||||
{61D9D50E-F645-40DE-8C7A-B4039D840C52}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
||||
{61D9D50E-F645-40DE-8C7A-B4039D840C52}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
||||
{61D9D50E-F645-40DE-8C7A-B4039D840C52}.Release|Any CPU.Build.0 = Release|Any CPU |
|
||||
{61D9D50E-F645-40DE-8C7A-B4039D840C52}.Release|x86.ActiveCfg = Release|Any CPU |
|
||||
{14A52CF0-E299-459C-9EDA-E86F47B2C8E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
||||
{14A52CF0-E299-459C-9EDA-E86F47B2C8E8}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
||||
{14A52CF0-E299-459C-9EDA-E86F47B2C8E8}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
||||
{14A52CF0-E299-459C-9EDA-E86F47B2C8E8}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
||||
{14A52CF0-E299-459C-9EDA-E86F47B2C8E8}.Release|Any CPU.Build.0 = Release|Any CPU |
|
||||
{14A52CF0-E299-459C-9EDA-E86F47B2C8E8}.Release|x86.ActiveCfg = Release|Any CPU |
|
||||
{3054D10F-3296-41E1-8ACD-628F33AC97EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
||||
{3054D10F-3296-41E1-8ACD-628F33AC97EF}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
||||
{3054D10F-3296-41E1-8ACD-628F33AC97EF}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
||||
{3054D10F-3296-41E1-8ACD-628F33AC97EF}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
||||
{3054D10F-3296-41E1-8ACD-628F33AC97EF}.Release|Any CPU.Build.0 = Release|Any CPU |
|
||||
{3054D10F-3296-41E1-8ACD-628F33AC97EF}.Release|x86.ActiveCfg = Release|Any CPU |
|
||||
{B2A5892E-A99E-4E26-B298-CE36488213CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
||||
{B2A5892E-A99E-4E26-B298-CE36488213CC}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
||||
{B2A5892E-A99E-4E26-B298-CE36488213CC}.Debug|x86.ActiveCfg = Debug|x86 |
|
||||
{B2A5892E-A99E-4E26-B298-CE36488213CC}.Debug|x86.Build.0 = Debug|x86 |
|
||||
{B2A5892E-A99E-4E26-B298-CE36488213CC}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
||||
{B2A5892E-A99E-4E26-B298-CE36488213CC}.Release|Any CPU.Build.0 = Release|Any CPU |
|
||||
{B2A5892E-A99E-4E26-B298-CE36488213CC}.Release|x86.ActiveCfg = Release|x86 |
|
||||
{B2A5892E-A99E-4E26-B298-CE36488213CC}.Release|x86.Build.0 = Release|x86 |
|
||||
{C246AE3F-AE49-45CB-B2CF-C56C6D228C6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
||||
{C246AE3F-AE49-45CB-B2CF-C56C6D228C6B}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
||||
{C246AE3F-AE49-45CB-B2CF-C56C6D228C6B}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
||||
{C246AE3F-AE49-45CB-B2CF-C56C6D228C6B}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
||||
{C246AE3F-AE49-45CB-B2CF-C56C6D228C6B}.Release|Any CPU.Build.0 = Release|Any CPU |
|
||||
{C246AE3F-AE49-45CB-B2CF-C56C6D228C6B}.Release|x86.ActiveCfg = Release|Any CPU |
|
||||
EndGlobalSection |
|
||||
GlobalSection(SolutionProperties) = preSolution |
|
||||
HideSolutionNode = FALSE |
|
||||
EndGlobalSection |
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution |
|
||||
SolutionGuid = {52EF8F7E-6AC9-4400-82F1-31F70143C867} |
|
||||
VisualSVNWorkingCopyRoot = . |
|
||||
EndGlobalSection |
|
||||
EndGlobal |
|
@ -1,30 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<configuration> |
|
||||
<configSections> |
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> |
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> |
|
||||
</configSections> |
|
||||
<entityFramework> |
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> |
|
||||
<parameters> |
|
||||
<parameter value="mssqllocaldb"/> |
|
||||
</parameters> |
|
||||
</defaultConnectionFactory> |
|
||||
<providers> |
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/> |
|
||||
</providers> |
|
||||
</entityFramework> |
|
||||
<connectionStrings> |
|
||||
|
|
||||
<!--<add name="BBMPTEntities" connectionString="metadata=res://*/EFModel.BBMPT.csdl|res://*/EFModel.BBMPT.ssdl|res://*/EFModel.BBMPT.msl;provider=System.Data.SqlClient;provider connection string="data source=39.97.227.79;initial catalog=BBMPT1;user id=sa;password=a1+;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />--> |
|
||||
<!--<add name="BBMPTEntities" connectionString="metadata=res://*/EFModel.BBMPT.csdl|res://*/EFModel.BBMPT.ssdl|res://*/EFModel.BBMPT.msl;provider=System.Data.SqlClient;provider connection string="data source=10.60.101.60;initial catalog=BBMPT1;user id=sa;password=a1+;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />--> |
|
||||
|
|
||||
<!--<add name="BBMPTEntities" connectionString="metadata=res://*/EFModel.BBMPT.csdl|res://*/EFModel.BBMPT.ssdl|res://*/EFModel.BBMPT.msl;provider=System.Data.SqlClient;provider connection string="data source=39.97.227.79;initial catalog=BBMPT1;user id=sa;password=a1+;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />--> |
|
||||
<add name="BBMPTEntities" connectionString="metadata=res://*/EFModel.BBMPT.csdl|res://*/EFModel.BBMPT.ssdl|res://*/EFModel.BBMPT.msl;provider=System.Data.SqlClient;provider connection string="data source=10.60.101.60;initial catalog=BBMPT1;user id=sa;password=a1+;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient"/> |
|
||||
<!--<add name="BBMPTEntities" connectionString="metadata=res://*/EFModel.BBMPT.csdl|res://*/EFModel.BBMPT.ssdl|res://*/EFModel.BBMPT.msl;provider=System.Data.SqlClient;provider connection string="data source=39.97.227.79;initial catalog=BBMPT1;user id=sa;password=a1+;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient"/>--> |
|
||||
|
|
||||
</connectionStrings> |
|
||||
<startup> |
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> |
|
||||
</startup> |
|
||||
</configuration> |
|
@ -1,208 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.DAL; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Linq.Expressions; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL |
|
||||
{ |
|
||||
public class BasicBLL<T> where T : class, new() |
|
||||
{ |
|
||||
BaseDAL<T> db = new BaseDAL<T>(); |
|
||||
/// 新增信息
|
|
||||
public bool AddInfo(T md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
if (db.Add(md) > 0) |
|
||||
{ |
|
||||
return true; |
|
||||
} |
|
||||
return false; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
//LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// 修改信息
|
|
||||
public bool UpdateInfo(T md, params string[] proNames) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
//T u = new T() { uId = 1, uLoginName = "asdfasdf" };
|
|
||||
if (db.Modify(md, proNames) > 0) |
|
||||
{ |
|
||||
return true; |
|
||||
} |
|
||||
return false; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public bool UpdateInfo(T md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.Modify(md) > 0; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// 删除信息
|
|
||||
public bool DelInfo(T md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
if (db.Del(md) > 0) |
|
||||
{ |
|
||||
return true; |
|
||||
} |
|
||||
return false; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
//LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
public List<T> SearchInfo(int page, int pagesize, out int total) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.GetListBy(LambdaHelper.CreateEqual<T>("IsUseing", 1)).ToList(); |
|
||||
total = list.Count; |
|
||||
int Skipcount = (page - 1) * pagesize; |
|
||||
return list.Skip(Skipcount).Take(pagesize).ToList(); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
total = 0; |
|
||||
//LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
public List<T> SearchInfoByKey(string keyname, object keyvalue) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.GetListBy(LambdaHelper.CreateEqual<T>(keyname, keyvalue)).ToList(); |
|
||||
return list; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return new List<T>(); |
|
||||
//return null;
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public List<T> SearchInfoContains(string keyname, string keyvalue) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.GetListBy(LambdaHelper.GetContains<T>(keyname, keyvalue)).ToList(); |
|
||||
return list; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return new List<T>(); |
|
||||
//return null;
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
public List<T> SearchInfoAll(int page, int pagesize, out int total) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.GetListBy(LambdaHelper.True<T>()).ToList(); |
|
||||
total = list.Count; |
|
||||
int Skipcount = (page - 1) * pagesize; |
|
||||
return list.Skip(Skipcount).Take(pagesize).ToList(); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
total = 0; |
|
||||
//LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
public T SearchInfoByID(string ID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.Find(ID); |
|
||||
return list; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
public List<T> SearchAllInfo() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.GetListBy(LambdaHelper.True<T>()).ToList(); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
//LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
public List<T> SearchInfoByTime(string cname, DateTime stime, DateTime etime) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
IQueryable<T> list = db.GetListBy(LambdaHelper.CreateCompareToLater<T>(cname, stime)).AsQueryable(); |
|
||||
list = list.Where(LambdaHelper.CreateCompareToEarlier<T>(cname, etime)); |
|
||||
return list.ToList(); |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return new List<T>(); |
|
||||
//return null;
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public List<T> Search<TKey>(Expression<Func<T, bool>> whereLambda) |
|
||||
{ |
|
||||
return db.GetListBy(whereLambda); |
|
||||
} |
|
||||
|
|
||||
public List<T> Search<TKey>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> orderLambda) |
|
||||
{ |
|
||||
return db.GetListBy(whereLambda, orderLambda); |
|
||||
} |
|
||||
|
|
||||
public int GetCount(Expression<Func<T, bool>> whereLambda) |
|
||||
{ |
|
||||
return db.GetCount(whereLambda); |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,44 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
using MESClassLibrary.Model; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class BadInjectionBLL |
|
||||
{ |
|
||||
BadInjectionDAL db=new BadInjectionDAL(); |
|
||||
|
|
||||
public bool Add_Info(BadInjectionModel md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchByCode(string code) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchByCode(code); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,343 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
using MESClassLibrary.Model; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class BarCodeBLL |
|
||||
{ |
|
||||
BarCodeDAl db = new BarCodeDAl(); |
|
||||
|
|
||||
public DataTable SearchInfoByStock(string StockNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByStock(StockNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoByPartNo(string partNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByPartNo(partNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable searchBarCode(string barcode, int flag) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.searchBarCode(barcode, flag); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool Add_Info(BarCodeModel md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool Add_Info_New(BarCodeModel md,string tableName) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.AddInfoNew(md,tableName); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfo(string stationNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfo(stationNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoAll() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoAll(); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchBarCode() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchBarCode(); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchBarCodeByOne(string OneBarCode) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchBarCodeByOne(OneBarCode); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchBarCodeByTwo(string BarCode) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchBarCodeByTwo(BarCode); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchSerialNoByBarCode(string Code) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchSerialNoByBarCode(Code); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchSerialNoByBarCodeNew(string Code,string tableName) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchSerialNoByBarCodeNew(Code, tableName); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoByBarCode(string BarCode) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByBarCode(BarCode); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoByBarCodeNew(string BarCode,string tableName) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByBarCodeNew(BarCode, tableName); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool Update_Info(BarCodeModel md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.UpdateInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool DelBarCode(BarCodeModel md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelBarCode(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool DelBarCode_New(BarCodeModel md,string tableName) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelBarCode_New(md,tableName); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchBoxIsNull(string partNo, string StationID, string tableName, string ProductNature) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchBoxIsNull(partNo, StationID, tableName, ProductNature); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable IsHave(string partNo, string StationID, string tableName) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.IsHave(partNo, StationID, tableName); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool UpdateBoxNo(string tableName, string boxNo, string partNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.UpdateBoxNo(tableName, boxNo, partNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchCountByBox(string boxNo, string tableName) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchCountByBox(boxNo, tableName); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool UpdateIsBad(string tableName, string onebarcode, string barcode) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.UpdateIsBad(tableName, onebarcode, barcode); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchBarCode(string boxNo, string tableName, string row) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchBarCode(boxNo, tableName, row); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool updateProductNature(string tableName, string barcode) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.updateProductNature(tableName, barcode); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SeachInfoByOne(string barCode, string tableName,int flag) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SeachInfoByOne(barCode, tableName, flag); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,271 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class BomBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Bom> db = new BasicBLL<tb_Bom>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Bom md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("PartNo1", md.PartNo1);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.BomID != md.BomID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Bom md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.PartNo1 == md.PartNo1 && p.BomID != md.BomID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[2]; |
|
||||
proNames[0] = "PartNo1"; |
|
||||
proNames[1] = "PartNo2"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_Bom md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string partNo1) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
|
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_Bom> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(partNo1)) |
|
||||
{ |
|
||||
list = list.Where(p => p.PartNo1.Contains(partNo1)).ToList(); |
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
|
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
List<BomModel> modelList = new List<BomModel>(); |
|
||||
BasicBLL<tb_Product> s_db = new BasicBLL<tb_Product>(); |
|
||||
var s_list = s_db.SearchAllInfo(); |
|
||||
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
BomModel dm = Tool.Mapper<BomModel, tb_Bom>(item); |
|
||||
var info = s_list.FirstOrDefault(p => p.PartNo == item.PartNo1); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
dm.ProductName1 = info.ProductName; |
|
||||
} |
|
||||
|
|
||||
var info2 = s_list.FirstOrDefault(p => p.PartNo == item.PartNo2); |
|
||||
if (info2 != null) |
|
||||
{ |
|
||||
dm.ProductName2 = info2.ProductName; |
|
||||
} |
|
||||
|
|
||||
modelList.Add(dm); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
JsonDataModel<BomModel> md = new JsonDataModel<BomModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = modelList; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<BomModel>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public List<tb_Bom> SearchAll() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var s_list = db.SearchAllInfo().ToList(); |
|
||||
return s_list; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_Bom SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public DataTable SearchBom(string PartNo) |
|
||||
{ |
|
||||
BomDAL dal=new BomDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return dal.SearchBom(PartNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable Search(string partNo1, string partNo2) |
|
||||
{ |
|
||||
BomDAL dal = new BomDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return dal.Search(partNo1, partNo2); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool AddInfo(BomModel md) |
|
||||
{ |
|
||||
BomDAL dal = new BomDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return dal.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool updateInfo(BomModel md) |
|
||||
{ |
|
||||
BomDAL dal = new BomDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return dal.updateInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool DelInfo(BomModel md) |
|
||||
{ |
|
||||
BomDAL dal = new BomDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return dal.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
@ -1,184 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
|
|
||||
public class BucketInfoBLL |
|
||||
{ |
|
||||
BasicBLL<tb_BucketInfo> db = new BasicBLL<tb_BucketInfo>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_BucketInfo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("BucketCode", md.BucketCode);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.ID != md.ID && p.IsUsing == 1).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_BucketInfo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.BucketCode == md.BucketCode && p.ID != md.ID && p.IsUsing == 1).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[3]; |
|
||||
proNames[0] = "BucketCode"; |
|
||||
proNames[1] = "BucketName"; |
|
||||
proNames[2] = "IsUsing"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_BucketInfo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string BucketCode) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
|
|
||||
List<tb_BucketInfo> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(BucketCode)) |
|
||||
{ |
|
||||
list = list.Where(p => p.BucketCode.Contains(BucketCode)).ToList(); |
|
||||
} |
|
||||
|
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
JsonDataModel<tb_BucketInfo> md = new JsonDataModel<tb_BucketInfo>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = list; |
|
||||
return JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_BucketInfo SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
|
|
||||
List<SelectModel> sl = new List<SelectModel>(); |
|
||||
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
SelectModel md = new SelectModel(); |
|
||||
md.textField = item.BucketCode+"--"+ item.BucketName; |
|
||||
md.valueField = item.ID; |
|
||||
sl.Add(md); |
|
||||
} |
|
||||
|
|
||||
jsonStr = JSONTools.ScriptSerialize(sl); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,210 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class CarTypeBLL |
|
||||
{ |
|
||||
readonly BasicBLL<tb_CarType> db = new BasicBLL<tb_CarType>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_CarType md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("CarTypeName", md.CarTypeName);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.ID != md.ID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
md.CreateTime = DateTime.Now; |
|
||||
var result = db.AddInfo(md); |
|
||||
return result; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_CarType md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.CarTypeName == md.CarTypeName && p.ID != md.ID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[] { |
|
||||
"CarTypeName", |
|
||||
"ManufactureID", |
|
||||
"UpdateTime", |
|
||||
}; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
md.UpdateTime = DateTime.Now; |
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_CarType md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string name, string manufacturerID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
IEnumerable<tb_CarType> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!string.IsNullOrEmpty(name)) |
|
||||
{ |
|
||||
list = list.Where(p => p.CarTypeName != null && p.CarTypeName.Contains(name)); |
|
||||
} |
|
||||
if (!string.IsNullOrEmpty(manufacturerID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.ManufacturerID != null && p.ManufacturerID == manufacturerID); |
|
||||
} |
|
||||
List<tb_Manufacturer> modelList = new List<tb_Manufacturer>(); |
|
||||
if (list.Any()) |
|
||||
{ |
|
||||
total = list.Count(); |
|
||||
|
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)); |
|
||||
|
|
||||
var manufactureBll = new ManufactureBLL(); |
|
||||
var manufacture = manufactureBll.SearchAll(); |
|
||||
|
|
||||
var ctm = from c in list |
|
||||
join mf in manufacture |
|
||||
on c.ManufacturerID equals mf.ID |
|
||||
select new CarTypeModel |
|
||||
{ |
|
||||
ID = c.ID, |
|
||||
CarTypeName = c.CarTypeName, |
|
||||
ManufacturerID = c.ManufacturerID, |
|
||||
ManufacturerName = mf.ManufacturerName, |
|
||||
CreateTime = c.CreateTime, |
|
||||
UpdateTime = c.UpdateTime |
|
||||
}; |
|
||||
|
|
||||
JsonDataModel<CarTypeModel> md = new JsonDataModel<CarTypeModel> |
|
||||
{ |
|
||||
total = total.ToString(), |
|
||||
rows = ctm.ToList() |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
jsonStr = md.ToSerializer(); |
|
||||
} |
|
||||
|
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public List<tb_CarType> SearchAll() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var s_list = db.SearchAllInfo().ToList(); |
|
||||
return s_list; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_CarType SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public string CarTypeCombo() |
|
||||
{ |
|
||||
return SearchAll().ToSerializer(); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
|
@ -1,201 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class CheckItemBLL |
|
||||
{ |
|
||||
BasicBLL<tb_CheckItem> db = new BasicBLL<tb_CheckItem>(); |
|
||||
/// <summary>
|
|
||||
/// 查询信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfo(string page, string pagesize, string CheckContent, string DeviceID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_CheckItem> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(DeviceID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.DeviceID == DeviceID).ToList(); |
|
||||
} |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(CheckContent)) |
|
||||
{ |
|
||||
list = list.Where(p => p.CheckContent.Contains(CheckContent)).ToList(); |
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
#region 联查
|
|
||||
List<CheckItemModel> ModelList = new List<CheckItemModel>(); |
|
||||
BasicBLL<tb_Device> p_db = new BasicBLL<tb_Device>(); |
|
||||
var p_list = p_db.SearchAllInfo().ToList(); |
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
CheckItemModel dm = Tool.Mapper<CheckItemModel, tb_CheckItem>(item); |
|
||||
var info = p_list.FirstOrDefault(p => p.DeviceID == item.DeviceID); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
dm.DeviceName = info.DeviceName; |
|
||||
} |
|
||||
ModelList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
JsonDataModel<CheckItemModel> md = new JsonDataModel<CheckItemModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = ModelList; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<CheckItemModel>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 添加信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_CheckItem md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("CheckContent", md.CheckContent);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.DeviceID.Equals(md.DeviceID)).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_CheckItem md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.CheckContent == md.CheckContent && p.DeviceID == md.DeviceID && p.ID != md.ID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[6]; |
|
||||
proNames[0] = "DeviceID"; |
|
||||
proNames[1] = "CheckContent"; |
|
||||
proNames[2] = "Standard"; |
|
||||
proNames[3] = "Way"; |
|
||||
proNames[4] = "Cycle"; |
|
||||
proNames[5] = "CheckVersion"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
/// 删除生产线信息
|
|
||||
public bool DelInfo(tb_CheckItem md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_CheckItem>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetTreeData(string deviceID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
BasicBLL<tb_CheckItem> li_db = new BasicBLL<tb_CheckItem>(); |
|
||||
List<TreeModel> trlist = new List<TreeModel>(); |
|
||||
TreeModel tr = new TreeModel(); |
|
||||
tr.id = "-1"; |
|
||||
tr.text = "点检项"; |
|
||||
tr.state = "open"; |
|
||||
var li_list = li_db.SearchAllInfo().Where(p => p.DeviceID.Equals(deviceID)).ToList(); |
|
||||
var queryData = from a in li_list |
|
||||
select new ChildTreeModel |
|
||||
{ |
|
||||
id = a.ID, |
|
||||
text = a.CheckContent |
|
||||
}; |
|
||||
List<ChildTreeModel> clist = queryData.ToList(); |
|
||||
if (clist.Count > 0) |
|
||||
{ |
|
||||
tr.children = clist; |
|
||||
trlist.Add(tr); |
|
||||
} |
|
||||
jsonStr = JSONTools.ScriptSerialize<List<TreeModel>>(trlist); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,218 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
|
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
|
|
||||
public class ColorBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Color> db = new BasicBLL<tb_Color>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Color md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
//var list = db.SearchInfoByKey("ColorCode", md.ColorCode);//判断是否有重复数据
|
|
||||
//if (list != null)
|
|
||||
//{
|
|
||||
// if (list.Where(p => p.ID != md.ID).Count() > 0)
|
|
||||
// {
|
|
||||
// return false;
|
|
||||
// }
|
|
||||
|
|
||||
//}
|
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Color md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
//var list = db.SearchAllInfo().Where(p => p.ColorCode == md.ColorCode && p.ID != md.ID).ToList();//判断是否有重复数据
|
|
||||
//if (list.Count > 0)
|
|
||||
//{
|
|
||||
// return false;
|
|
||||
//}
|
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[5]; |
|
||||
proNames[0] = "ColorCode"; |
|
||||
proNames[1] = "ColorNo"; |
|
||||
proNames[2] = "ColorQQCode"; |
|
||||
proNames[3] = "Des"; |
|
||||
proNames[4] = "ColorDQCode"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_Color md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize,string ColorCode) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
|
|
||||
List<tb_Color> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(ColorCode)) |
|
||||
{ |
|
||||
list = list.Where(p => p.ColorCode.Contains(ColorCode)).ToList(); |
|
||||
} |
|
||||
|
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
JsonDataModel<tb_Color> md = new JsonDataModel<tb_Color>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = list; |
|
||||
return JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_Color SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().Select(p=>p.Des).Distinct().ToList();//判断是否有重复数据
|
|
||||
|
|
||||
List<SelectModel> sl = new List<SelectModel>(); |
|
||||
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
SelectModel md = new SelectModel(); |
|
||||
md.textField = item; |
|
||||
md.valueField = item; |
|
||||
sl.Add(md); |
|
||||
} |
|
||||
|
|
||||
jsonStr = JSONTools.ScriptSerialize(sl); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxColor() |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().ToList(); |
|
||||
return list.ToSerializer(); |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchAll() |
|
||||
{ |
|
||||
ColorDAL da = new ColorDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchInfoAll(); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchByName(string color) |
|
||||
{ |
|
||||
ColorDAL da = new ColorDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchByName(color); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,181 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class DefectBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Defect> db = new BasicBLL<tb_Defect>(); |
|
||||
/// <summary>
|
|
||||
/// 查询信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfo(string page, string pagesize, string DefectName, string LineID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_Defect> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(LineID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.LineID == LineID).ToList(); |
|
||||
} |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(DefectName)) |
|
||||
{ |
|
||||
list = list.Where(p => p.DefectName.Contains(DefectName)).ToList(); |
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
#region 联查
|
|
||||
List<DefectModel> ModelList = new List<DefectModel>(); |
|
||||
BasicBLL<tb_Line> p_db = new BasicBLL<tb_Line>(); |
|
||||
var p_list = p_db.SearchAllInfo().ToList(); |
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
DefectModel dm = Tool.Mapper<DefectModel, tb_Defect>(item); |
|
||||
var info = p_list.FirstOrDefault(p => p.LineID == item.LineID); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
dm.LineName = info.LineName; |
|
||||
} |
|
||||
ModelList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
JsonDataModel<DefectModel> md = new JsonDataModel<DefectModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = ModelList; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<DefectModel>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 添加信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Defect md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("DefectName", md.DefectName);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.ID != md.ID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Defect md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.DefectName == md.DefectName && p.ID != md.ID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[3]; |
|
||||
proNames[0] = "LineID"; |
|
||||
proNames[1] = "DefectName"; |
|
||||
proNames[2] = "Des"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
/// 删除生产线信息
|
|
||||
public bool DelInfo(tb_Defect md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_Defect>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfo(string LineID) |
|
||||
{ |
|
||||
DefectDAL da=new DefectDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchInfoAll(LineID); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,144 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class DeptBLL |
|
||||
{ |
|
||||
BasicBLL<TA_DEPT> db = new BasicBLL<TA_DEPT>(); |
|
||||
/// <summary>
|
|
||||
/// 查询信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfo(string page, string pagesize, string DeptName) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<TA_DEPT> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(DeptName)) |
|
||||
{ |
|
||||
list = list.Where(p => p.DeptName.Contains(DeptName)).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
JsonDataModel<TA_DEPT> md = new JsonDataModel<TA_DEPT>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = list; |
|
||||
jsonStr = JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 添加信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(TA_DEPT md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("LineName", md.DeptName);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.GUID != md.GUID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(TA_DEPT md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.DeptName == md.DeptName && p.GUID != md.GUID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[3]; |
|
||||
proNames[0] = "DeptCode"; |
|
||||
proNames[1] = "DeptName"; |
|
||||
proNames[2] = "Remark"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
/// 删除生产线信息
|
|
||||
public bool DelInfo(TA_DEPT md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
jsonStr = JSONTools.ScriptSerialize<List<TA_DEPT>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,251 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class DeviceBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Device> db = new BasicBLL<tb_Device>(); |
|
||||
/// <summary>
|
|
||||
/// 查询信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfo(string page, string pagesize, string DeviceNo, string StationID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_Device> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(StationID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.StationID == StationID).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(DeviceNo)) |
|
||||
{ |
|
||||
list = list.Where(p => p.DeviceNo.Contains(DeviceNo)).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
#region 联查
|
|
||||
List<DeviceModel> StationList = new List<DeviceModel>(); |
|
||||
BasicBLL<tb_Station> pl_db = new BasicBLL<tb_Station>(); |
|
||||
var pl_list = pl_db.SearchAllInfo().ToList(); |
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
DeviceModel dm = Tool.Mapper<DeviceModel, tb_Device>(item); |
|
||||
var info = pl_list.FirstOrDefault(p => p.StationID == item.StationID); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
dm.StationNo = info.StationNo; |
|
||||
} |
|
||||
StationList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
JsonDataModel<DeviceModel> md = new JsonDataModel<DeviceModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = StationList; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<DeviceModel>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
public string SearchInfoByID(string DeviceID) { |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
tb_Device info = db.SearchInfoByID(DeviceID); |
|
||||
jsonStr = JSONTools.ScriptSerialize<tb_Device>(info); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 添加信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Device md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("DeviceNo", md.DeviceNo);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.DeviceID != md.DeviceID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Device md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.DeviceNo == md.DeviceNo && p.DeviceID != md.DeviceID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[6]; |
|
||||
proNames[0] = "StationID"; |
|
||||
proNames[1] = "DeviceNo"; |
|
||||
proNames[2] = "DeviceName"; |
|
||||
proNames[3] = "FixNo"; |
|
||||
proNames[4] = "Des"; |
|
||||
proNames[5] = "DeviceModel"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
/// 删除生产线信息
|
|
||||
public bool DelInfo(tb_Device md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
item.DeviceName = item.DeviceNo + "----" + item.DeviceName; |
|
||||
} |
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_Device>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
public string QueryForComboboxByLineID(string fl_id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
if (fl_id != null && fl_id != "") |
|
||||
{ |
|
||||
BasicBLL<tb_Station> s_db = new BasicBLL<tb_Station>(); |
|
||||
var s_list = s_db.SearchAllInfo().Where(p => p.LineID == fl_id).ToList();//判断是否有重复数据
|
|
||||
if (s_list.Count > 0) |
|
||||
{ |
|
||||
string[] arr = s_list.Select(p => p.StationID).ToArray(); |
|
||||
list = list.Where(p => arr.Contains(p.StationID)).ToList(); |
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
item.DeviceName = item.DeviceNo + "----" + item.DeviceName; |
|
||||
} |
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_Device>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
} |
|
||||
return ""; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
public string QueryForComboboxByStationID(string fl_id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
|
|
||||
if (fl_id != null && fl_id != "") |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.StationID == fl_id).ToList();//判断是否有重复数据
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
item.DeviceName = item.DeviceNo + "----" + item.DeviceName; |
|
||||
} |
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_Device>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
return ""; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
@ -1,148 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class FactoryBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Factory> db = new BasicBLL<tb_Factory>(); |
|
||||
/// <summary>
|
|
||||
/// 查询信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfo(string page, string pagesize, string FactoryName) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_Factory> list = db.SearchAllInfo(); |
|
||||
|
|
||||
|
|
||||
if (!String.IsNullOrEmpty(FactoryName)) |
|
||||
{ |
|
||||
list = list.Where(p => p.FactoryName.Contains(FactoryName)).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
JsonDataModel<tb_Factory> md = new JsonDataModel<tb_Factory>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = list; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<tb_Factory>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 添加信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Factory md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("FactoryName", md.FactoryName);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.FactoryID != md.FactoryID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Factory md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.FactoryName == md.FactoryName && p.FactoryID != md.FactoryID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[2]; |
|
||||
proNames[0] = "FactoryName"; |
|
||||
proNames[1] = "Des"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
/// 删除生产线信息
|
|
||||
public bool DelInfo(tb_Factory md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_Factory>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,135 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class ImgVideoBLL |
|
||||
{ |
|
||||
BBMPTEntities ef = new BBMPTEntities(); |
|
||||
BasicBLL<tb_ImgVideo> db = new BasicBLL<tb_ImgVideo>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_ImgVideo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_ImgVideo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[3]; |
|
||||
proNames[0] = "fileUrl"; |
|
||||
proNames[1] = "fileName"; |
|
||||
proNames[2] = "UpdateTime"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_ImgVideo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string StartTime, string EndTime) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
|
|
||||
DateTime stime = Convert.ToDateTime(StartTime); |
|
||||
DateTime etime = Convert.ToDateTime(EndTime); |
|
||||
List<tb_ImgVideo> list = ef.tb_ImgVideo.Where(p => p.CreateTime >= stime && p.CreateTime <= etime).OrderByDescending(p=>p.CreateTime).ToList(); |
|
||||
|
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
JsonDataModel<tb_ImgVideo> md = new JsonDataModel<tb_ImgVideo>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = list; |
|
||||
return JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_ImgVideo SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,414 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using System.Data; |
|
||||
using System.Data.SqlClient; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class InjectionPlanBLL |
|
||||
{ |
|
||||
BBMPTEntities ef = new BBMPTEntities(); |
|
||||
BasicBLL<tb_InjectionPlan> db = new BasicBLL<tb_InjectionPlan>(); |
|
||||
InjectionPlanDAL dal = new InjectionPlanDAL(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_InjectionPlan md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_InjectionPlan md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[9]; |
|
||||
proNames[0] = "StationID"; |
|
||||
proNames[1] = "BeginTime"; |
|
||||
proNames[2] = "StockNo"; |
|
||||
proNames[3] = "PlanCount"; |
|
||||
proNames[4] = "EndTime"; |
|
||||
proNames[5] = "PlanDate"; |
|
||||
proNames[6] = "RealCycle"; |
|
||||
proNames[7] = "PartNo"; |
|
||||
proNames[8] = "ProductNature"; |
|
||||
|
|
||||
|
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_InjectionPlan md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string stationID, string stockNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
|
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_InjectionPlan> list = db.SearchAllInfo().Where(p => p.IsFinish != 1).ToList(); |
|
||||
if (!String.IsNullOrEmpty(stationID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.StationID.Equals(stationID)).ToList(); |
|
||||
} |
|
||||
if (!String.IsNullOrEmpty(stockNo)) |
|
||||
{ |
|
||||
list = list.Where(p => p.StockNo.Contains(stockNo)).ToList(); |
|
||||
} |
|
||||
|
|
||||
list = list.OrderBy(p => p.BeginTime).ToList(); |
|
||||
|
|
||||
List<InjectionPlanModel> modelList = new List<InjectionPlanModel>(); |
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
|
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
|
|
||||
#region 联查
|
|
||||
BasicBLL<tb_Product> product_db = new BasicBLL<tb_Product>(); |
|
||||
var product_list = product_db.SearchAllInfo(); |
|
||||
|
|
||||
BasicBLL<tb_Station> station_db = new BasicBLL<tb_Station>(); |
|
||||
var station_list = station_db.SearchAllInfo(); |
|
||||
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
InjectionPlanModel dm = Tool.Mapper<InjectionPlanModel, tb_InjectionPlan>(item); |
|
||||
dm.ProductName = ""; |
|
||||
var station_info = station_list.FirstOrDefault(p => p.StationID == item.StationID); |
|
||||
if (station_info != null) |
|
||||
{ |
|
||||
dm.StationNo = station_info.StationNo; |
|
||||
} |
|
||||
|
|
||||
if (item.PartNo != null && item.PartNo.IndexOf(",") > 0) |
|
||||
{ |
|
||||
|
|
||||
string[] arr_PartNo = item.PartNo.Split(','); |
|
||||
foreach (var w in arr_PartNo) |
|
||||
{ |
|
||||
var product_info = product_list.FirstOrDefault(p => p.PartNo == w); |
|
||||
if (product_info != null) |
|
||||
{ |
|
||||
dm.ProductName = dm.ProductName + product_info.ProductName + ","; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
dm.ProductName = dm.ProductName.Substring(0, dm.ProductName.Length - 1); |
|
||||
|
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
var product_info = product_list.FirstOrDefault(p => p.PartNo == item.PartNo); |
|
||||
if (product_info != null) |
|
||||
{ |
|
||||
dm.ProductName = product_info.ProductName; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
modelList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
|
|
||||
|
|
||||
JsonDataModel<InjectionPlanModel> md = new JsonDataModel<InjectionPlanModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = modelList; |
|
||||
jsonStr = JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public string SearchInfoAll2(string page, string pagesize, string stationID, string stockNo, string StartTime, string EndTime) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
|
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
|
|
||||
total = dal.SearchByTimeCount(stationID, stockNo, StartTime, EndTime); |
|
||||
DataTable dt = dal.SearchByTime(Convert.ToInt32(page), Convert.ToInt32(pagesize), stationID, stockNo, StartTime, EndTime); |
|
||||
|
|
||||
List<tb_InjectionPlan> list = Tool.ConvertTo<tb_InjectionPlan>(dt).ToList(); |
|
||||
|
|
||||
//List<tb_InjectionPlan> list = ef.tb_InjectionPlan.Where(p => DateTime.Parse(p.BeginTime) >= stime && DateTime.Parse(p.EndTime) <= etime).ToList();
|
|
||||
|
|
||||
|
|
||||
if (!String.IsNullOrEmpty(stationID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.StationID.Equals(stationID)).ToList(); |
|
||||
} |
|
||||
if (!String.IsNullOrEmpty(stockNo)) |
|
||||
{ |
|
||||
list = list.Where(p => p.StockNo.Contains(stockNo)).ToList(); |
|
||||
} |
|
||||
|
|
||||
list = list.OrderBy(p => p.BeginTime).ToList(); |
|
||||
|
|
||||
List<InjectionPlanModel> modelList = new List<InjectionPlanModel>(); |
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
|
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
|
|
||||
#region 联查
|
|
||||
BasicBLL<tb_Product> product_db = new BasicBLL<tb_Product>(); |
|
||||
var product_list = product_db.SearchAllInfo(); |
|
||||
|
|
||||
BasicBLL<tb_Station> station_db = new BasicBLL<tb_Station>(); |
|
||||
var station_list = station_db.SearchAllInfo(); |
|
||||
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
InjectionPlanModel dm = Tool.Mapper<InjectionPlanModel, tb_InjectionPlan>(item); |
|
||||
var product_info = product_list.FirstOrDefault(p => p.StockNo == item.StockNo); |
|
||||
if (product_info != null) |
|
||||
{ |
|
||||
dm.PartNo = product_info.PartNo; |
|
||||
dm.ProductName = product_info.ProductName; |
|
||||
} |
|
||||
|
|
||||
var station_info = station_list.FirstOrDefault(p => p.StationID == item.StationID); |
|
||||
if (station_info != null) |
|
||||
{ |
|
||||
dm.StationNo = station_info.StationNo; |
|
||||
} |
|
||||
|
|
||||
modelList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
|
|
||||
|
|
||||
JsonDataModel<InjectionPlanModel> md = new JsonDataModel<InjectionPlanModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = modelList; |
|
||||
jsonStr = JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
public bool UpdateInfo2(tb_InjectionPlan md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[3]; |
|
||||
proNames[0] = "workClass"; |
|
||||
proNames[1] = "JK_Weight"; |
|
||||
proNames[2] = "Waste_Weight"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public List<tb_InjectionPlan> SearchAll() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var s_list = db.SearchAllInfo().ToList(); |
|
||||
return s_list; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_InjectionPlan SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public String GetEndTime(tb_InjectionPlan md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
BasicBLL<tb_Plastic> Plastic_db = new BasicBLL<tb_Plastic>(); |
|
||||
|
|
||||
var info = from c in Plastic_db.SearchAllInfo() |
|
||||
where c.PartNo == md.PartNo && c.StationID == md.StationID && c.IsBackup == 1 |
|
||||
select c.CycleTime; |
|
||||
|
|
||||
if (info.FirstOrDefault() != null) |
|
||||
{ |
|
||||
double seconds = Convert.ToDouble(info.FirstOrDefault().Value) * Convert.ToDouble(md.PlanCount); |
|
||||
return Convert.ToDateTime(md.BeginTime).AddSeconds(seconds).ToString("yyyy-MM-dd HH:mm:ss"); |
|
||||
} |
|
||||
return md.BeginTime; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoByName(string StationID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return dal.SearchPlanByStation(StationID); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
public DataTable NextSearchInfoByName(string StationID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return dal.NextSearchPlanByStation(StationID); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool UpdateFinish(InjectionPlanModel md) |
|
||||
{ |
|
||||
InjectionPlanDAL dal = new InjectionPlanDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return dal.UpdateFinish(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
public string GetStartTime(string StationID) |
|
||||
{ |
|
||||
|
|
||||
var bf = db.SearchInfoByKey("StationID", StationID).OrderByDescending(p => p.EndTime).FirstOrDefault(); |
|
||||
if (bf != null) |
|
||||
{ |
|
||||
return bf.EndTime; |
|
||||
} |
|
||||
|
|
||||
return ""; |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,170 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class LineBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Line> db = new BasicBLL<tb_Line>(); |
|
||||
/// <summary>
|
|
||||
/// 查询信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfo(string page, string pagesize, string LineName, string PlaceID, string userID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_Line> list = db.SearchAllInfo(); |
|
||||
|
|
||||
//数据权限
|
|
||||
//BasicBLL<T_Sys_Users> userdb = new BasicBLL<T_Sys_Users>();
|
|
||||
//T_Sys_Users user = userdb.SearchInfoByID(userID);
|
|
||||
//List<tb_Line> list = db.SearchInfoContains("LineName", user.Department);
|
|
||||
|
|
||||
if (!String.IsNullOrEmpty(PlaceID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.PlaceID == PlaceID).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(LineName)) |
|
||||
{ |
|
||||
list = list.Where(p => p.LineName.Contains(LineName)).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
#region 联查
|
|
||||
List<LineModel> ModelList = new List<LineModel>(); |
|
||||
BasicBLL<tb_Place> p_db = new BasicBLL<tb_Place>(); |
|
||||
var p_list = p_db.SearchAllInfo().ToList(); |
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
LineModel dm = Tool.Mapper<LineModel, tb_Line>(item); |
|
||||
var info = p_list.FirstOrDefault(p => p.PlaceID == item.PlaceID); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
dm.PlaceName = info.PlaceName; |
|
||||
} |
|
||||
ModelList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
JsonDataModel<LineModel> md = new JsonDataModel<LineModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = ModelList; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<LineModel>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 添加信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Line md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("LineName", md.LineName);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.LineID != md.LineID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Line md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.LineName == md.LineName && p.LineID != md.LineID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[3]; |
|
||||
proNames[0] = "PlaceID"; |
|
||||
proNames[1] = "LineName"; |
|
||||
proNames[2] = "Des"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
/// 删除生产线信息
|
|
||||
public bool DelInfo(tb_Line md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_Line>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,184 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class MachineBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Machine> db = new BasicBLL<tb_Machine>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Machine md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("MachineNo", md.MachineNo);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.MachineID != md.MachineID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Machine md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.MachineNo == md.MachineNo && p.MachineID != md.MachineID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[2]; |
|
||||
proNames[0] = "MachineNo"; |
|
||||
proNames[1] = "Des"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_Machine md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string machineNo) |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_Machine> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(machineNo)) |
|
||||
{ |
|
||||
list = list.Where(p => p.MachineNo.Contains(machineNo)).ToList(); |
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
|
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
JsonDataModel<tb_Machine> md = new JsonDataModel<tb_Machine>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = list; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<tb_Machine>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public List<tb_Machine> SearchAll() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var s_list = db.SearchAllInfo().ToList(); |
|
||||
return s_list; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_Machine SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
//下拉框查询方法
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList(); |
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_Machine>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,180 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class ManufactureBLL |
|
||||
{ |
|
||||
readonly BasicBLL<tb_Manufacturer> db = new BasicBLL<tb_Manufacturer>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Manufacturer md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("ManufacturerName", md.ManufacturerName);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.ID != md.ID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
md.CreateTime = DateTime.Now; |
|
||||
var result = db.AddInfo(md); |
|
||||
return result; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Manufacturer md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.ManufacturerName == md.ManufacturerName && p.ID != md.ID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[] { |
|
||||
"ManufacturerName", |
|
||||
"Des", |
|
||||
"UpdateTime", |
|
||||
}; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
md.UpdateTime = DateTime.Now; |
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_Manufacturer md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string name) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
IEnumerable<tb_Manufacturer> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!string.IsNullOrEmpty(name)) |
|
||||
{ |
|
||||
list = list.Where(p => p.ManufacturerName != null && p.ManufacturerName.Contains(name)); |
|
||||
} |
|
||||
List<tb_Manufacturer> modelList = new List<tb_Manufacturer>(); |
|
||||
if (list.Any()) |
|
||||
{ |
|
||||
total = list.Count(); |
|
||||
|
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)); |
|
||||
|
|
||||
JsonDataModel<tb_Manufacturer> md = new JsonDataModel<tb_Manufacturer> |
|
||||
{ |
|
||||
total = total.ToString(), |
|
||||
rows = list.ToList() |
|
||||
}; |
|
||||
jsonStr = md.ToSerializer(); |
|
||||
} |
|
||||
|
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public List<tb_Manufacturer> SearchAll() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var s_list = db.SearchAllInfo().ToList(); |
|
||||
return s_list; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_Manufacturer SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,224 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class ModelInfoBLL |
|
||||
{ |
|
||||
BasicBLL<tb_ModelInfo> db = new BasicBLL<tb_ModelInfo>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_ModelInfo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("ModelNo", md.ModelNo);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.ID != md.ID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_ModelInfo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.ModelNo == md.ModelNo && p.ID != md.ID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[14]; |
|
||||
proNames[0] = "ModelName"; |
|
||||
proNames[1] = "ModelNo"; |
|
||||
proNames[2] = "PermanentAssetsNo"; |
|
||||
proNames[3] = "Tonnage"; |
|
||||
proNames[4] = "ServiceLife"; |
|
||||
proNames[5] = "Supplier"; |
|
||||
proNames[6] = "PartWeight"; |
|
||||
proNames[7] = "InjectionPeriod"; |
|
||||
proNames[8] = "LocatingRingSize"; |
|
||||
proNames[9] = "OutForm"; |
|
||||
proNames[10] = "ModelWeight"; |
|
||||
proNames[11] = "RunnerForm"; |
|
||||
proNames[12] = "ModelCavityNo"; |
|
||||
proNames[13] = "ModelSize"; |
|
||||
|
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_ModelInfo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string ModelNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
|
|
||||
List<tb_ModelInfo> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(ModelNo)) |
|
||||
{ |
|
||||
list = list.Where(p => p.ModelNo.Contains(ModelNo)).ToList(); |
|
||||
} |
|
||||
|
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
JsonDataModel<tb_ModelInfo> md = new JsonDataModel<tb_ModelInfo>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = list; |
|
||||
return JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_ModelInfo SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().OrderBy(p => p.ModelNo).ToList();//判断是否有重复数据
|
|
||||
|
|
||||
List<SelectModel> sl = new List<SelectModel>(); |
|
||||
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
SelectModel md = new SelectModel(); |
|
||||
md.textField = item.ModelName; |
|
||||
md.valueField = item.ID; |
|
||||
sl.Add(md); |
|
||||
} |
|
||||
|
|
||||
jsonStr = JSONTools.ScriptSerialize(sl); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfo(string ModelNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
ModelInfoDAL da=new ModelInfoDAL(); |
|
||||
return da.SearchInfo(ModelNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//public DataTable SearchAll()
|
|
||||
//{
|
|
||||
// ColorDAL da = new ColorDAL();
|
|
||||
// try
|
|
||||
// {
|
|
||||
// return da.SearchInfoAll();
|
|
||||
// }
|
|
||||
// catch (Exception ex)
|
|
||||
// {
|
|
||||
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
|
||||
// return null;
|
|
||||
// }
|
|
||||
//}
|
|
||||
} |
|
||||
} |
|
@ -1,193 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Data.SqlClient; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using MESClassLibrary.DAL; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class ModelProductBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Model_Product> db = new BasicBLL<tb_Model_Product>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Model_Product md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Model_Product md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[] { |
|
||||
"ProuctID", |
|
||||
"ModelID", |
|
||||
}; |
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_Model_Product md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string ModelID, string ProductID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string result = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
|
|
||||
IEnumerable<tb_Model_Product> list = db.SearchAllInfo(); |
|
||||
if (!string.IsNullOrEmpty(ModelID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.ModelID == ModelID); |
|
||||
} |
|
||||
if (!string.IsNullOrEmpty(ProductID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.ProuctID == ProductID); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
if (list.Any()) |
|
||||
{ |
|
||||
total = list.Count(); |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
BasicBLL<tb_ModelInfo> modelDb = new BasicBLL<tb_ModelInfo>(); |
|
||||
var modelList = modelDb.SearchAllInfo(); |
|
||||
|
|
||||
BasicBLL<tb_Product> productDb = new BasicBLL<tb_Product>(); |
|
||||
var productList = productDb.SearchAllInfo(); |
|
||||
|
|
||||
var mpmList = new List<ModelProductModel>(); |
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
ModelProductModel mpm = Tool.Mapper<ModelProductModel, tb_Model_Product>(item); |
|
||||
var productInfo = productList.FirstOrDefault(prod => prod.ProductID == item.ProuctID); |
|
||||
var modelInfo = modelList.FirstOrDefault(mod => mod.ID == item.ModelID); |
|
||||
|
|
||||
if (productInfo != null) |
|
||||
{ |
|
||||
mpm.ProductName = productInfo.ProductName; |
|
||||
mpm.PartNo = productInfo.PartNo; |
|
||||
} |
|
||||
if (modelInfo != null) |
|
||||
{ |
|
||||
mpm.ModelName = modelInfo.ModelName; |
|
||||
mpm.ModelNo = modelInfo.ModelNo; |
|
||||
} |
|
||||
|
|
||||
mpmList.Add(mpm); |
|
||||
} |
|
||||
JsonDataModel<ModelProductModel> md = new JsonDataModel<ModelProductModel> |
|
||||
{ |
|
||||
total = total.ToString(), |
|
||||
rows = mpmList |
|
||||
}; |
|
||||
result = md.ToSerializer(); |
|
||||
|
|
||||
} |
|
||||
return result; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_Model_Product SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfo(string ModelID, string ProuctID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
ModelProductDAL da=new ModelProductDAL(); |
|
||||
return da.SearchInfo(ModelID, ProuctID); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
|
@ -1,137 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
|
|
||||
public class ModelUpdateBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Model_Update> db = new BasicBLL<tb_Model_Update>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddUpdateInfo(tb_Model_Update md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Model_Update md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[5]; |
|
||||
proNames[0] = "Purpose"; |
|
||||
proNames[1] = "State"; |
|
||||
proNames[2] = "Supplier"; |
|
||||
proNames[3] = "Remarks"; |
|
||||
proNames[4] = "AddTime"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_Model_Update md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string ModelID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
|
|
||||
List<tb_Model_Update> list = db.SearchInfoByKey("ModelID", ModelID).OrderByDescending(p => p.AddTime).ToList(); |
|
||||
|
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
JsonDataModel<tb_Model_Update> md = new JsonDataModel<tb_Model_Update>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = list; |
|
||||
return JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_Model_Update SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
@ -1,185 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.Model; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
using System.Data; |
|
||||
using System.Data.SqlClient; |
|
||||
using System.Reflection; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class OperatorBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Operator> db = new BasicBLL<tb_Operator>(); |
|
||||
|
|
||||
OperatorDAL dal = new OperatorDAL(); |
|
||||
|
|
||||
public DataTable SearchInfoByName(string OperatorName, string StationID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return dal.SearchInfoByName(OperatorName, StationID); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
public DataTable SearchInfoByNameAndPsw(string OperatorName, string StationID, string psw) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return dal.SearchInfoByNameAndPsw(OperatorName, StationID, psw); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfo(string page, string pagesize, string OperatorName, string StationID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_Operator> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(StationID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.StationID.Equals(StationID)).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(OperatorName)) |
|
||||
{ |
|
||||
list = list.Where(p => p.OperatorName.Contains(OperatorName)).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
#region 联查
|
|
||||
List<OperatorModel> StationList = new List<OperatorModel>(); |
|
||||
BasicBLL<tb_Station> pl_db = new BasicBLL<tb_Station>(); |
|
||||
var pl_list = pl_db.SearchAllInfo().ToList(); |
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
OperatorModel dm = Tool.Mapper<OperatorModel, tb_Operator>(item); |
|
||||
var info = pl_list.FirstOrDefault(p => p.StationID == item.StationID); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
dm.StationNo = info.StationNo; |
|
||||
} |
|
||||
StationList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
JsonDataModel<OperatorModel> md = new JsonDataModel<OperatorModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = StationList; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<OperatorModel>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 添加信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Operator md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("OperatorNo", md.OperatorNo);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.OperatorID != md.OperatorID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Operator md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.OperatorNo == md.OperatorNo && p.OperatorID != md.OperatorID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[5]; |
|
||||
proNames[0] = "StationID"; |
|
||||
proNames[1] = "OperatorNo"; |
|
||||
proNames[2] = "OperatorName"; |
|
||||
proNames[3] = "OperatorPsw"; |
|
||||
proNames[4] = "Des"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
/// 删除生产线信息
|
|
||||
public bool DelInfo(tb_Operator md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,335 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
|
|
||||
public class PaintInfoBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Paint_Bucket> dbPB = new BasicBLL<tb_Paint_Bucket>(); |
|
||||
BasicBLL<tb_PaintInfo> db = new BasicBLL<tb_PaintInfo>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_PaintInfo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("PaintCode", md.PaintCode);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.ID != md.ID && p.IsUsing == 1).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_PaintInfo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.PaintCode == md.PaintCode && p.ID != md.ID && p.IsUsing == 1).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[5]; |
|
||||
proNames[0] = "PaintCode"; |
|
||||
proNames[1] = "PaintName"; |
|
||||
proNames[2] = "PaintModel"; |
|
||||
//proNames[3] = "UnitCode";
|
|
||||
proNames[3] = "CarModelCode"; |
|
||||
proNames[4] = "IsUsing"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_PaintInfo md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string PaintCode) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
|
|
||||
List<tb_PaintInfo> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(PaintCode)) |
|
||||
{ |
|
||||
list = list.Where(p => p.PaintCode.Contains(PaintCode)).ToList(); |
|
||||
} |
|
||||
|
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
JsonDataModel<tb_PaintInfo> md = new JsonDataModel<tb_PaintInfo>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = list; |
|
||||
return JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_PaintInfo SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
|
|
||||
List<SelectModel> sl = new List<SelectModel>(); |
|
||||
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
SelectModel md = new SelectModel(); |
|
||||
md.textField = item.PaintCode + "--" + item.PaintName; |
|
||||
md.valueField = item.ID; |
|
||||
sl.Add(md); |
|
||||
} |
|
||||
|
|
||||
jsonStr = JSONTools.ScriptSerialize(sl); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
public string SearchRelation(string page, string pagesize, string PaintID, string BucketID) |
|
||||
{ |
|
||||
|
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
|
|
||||
|
|
||||
List<tb_Paint_Bucket> list = dbPB.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(PaintID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.PaintID == PaintID).ToList(); |
|
||||
} |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(BucketID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.BucketID == BucketID).ToList(); |
|
||||
} |
|
||||
|
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
|
|
||||
List<Paint_BucketModel> modelList = new List<Paint_BucketModel>(); |
|
||||
|
|
||||
#region 联查
|
|
||||
BasicBLL<tb_PaintInfo> PaintInfo_db = new BasicBLL<tb_PaintInfo>(); |
|
||||
var PaintInfo_list = PaintInfo_db.SearchAllInfo(); |
|
||||
|
|
||||
BasicBLL<tb_BucketInfo> BucketInfo_db = new BasicBLL<tb_BucketInfo>(); |
|
||||
var BucketInfo_list = BucketInfo_db.SearchAllInfo(); |
|
||||
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
Paint_BucketModel dm = Tool.Mapper<Paint_BucketModel, tb_Paint_Bucket>(item); |
|
||||
var PaintInfo_info = PaintInfo_list.FirstOrDefault(p => p.ID == item.PaintID); |
|
||||
if (PaintInfo_info != null) |
|
||||
{ |
|
||||
dm.PaintCode = PaintInfo_info.PaintCode; |
|
||||
dm.PaintName = PaintInfo_info.PaintName; |
|
||||
} |
|
||||
|
|
||||
var BucketInfo_info = BucketInfo_list.FirstOrDefault(p => p.ID == item.BucketID); |
|
||||
if (BucketInfo_info != null) |
|
||||
{ |
|
||||
dm.BucketCode = BucketInfo_info.BucketCode; |
|
||||
dm.BucketName = BucketInfo_info.BucketName; |
|
||||
} |
|
||||
|
|
||||
modelList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
JsonDataModel<Paint_BucketModel> md = new JsonDataModel<Paint_BucketModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = modelList; |
|
||||
return JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddRelation(tb_Paint_Bucket md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = dbPB.SearchAllInfo().Where(p => p.PaintID == md.PaintID && p.BucketID == md.BucketID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
return dbPB.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateRelation(tb_Paint_Bucket md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = dbPB.SearchAllInfo().Where(p => p.PaintID == md.PaintID && p.ID != md.ID && p.BucketID == md.BucketID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[2]; |
|
||||
proNames[0] = "PaintID"; |
|
||||
proNames[1] = "BucketID"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return dbPB.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public bool DeleteRelation(tb_Paint_Bucket md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
List<tb_Paint_Bucket> ef = dbPB.SearchInfoByKey("ID", md.ID); |
|
||||
if (ef!=null && ef.Count>0) |
|
||||
{ |
|
||||
return dbPB.DelInfo(ef.First()); |
|
||||
} |
|
||||
return false; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
@ -1,165 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class PlaceBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Place> db = new BasicBLL<tb_Place>(); |
|
||||
/// <summary>
|
|
||||
/// 查询信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfo(string page, string pagesize, string PlaceName, string FactoryID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_Place> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(FactoryID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.FactoryID == FactoryID).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(PlaceName)) |
|
||||
{ |
|
||||
list = list.Where(p => p.PlaceName.Contains(PlaceName)).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
#region 联查
|
|
||||
List<PlaceModel> ModelList = new List<PlaceModel>(); |
|
||||
BasicBLL<tb_Factory> p_db = new BasicBLL<tb_Factory>(); |
|
||||
var p_list = p_db.SearchAllInfo().ToList(); |
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
PlaceModel dm = Tool.Mapper<PlaceModel, tb_Place>(item); |
|
||||
var info = p_list.FirstOrDefault(p => p.FactoryID == item.FactoryID); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
dm.FactoryName = info.FactoryName; |
|
||||
} |
|
||||
ModelList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
JsonDataModel<PlaceModel> md = new JsonDataModel<PlaceModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = ModelList; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<PlaceModel>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 添加信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Place md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("PlaceName", md.PlaceName);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.PlaceID != md.PlaceID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Place md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.PlaceName == md.PlaceName && p.PlaceID != md.PlaceID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[3]; |
|
||||
proNames[0] = "FactoryID"; |
|
||||
proNames[1] = "PlaceName"; |
|
||||
proNames[2] = "Des"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
/// 删除生产线信息
|
|
||||
public bool DelInfo(tb_Place md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_Place>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,471 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class ProductBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Product> db = new BasicBLL<tb_Product>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Product md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("StockNo", md.StockNo);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.ProductID != md.ProductID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Product md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.StockNo == md.StockNo && p.ProductID != md.ProductID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[] { |
|
||||
"StockNo", |
|
||||
"ProductTypeID", |
|
||||
"CarTypeID", |
|
||||
"PartName", |
|
||||
"ProductName", |
|
||||
"ColorName", |
|
||||
"PartNo", |
|
||||
"Rows", |
|
||||
"Cols", |
|
||||
"Layers", |
|
||||
"Des", |
|
||||
"isImport", |
|
||||
"PackCount", |
|
||||
"OpenFailNum", |
|
||||
"QLevel", |
|
||||
"IsPrintOneTag", |
|
||||
"IsPrintPackList", |
|
||||
"IsSupply", |
|
||||
"IsOneMore", |
|
||||
"BackPlatingNum", |
|
||||
"IsPlating", |
|
||||
"IsSame" |
|
||||
}; |
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
md.PicturePath = ""; |
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_Product md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string stockNo, string productTypeID, string productName, string partNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
|
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_Product> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(stockNo)) |
|
||||
{ |
|
||||
list = list.Where(p => p.StockNo != null && p.StockNo.Contains(stockNo)).ToList(); |
|
||||
} |
|
||||
if (!String.IsNullOrEmpty(productTypeID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.ProductTypeID.Equals(productTypeID)).ToList(); |
|
||||
} |
|
||||
if (!String.IsNullOrEmpty(productName)) |
|
||||
{ |
|
||||
list = list.Where(p => p.ProductName != null && p.ProductName.Contains(productName)).ToList(); |
|
||||
} |
|
||||
if (!String.IsNullOrEmpty(partNo)) |
|
||||
{ |
|
||||
list = list.Where(p => p.PartNo != null && p.PartNo.Contains(partNo)).ToList(); |
|
||||
} |
|
||||
List<ProductModel> modelList = new List<ProductModel>(); |
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
|
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
|
|
||||
#region 联查
|
|
||||
BasicBLL<tb_ProductType> s_db = new BasicBLL<tb_ProductType>(); |
|
||||
BasicBLL<tb_CarType> carTypeDB = new BasicBLL<tb_CarType>(); |
|
||||
var s_list = s_db.SearchAllInfo(); |
|
||||
var carTypeList = carTypeDB.SearchAllInfo(); |
|
||||
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
ProductModel dm = Tool.Mapper<ProductModel, tb_Product>(item); |
|
||||
var info = s_list.FirstOrDefault(p => p.ProductTypeID == item.ProductTypeID); |
|
||||
var cartype = carTypeList.FirstOrDefault(p => p.ID == item.CarTypeID); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
dm.ProductTypeName = info.ProductTypeName; |
|
||||
} |
|
||||
if (cartype != null) |
|
||||
{ |
|
||||
dm.CarTypeName = cartype.CarTypeName; |
|
||||
} |
|
||||
modelList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
|
|
||||
|
|
||||
JsonDataModel<ProductModel> md = new JsonDataModel<ProductModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = modelList; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<ProductModel>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public List<tb_Product> SearchAll() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var s_list = db.SearchAllInfo().ToList(); |
|
||||
return s_list; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string SearchInfoByIsOneMore(string isOneMore) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.Search<tb_Product>(q => q.IsOneMore == isOneMore).ToList().ToSerializer(); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_Product SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxProductAll() |
|
||||
{ |
|
||||
return SearchAll().ToSerializer(); |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData(string productTypeNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
|
|
||||
BasicBLL<tb_ProductType> productTypeDB = new BasicBLL<tb_ProductType>(); |
|
||||
|
|
||||
var info = from m in db.SearchAllInfo().ToList() |
|
||||
join s in productTypeDB.SearchAllInfo().ToList() on m.ProductTypeID equals s.ProductTypeID into val2Grp |
|
||||
from grp in val2Grp.DefaultIfEmpty() |
|
||||
where grp.ProductTypeNo == productTypeNo |
|
||||
select new { m.PartNo, PartName = m.PartNo + "----" + m.ProductName }; |
|
||||
string jsonStr = "[]"; |
|
||||
jsonStr = JSONTools.ScriptSerialize(info); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxProduct(string productTypeNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
|
|
||||
BasicBLL<tb_ProductType> productTypeDB = new BasicBLL<tb_ProductType>(); |
|
||||
|
|
||||
|
|
||||
var info = from m in db.SearchAllInfo().ToList() |
|
||||
join s in productTypeDB.SearchAllInfo().ToList() on m.ProductTypeID equals s.ProductTypeID into val2Grp |
|
||||
from grp in val2Grp.DefaultIfEmpty() |
|
||||
where grp.ProductTypeNo == productTypeNo |
|
||||
select new { m.ProductID, m.ProductName }; |
|
||||
string jsonStr = "[]"; |
|
||||
jsonStr = JSONTools.ScriptSerialize(info); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxDataForStockNo(string productTypeNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
|
|
||||
BasicBLL<tb_ProductType> productTypeDB = new BasicBLL<tb_ProductType>(); |
|
||||
|
|
||||
var info = from m in db.SearchAllInfo().ToList() |
|
||||
join s in productTypeDB.SearchAllInfo().ToList() on m.ProductTypeID equals s.ProductTypeID into val2Grp |
|
||||
from grp in val2Grp.DefaultIfEmpty() |
|
||||
where grp.ProductTypeNo == productTypeNo |
|
||||
select new { c_id = m.StockNo, c_text = m.PartNo + "--" + m.ProductName, c_name = m.StockNo + "--" + m.ProductName,c_name2 = m.PartNo }; |
|
||||
string jsonStr = "[]"; |
|
||||
jsonStr = JSONTools.ScriptSerialize(info); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoByType(string type, string stationNo) |
|
||||
{ |
|
||||
ProductDAL da = new ProductDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchInfoByType(type, stationNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoAllByType(string type) |
|
||||
{ |
|
||||
ProductDAL da = new ProductDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchInfoAllByType(type); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoByName(string productName, string ProductTypeNo) |
|
||||
{ |
|
||||
ProductDAL da = new ProductDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchInfoByName(productName, ProductTypeNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoByPartNo(string partNo) |
|
||||
{ |
|
||||
ProductDAL da = new ProductDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchInfoByPartNo(partNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchIsImportByStockNo(string stockNo) |
|
||||
{ |
|
||||
ProductDAL da = new ProductDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchIsImportByStockNo(stockNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchIsImportByPartNo(string partNo) |
|
||||
{ |
|
||||
ProductDAL da = new ProductDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchIsImportByPartNo(partNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoByProductName(string ProductName) |
|
||||
{ |
|
||||
ProductDAL da = new ProductDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchInfoByProductName(ProductName); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool UpdatePDF(string id, string fileName) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
tb_Product md = new tb_Product(); |
|
||||
md.ProductID = id; |
|
||||
md.PicturePath = fileName; |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[1]; |
|
||||
proNames[0] = "PicturePath"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoAll() |
|
||||
{ |
|
||||
ProductDAL da = new ProductDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchInfoAll(); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoByStock(string StockNo) |
|
||||
{ |
|
||||
ProductDAL da = new ProductDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.SearchInfoByStock(StockNo); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,169 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class ProductColorBLL |
|
||||
{ |
|
||||
BBMPTEntities ef = new BBMPTEntities(); |
|
||||
BasicBLL<tb_Product_Color> db = new BasicBLL<tb_Product_Color>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize, string productID, string colorID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
IEnumerable<tb_Product_Color> list = db.SearchAllInfo(); |
|
||||
if (!string.IsNullOrEmpty(productID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.ProductID.Equals(productID)); |
|
||||
} |
|
||||
if (!string.IsNullOrEmpty(colorID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.ColorID.Contains(colorID)); |
|
||||
} |
|
||||
|
|
||||
if (list.Any()) |
|
||||
{ |
|
||||
List<ProductColorModel> modelList = new List<ProductColorModel>(); |
|
||||
total = list.Count(); |
|
||||
|
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
|
|
||||
#region 联查
|
|
||||
BasicBLL<tb_Product> product_db = new BasicBLL<tb_Product>(); |
|
||||
var product_list = product_db.SearchAllInfo(); |
|
||||
|
|
||||
BasicBLL<tb_Color> station_db = new BasicBLL<tb_Color>(); |
|
||||
var station_list = station_db.SearchAllInfo(); |
|
||||
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
ProductColorModel dm = Tool.Mapper<ProductColorModel, tb_Product_Color>(item); |
|
||||
var product_info = product_list.FirstOrDefault(p => p.ProductID == item.ProductID); |
|
||||
if (product_info != null) |
|
||||
{ |
|
||||
dm.PartNo = product_info.PartNo; |
|
||||
dm.ProductName = product_info.ProductName; |
|
||||
} |
|
||||
|
|
||||
var color_info = station_list.FirstOrDefault(p => p.ID == item.ColorID); |
|
||||
if (color_info != null) |
|
||||
{ |
|
||||
dm.ColorNo = color_info.ColorNo; |
|
||||
dm.ColorName = color_info.Des; |
|
||||
} |
|
||||
|
|
||||
modelList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
|
|
||||
JsonDataModel<ProductColorModel> md = new JsonDataModel<ProductColorModel> |
|
||||
{ |
|
||||
total = total.ToString(), |
|
||||
rows = modelList |
|
||||
}; |
|
||||
jsonStr = JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Product_Color md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => |
|
||||
p.ColorID == md.ColorID && |
|
||||
p.ProductID == md.ProductID); |
|
||||
if (list.Where(p => p.ID != md.ID).Any()) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Product_Color md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.ColorID == md.ColorID && p.ProductID != md.ProductID);//判断是否有重复数据
|
|
||||
if (list.Any()) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[] { "ProductID", "ColorID" }; |
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_Product_Color md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
|
@ -1,83 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
using MESClassLibrary.Model; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class ProductOfInjectionBLL |
|
||||
{ |
|
||||
ProductOfInjectionDAL db=new ProductOfInjectionDAL(); |
|
||||
|
|
||||
public bool Add_Info(ProductOfInjectionModel md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable SearchCountByInfo(string station, string date, string classname, string StockNo,string partno) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchCountByInfo(station,date,classname,StockNo,partno); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool Update_Info(ProductOfInjectionModel md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.UpdateInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool UpdateBad_Info(ProductOfInjectionModel md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.UpdteBadInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool updateProductCount(ProductOfInjectionModel md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.updateProductCount(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,182 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class ProductTypeBLL |
|
||||
{ |
|
||||
BasicBLL<tb_ProductType> db = new BasicBLL<tb_ProductType>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 新增信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_ProductType md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("ProductTypeNo", md.ProductTypeNo);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.ProductTypeID != md.ProductTypeID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_ProductType md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.ProductTypeNo == md.ProductTypeNo && p.ProductTypeID != md.ProductTypeID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[2]; |
|
||||
proNames[0] = "ProductTypeName"; |
|
||||
proNames[1] = "Des"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 删除信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md"></param>
|
|
||||
/// <param name="flag"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool DeleteInfo(tb_ProductType md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息分页
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfoAll(string page, string pagesize) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_ProductType> list = db.SearchInfoAll(Convert.ToInt32(page), Convert.ToInt32(pagesize), out total);//按分页查询
|
|
||||
JsonDataModel<tb_ProductType> md = new JsonDataModel<tb_ProductType>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = list; |
|
||||
return JSONTools.ScriptSerialize(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 查询全部信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public List<tb_ProductType> SearchAll() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var s_list = db.SearchAllInfo().ToList(); |
|
||||
return s_list; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// 根据ID查询信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="id"></param>
|
|
||||
/// <returns></returns>
|
|
||||
public tb_ProductType SearchInfoByID(string id) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByID(id); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
item.ProductTypeName = item.ProductTypeNo + "----" + item.ProductTypeName; |
|
||||
} |
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_ProductType>>(list); |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,201 +0,0 @@ |
|||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.EFModel; |
|
||||
using MESClassLibrary.Model; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using System.Data; |
|
||||
using System.Data.SqlClient; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.BasicInfo |
|
||||
{ |
|
||||
public class StationBLL |
|
||||
{ |
|
||||
BasicBLL<tb_Station> db = new BasicBLL<tb_Station>(); |
|
||||
/// <summary>
|
|
||||
/// 查询信息
|
|
||||
/// </summary>
|
|
||||
/// <returns></returns>
|
|
||||
public string SearchInfo(string page, string pagesize, string StationNo, string LineID) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
int total = 0;//总行数
|
|
||||
List<tb_Station> list = db.SearchAllInfo(); |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(LineID)) |
|
||||
{ |
|
||||
list = list.Where(p => p.LineID == LineID).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (!String.IsNullOrEmpty(StationNo)) |
|
||||
{ |
|
||||
list = list.Where(p => p.StationNo.Contains(StationNo)).ToList();//按条件分页查询
|
|
||||
} |
|
||||
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
total = list.Count; |
|
||||
int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); |
|
||||
list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); |
|
||||
|
|
||||
#region 联查
|
|
||||
List<StationModel> StationList = new List<StationModel>(); |
|
||||
BasicBLL<tb_Line> pl_db = new BasicBLL<tb_Line>(); |
|
||||
var pl_list = pl_db.SearchAllInfo().ToList(); |
|
||||
foreach (var item in list) |
|
||||
{ |
|
||||
StationModel dm = Tool.Mapper<StationModel, tb_Station>(item); |
|
||||
var info = pl_list.FirstOrDefault(p => p.LineID == item.LineID); |
|
||||
if (info != null) |
|
||||
{ |
|
||||
dm.LineName = info.LineName; |
|
||||
} |
|
||||
StationList.Add(dm); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
JsonDataModel<StationModel> md = new JsonDataModel<StationModel>(); |
|
||||
md.total = total.ToString(); |
|
||||
md.rows = StationList; |
|
||||
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<StationModel>>(md); |
|
||||
} |
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 添加信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool AddInfo(tb_Station md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchInfoByKey("StationNo", md.StationNo);//判断是否有重复数据
|
|
||||
if (list != null) |
|
||||
{ |
|
||||
if (list.Where(p => p.StationID != md.StationID).Count() > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
return db.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
/// <summary>
|
|
||||
/// 修改信息
|
|
||||
/// </summary>
|
|
||||
/// <param name="md">生产线模型对象</param>
|
|
||||
/// <returns></returns>
|
|
||||
public bool UpdateInfo(tb_Station md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().Where(p => p.StationNo == md.StationNo && p.StationID != md.StationID).ToList();//判断是否有重复数据
|
|
||||
if (list.Count > 0) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
//初始化要更新的字段
|
|
||||
string[] proNames = new string[3]; |
|
||||
proNames[0] = "LineID"; |
|
||||
proNames[1] = "StationNo"; |
|
||||
proNames[2] = "Des"; |
|
||||
|
|
||||
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
|
|
||||
//如果没有初始化必填字段,更新会报错
|
|
||||
//md.Des = "";
|
|
||||
|
|
||||
return db.UpdateInfo(md, proNames); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
/// 删除生产线信息
|
|
||||
public bool DelInfo(tb_Station md) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
return db.DelInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public string GetComboboxData(string StationNo) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
string jsonStr = "[]"; |
|
||||
if (StationNo == null || StationNo == "") |
|
||||
{ |
|
||||
var list = db.SearchAllInfo().ToList();//判断是否有重复数据
|
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_Station>>(list); |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
var list = db.SearchInfoContains("StationNo", StationNo).ToList();//判断是否有重复数据
|
|
||||
jsonStr = JSONTools.ScriptSerialize<List<tb_Station>>(list); |
|
||||
} |
|
||||
|
|
||||
return jsonStr; |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
return ""; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
public DataTable SearchInfoByNo(string station) |
|
||||
{ |
|
||||
StationDAL db = new StationDAL(); |
|
||||
|
|
||||
try |
|
||||
{ |
|
||||
return db.SearchInfoByNo(station); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public List<tb_Station> SearchAll() |
|
||||
{ |
|
||||
return db.SearchAllInfo(); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
@ -1,29 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.DAL.ExchangeCenter; |
|
||||
using MESClassLibrary.Model; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.ExchangeCenter |
|
||||
{ |
|
||||
public class GetNewTasksBLL |
|
||||
{ |
|
||||
public bool AddInfo(GetNewTasksModel md) |
|
||||
{ |
|
||||
GetNewTasksDAL da = new GetNewTasksDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,29 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.DAL.ExchangeCenter; |
|
||||
using MESClassLibrary.Model; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.ExchangeCenter |
|
||||
{ |
|
||||
public class PartMstrBLL |
|
||||
{ |
|
||||
public bool AddInfo(PartMstrModel md) |
|
||||
{ |
|
||||
PartMstrDAL da = new PartMstrDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,29 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.DAL.BasicInfo; |
|
||||
using MESClassLibrary.DAL.ExchangeCenter; |
|
||||
using MESClassLibrary.Model; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.ExchangeCenter |
|
||||
{ |
|
||||
public class PartRecordBLL |
|
||||
{ |
|
||||
public bool AddInfo(PartRecordModel md) |
|
||||
{ |
|
||||
PartRecordDAL dal = new PartRecordDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return dal.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,58 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Data; |
|
||||
using System.Linq; |
|
||||
using System.Reflection; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using MESClassLibrary.BLL.Log; |
|
||||
using MESClassLibrary.DAL.ExchangeCenter; |
|
||||
using MESClassLibrary.Model; |
|
||||
|
|
||||
namespace MESClassLibrary.BLL.ExchangeCenter |
|
||||
{ |
|
||||
public class TESBomBLL |
|
||||
{ |
|
||||
public bool AddInfo(TESBomModel md) |
|
||||
{ |
|
||||
TESBomDAL da = new TESBomDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.AddInfo(md); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public DataTable Search() |
|
||||
{ |
|
||||
TESBomDAL da=new TESBomDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.Search(); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public bool updateFlag(string TaskID) |
|
||||
{ |
|
||||
TESBomDAL da = new TESBomDAL(); |
|
||||
try |
|
||||
{ |
|
||||
return da.UpdateFlag(TaskID); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|