FrmInOnlineStore.cs 113 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Core.StlMes.Client.ZGMil.Entity;
  11. using System.Collections;
  12. using Core.Mes.Client.Comm.Server;
  13. using Core.Mes.Client.Comm.Tool;
  14. using Core.Mes.Client.Comm.Control;
  15. using Infragistics.Win.UltraWinGrid;
  16. using Core.Mes.Client.Comm.Format;
  17. using Infragistics.Win.UltraWinEditors;
  18. using Infragistics.Win;
  19. using Core.StlMes.Client.ZGMil.NodeResultQuery;
  20. using Core.StlMes.Client.ZGMil.ResultConrtrol;
  21. using Core.StlMes.Client.ZGMil.Common;
  22. namespace Core.StlMes.Client.ZGMil.Signature
  23. {
  24. public partial class FrmInOnlineStore : FrmBase
  25. {
  26. private string[] plineCodes = { };
  27. public FrmInOnlineStore()
  28. {
  29. InitializeComponent();
  30. }
  31. string Group = "";
  32. private string Departm = "";//部门
  33. private string PlineCode = "";//产线
  34. private string _UserName = ""; //签名 姓名
  35. private string _UserID = ""; //签名 签名ID
  36. private string proPlanId = "";//轧管订单编号
  37. private string gxPlanNo = "";//工序排产序号
  38. /// <summary>
  39. /// 重写基类方法
  40. /// </summary>
  41. /// <param name="sender"></param>
  42. /// <param name="ToolbarKey"></param>
  43. public override void ToolBar_Click(object sender, string ToolbarKey)
  44. {
  45. switch (ToolbarKey)
  46. {
  47. case "DoQuery":
  48. QuerySinglePlan();
  49. break;
  50. case"DoQueryMat":
  51. QueryMat();
  52. break;
  53. case"DoQueryMatB":
  54. QueryMatButess();
  55. break;
  56. case"DoQueryInList":
  57. DoQueryInList();
  58. break;
  59. case"cancelInList":
  60. cancelInList();
  61. break;
  62. case "DoSave":
  63. DoSave();
  64. break;
  65. case "DoSaveShort":
  66. DoSaveShort();
  67. break;
  68. case "DoDecision":
  69. DoDecision();
  70. break;
  71. case "cancelDoDecision":
  72. cancelDoDecision();
  73. break;
  74. case "DoBeside":
  75. doBeside();
  76. break;
  77. case "cancelDoBeside":
  78. cancelDoBeside();
  79. break;
  80. case"Print":
  81. printPipe();
  82. break;
  83. case"OfflineXX":
  84. OfflineXX();
  85. break;
  86. case "insertProssWt":
  87. insertProssWt();
  88. break;
  89. case"adjustWgt":
  90. adjustWgt();
  91. break;
  92. case "QuXiang":
  93. QuXiang();
  94. break;
  95. case "Export":
  96. ExportData();
  97. break;
  98. case "Close":
  99. this.Close();
  100. break;
  101. }
  102. }
  103. /// <summary>
  104. /// 短尺交库
  105. /// </summary>
  106. private void DoSaveShort()
  107. {
  108. FrmShortRuler QADefect = new FrmShortRuler("", this.ob);
  109. QADefect.ShowDialog();
  110. if (QADefect.DialogResult == DialogResult.OK)
  111. {
  112. ArrayList shortList = QADefect.shortList;
  113. int acount = QADefect.acount;
  114. DoSave(shortList, acount);
  115. }
  116. }
  117. /// <summary>
  118. /// 短尺交库
  119. /// </summary>
  120. /// <param name="list"></param>
  121. private void DoSave(ArrayList shortList,int acountNum)
  122. {
  123. string strInbound = "800701";//入库类型
  124. string strInMemo = "";
  125. string surplusFlag = "";//是否余材标识
  126. string sampleFlag = "";//是否减取样长度标识
  127. int k = 0;
  128. int b = 0;
  129. this.ultraGrid3.UpdateData();
  130. this.ultraGrid2.UpdateData();
  131. DataTable dte = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortMilState", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
  132. int acount = int.Parse(dte.Rows[0]["acount"].ToString2());
  133. int acount2 = int.Parse(dte.Rows[0]["acount2"].ToString2());
  134. if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" && acount > 0 && acount2 <= 0)
  135. {
  136. MessageUtil.ShowTips("有样管未交库,请先交样管!");
  137. return;
  138. }
  139. if (!textMemo.Text.Trim().ToString().Equals(""))
  140. {
  141. if (!StringUtil.IsNumber(textMemo.Text.Trim().ToString()))
  142. {
  143. MessageUtil.ShowTips("请输入正确的短尺长度!");
  144. return;
  145. }
  146. }
  147. DataTable dtMemo = PipeManageClass.getComTypeInfo(strInbound, ob);
  148. if (dtMemo.Rows.Count >= 1)
  149. {
  150. strInMemo = dtMemo.Rows[0]["MEMO"].ToString();
  151. }
  152. NativeMethodNew na = new NativeMethodNew(this.ob);
  153. string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
  154. ArrayList list = new ArrayList();
  155. DataTable ds = null;
  156. ds = getStoreNo(plinCode); //取对应产线产出库
  157. if (ds == null)
  158. {
  159. MessageUtil.ShowTips("无轧管在线库基础信息,请维护!");
  160. return;
  161. }
  162. string storageNo = ds.Rows[0]["STORAGE_NO"].ToString();
  163. //选择250中间库,168中间库则去中间库;
  164. if (this.cmbStorage.Value.ToString2().Equals("BZJ1") || this.cmbStorage.Value.ToString2().Equals("BZJ2"))
  165. {
  166. storageNo = this.cmbStorage.Value.ToString2();
  167. }
  168. DataTable dtDept = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryDept", new object[] { plinCode }, ob);
  169. string Deptid = dtDept.Rows[0]["DEPARTMENT_CODE"].ToString();
  170. string Department = dtDept.Rows[0]["DEPARTMENT_DESC"].ToString();
  171. list.Add(storageNo);
  172. list.Add(storageNo + "10101");
  173. list.Add(ds.Rows[0]["STORAGE_TYPE_NO"].ToString());
  174. list.Add(ds.Rows[0]["STORAGE_TYPE_NAME"].ToString());
  175. list.Add(this.UserInfo.GetUserName());
  176. list.Add(Deptid);
  177. list.Add(Department);
  178. list.Add(Deptid);
  179. list.Add(Department);
  180. list.Add(this.UserInfo.GetUserOrder());
  181. list.Add(this.UserInfo.GetUserGroup());
  182. ArrayList parm = new ArrayList();
  183. if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.Trim() == "待处理")
  184. {
  185. MessageUtil.ShowTips("待处理品不允许进行入库!");
  186. return;
  187. }
  188. if (this.cmbStorage.Value.ToString2() == "")
  189. {
  190. MessageUtil.ShowTips("请选择去向,再进行交库!");
  191. return;
  192. }
  193. MilPlanEntity3 mi = (MilPlanEntity3)this.ultraGrid3.ActiveRow.ListObject;
  194. mi.PlineCode = plinCode;
  195. if (plinCode == "C009")
  196. {
  197. mi.PlineName = "258机组";
  198. }
  199. else if (plinCode == "C008")
  200. {
  201. mi.PlineName = "250机组";
  202. }
  203. else if (plinCode == "C010")
  204. {
  205. mi.PlineName = "168机组";
  206. }
  207. else if (plinCode == "C017")
  208. {
  209. mi.PlineName = "460机组";
  210. }
  211. else if (plinCode == "C072")
  212. {
  213. mi.PlineName = "天淮508机组";
  214. }
  215. if (mi.MaterialDesc.Equals(""))
  216. {
  217. mi.MaterialDesc = this.ultraGrid1.ActiveRow.Cells["OUTWL_DESC"].Text.ToString();
  218. }
  219. string milPlanTity = JSONFormat.Format(mi);
  220. int s = 0;
  221. int m = 0;
  222. int n = 0;
  223. int z = 0;
  224. int y = 0;
  225. int p = 0;
  226. int num = 0;
  227. int x = 0;
  228. int totalNum = 0;
  229. foreach (UltraGridRow uRow in ultraGrid2.Rows)
  230. {
  231. if (uRow.Cells["BATCH_NO"].Text == "")
  232. {
  233. s = s + 1;
  234. }
  235. }
  236. if (s > 0)
  237. {
  238. MessageUtil.ShowTips("未进行分批,不允许交库!");
  239. return;
  240. }
  241. foreach (UltraGridRow row1 in ultraGrid2.Rows)
  242. {
  243. if (Convert.ToBoolean(row1.Cells["CHK"].Value) == true)
  244. {
  245. if (row1.Cells["ACT_LEN"].Value.ToString2() != "")
  246. {
  247. if (double.Parse(row1.Cells["ACT_LEN"].Value.ToString2()) > 0)
  248. {
  249. }
  250. else
  251. {
  252. m = m + 1;
  253. }
  254. }
  255. else
  256. {
  257. m = m + 1;
  258. }
  259. if (row1.Cells["ACT_COUNT"].Value.ToString2() != "")
  260. {
  261. if (int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2()) > 0)
  262. {
  263. }
  264. else
  265. {
  266. n = n + 1;
  267. }
  268. }
  269. else
  270. {
  271. n = n + 1;
  272. }
  273. if (row1.Cells["ACT_WEIGHT"].Value.ToString2() != "")
  274. {
  275. if (double.Parse(row1.Cells["ACT_WEIGHT"].Value.ToString2()) > 0)
  276. {
  277. }
  278. else
  279. {
  280. z = z + 1;
  281. }
  282. }
  283. else
  284. {
  285. z = z + 1;
  286. }
  287. if (row1.Cells["BATCH_NO"].Value.ToString2() == "")
  288. {
  289. y = y + 1;
  290. }
  291. if (row1.Cells["THACT_COUNT"].Text.ToString3() != "")
  292. {
  293. if (int.Parse(row1.Cells["ACT_COUNT"].Text.ToString3()) + int.Parse(row1.Cells["INSTORECOUNT"].Text.ToString3()) > int.Parse(row1.Cells["THACT_COUNT"].Text.ToString3()))
  294. {
  295. x = x + 1;
  296. }
  297. }
  298. ArrayList parm1 = new ArrayList();
  299. parm1.Add(row1.Cells["ACT_LEN"].Value.ToString2());
  300. parm1.Add(row1.Cells["ACT_COUNT"].Value.ToString2());
  301. parm1.Add(row1.Cells["ACT_WEIGHT"].Value.ToString2());
  302. parm1.Add(row1.Cells["BATCH_NO"].Value.ToString2());
  303. if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" || this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "样管")
  304. {
  305. parm1.Add("40740401");//探伤结果
  306. parm1.Add("40740601");//表检结果
  307. }
  308. else if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "判废")
  309. {
  310. parm1.Add("");//探伤结果
  311. parm1.Add("");//表检结果
  312. }
  313. parm1.Add(row1.Cells["THACT_COUNT"].Value.ToString3());
  314. parm.Add(parm1);
  315. totalNum = totalNum + int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2());
  316. num++;
  317. }
  318. }
  319. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  320. int offlinePro = checkMagRows.GroupBy(a => a.GetValue("BATCH_NO")).Count();
  321. if (checkMagRows.Count() > 1)
  322. {
  323. if (offlinePro == 1)
  324. {
  325. MessageUtil.ShowTips("批号一样,长度不一样请分开交库!");
  326. return;
  327. }
  328. }
  329. if (num <= 0)
  330. {
  331. MessageUtil.ShowTips("请勾选产出信息!");
  332. return;
  333. }
  334. if (m > 0)
  335. {
  336. MessageUtil.ShowTips("长度不能为空,必须大于零!");
  337. return;
  338. }
  339. if (n > 0)
  340. {
  341. MessageUtil.ShowTips("支数不能为空,必须大于零!");
  342. return;
  343. }
  344. if (!acountNum.Equals(int.Parse(this.ultraGrid2.ActiveRow.Cells["ACT_COUNT"].Text.ToString3())))
  345. {
  346. MessageUtil.ShowTips("请确认短尺交库的支数!");
  347. return;
  348. }
  349. if (z > 0)
  350. {
  351. MessageUtil.ShowTips("重量不能为空,必须大于零!");
  352. return;
  353. }
  354. if (y > 0)
  355. {
  356. MessageUtil.ShowTips("批号不能为空,请选择!");
  357. return;
  358. }
  359. if (x > 0)
  360. {
  361. MessageUtil.ShowTips("输入的实际支数加已在线库支数不能大于理论支数!");
  362. return;
  363. }
  364. if (this.surplusChk.Checked)
  365. {
  366. surplusFlag = "1";
  367. }
  368. else
  369. {
  370. surplusFlag = "0";
  371. }
  372. if (this.sampleLen.Checked)
  373. {
  374. sampleFlag = "1";
  375. }
  376. else
  377. {
  378. sampleFlag = "0";
  379. }
  380. if (mi.Target.ToString().Equals("A") && surplusFlag == "1")
  381. {
  382. MessageUtil.ShowTips("A字头不允许进行无合同交库!");
  383. return;
  384. }
  385. string contractNo = this.ultraGrid1.ActiveRow.Cells["ORDER_NO"].Text.Trim();
  386. string target = "";
  387. string pckFlag = "";//打捆标志
  388. string matRturnFlag = "";//交货材料要求标志
  389. string testType = "";//双探类别
  390. string testGrade = "";//等级
  391. DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlan", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
  392. target = dd.Rows[0]["TARGET"].ToString();
  393. if (target.Equals("A"))
  394. {
  395. DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryOrderAsk", new object[] { contractNo }, ob);
  396. if (dt.Rows.Count > 0)
  397. {
  398. for (int i = 0; i < dt.Rows.Count; i++)
  399. {
  400. if (dt.Rows[i]["ASK_SUB_ITME_VAL_DESC"].ToString().Contains("打捆"))
  401. {
  402. k = k + 1;
  403. }
  404. else if (dt.Rows[i]["ASK_ITME"].ToString().Equals("121009"))
  405. {
  406. b = b + 1;
  407. }
  408. }
  409. }
  410. if (k > 0 && b > 0)
  411. {
  412. if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆、交货材料是否满足要求?") == DialogResult.No)
  413. {
  414. return;
  415. }
  416. pckFlag = "1";
  417. matRturnFlag = "1";
  418. }
  419. else if (k > 0 && b < 1)
  420. {
  421. if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆是否满足要求?") == DialogResult.No)
  422. {
  423. return;
  424. }
  425. pckFlag = "1";
  426. matRturnFlag = "0";
  427. }
  428. else if (b > 0 && k < 1)
  429. {
  430. if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求交货材料是否满足要求?") == DialogResult.No)
  431. {
  432. return;
  433. }
  434. pckFlag = "0";
  435. matRturnFlag = "1";
  436. }
  437. else
  438. {
  439. pckFlag = "0";
  440. matRturnFlag = "0";
  441. }
  442. if (doQueryPk(this.ultraGrid8.ActiveRow.Cells["ORD_LN_DLY_PK"].Value.ToString()))
  443. {
  444. DataTable dtest = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryEntrustT", new object[] { BaseMethod.getJudgeStoveNo(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text), proPlanId, gxPlanNo }, ob);
  445. if (dtest.Rows.Count > 0)
  446. {
  447. testType = "UT";
  448. testGrade = dtest.Rows[0][0].ToString();
  449. }
  450. else
  451. {
  452. MessageUtil.ShowTips("此炉是需要进行双探的管子,需走离线委外加工!");
  453. return;
  454. }
  455. }
  456. }
  457. DataTable portDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
  458. string portCount = portDt.Rows[0][0].ToString3();//理论支数
  459. DataTable matDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
  460. string matCount = matDt.Rows[0][0].ToString3();//已交库支
  461. DataTable instoreDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeLXCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
  462. string pipeLXCount = instoreDt.Rows[0][0].ToString3(); //交库点离线支
  463. if (totalNum + int.Parse(matCount) + int.Parse(pipeLXCount) > int.Parse(portCount))
  464. {
  465. MessageUtil.ShowTips("总交库支数已大于产出支数,请核对支数再交库!");
  466. return;
  467. }
  468. CoreClientParam ccp = new CoreClientParam();
  469. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  470. ccp.MethodName = "doPipeIn";
  471. ccp.ServerParams = new object[] { milPlanTity, list, parm, strInbound, strInMemo, this.cmbStorage.Value.ToString2(), this.cmbStorage.Text.Trim(), surplusFlag, sampleFlag, pckFlag, matRturnFlag, testType, testGrade, shortList };
  472. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  473. if (ccp.ReturnCode != -1)
  474. {
  475. if (ccp.ReturnInfo.Equals("交库成功!"))
  476. {
  477. QuerySinglePlan();
  478. MessageUtil.ShowTips(ccp.ReturnInfo);
  479. }
  480. else
  481. {
  482. MessageUtil.ShowTips(ccp.ReturnInfo);
  483. }
  484. }
  485. }
  486. /// <summary>
  487. /// 调整库去向
  488. /// </summary>
  489. private void QuXiang()
  490. {
  491. UltraGridRow uRow = this.ultraGrid8.ActiveRow;
  492. if (uRow == null) return;
  493. string jugeNo = BaseMethod.getJudgeStoveNo(uRow.Cells["JUDGE_STOVE_NO"].Text.ToString());
  494. string lotno = uRow.Cells["LOT_NO"].Text.Trim();
  495. if (this.cmbStorage.Value.ToString2() == "")
  496. {
  497. MessageUtil.ShowTips("请选择去向,再进行调整库去向!");
  498. return;
  499. }
  500. if (MessageUtil.ShowYesNoAndQuestion("是否确认调整库去向?") == DialogResult.No)
  501. {
  502. return;
  503. }
  504. CoreClientParam ccp = new CoreClientParam();
  505. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  506. ccp.MethodName = "updateQuXiang";
  507. ccp.ServerParams = new object[] { jugeNo, lotno, PlineCode, this.cmbStorage.Value.ToString2(), this.cmbStorage.Text.Trim() };
  508. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  509. if (ccp.ReturnCode != -1)
  510. {
  511. if (ccp.ReturnInfo.Equals("调整成功!"))
  512. {
  513. QuerySinglePlan();
  514. MessageUtil.ShowTips(ccp.ReturnInfo);
  515. }
  516. else
  517. {
  518. MessageUtil.ShowTips(ccp.ReturnInfo);
  519. }
  520. }
  521. }
  522. /// <summary>
  523. /// 下线点离线
  524. /// </summary>
  525. private void OfflineXX()
  526. {
  527. UltraGridRow uRow = this.ultraGrid8.ActiveRow;
  528. if (uRow == null) return;
  529. string jugeNo = uRow.Cells["JUDGE_STOVE_NO"].Text.Trim();
  530. string lotno = uRow.Cells["LOT_NO"].Text.Trim();
  531. string nodeStaus = uRow.Cells["NODE_STATUS"].Text.Trim();
  532. if(nodeStaus == "入库完成")
  533. {
  534. MessageUtil.ShowTips("入库完成了的炉信息不允许离线!");
  535. return;
  536. }
  537. DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { jugeNo, proPlanId, gxPlanNo }, this.ob);
  538. if (dtFlag.Rows.Count > 0)
  539. {
  540. if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
  541. {
  542. MessageBox.Show("未开始分切,不允许下线", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  543. return;
  544. }
  545. }
  546. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryJugeCount", new object[] { jugeNo }, ob);
  547. DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryOfflineEdCount", new object[] { jugeNo }, ob);
  548. //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
  549. string Node = "XX";
  550. //beforeQualifiedNum = this.rollingCard1.Value.SawQualifiedNum;
  551. string qualifiedNum = ds.Rows[0][0].ToString();
  552. string offineHas = dd.Rows[0][0].ToString();
  553. //offineHead = string.IsNullOrEmpty(this.rollingCard1.Value.BacklineStraight) ? "0" : this.rollingCard1.Value.BacklineStraight;
  554. string numb = (int.Parse(qualifiedNum) - int.Parse(offineHas)).ToString();
  555. FrmXiaXianOffLine frm = new FrmXiaXianOffLine(Node, this.ob, PlineCode, jugeNo, lotno, numb, proPlanId, gxPlanNo);
  556. frm.ShowDialog();
  557. QuerySinglePlan();
  558. }
  559. /// <summary>
  560. /// 根据外径、壁厚调整重量
  561. /// </summary>
  562. private void adjustWgt()
  563. {
  564. string dimer = this.txt_dimer.Text.Trim();
  565. string height = this.txt_height.Text.Trim();
  566. if (!StringUtil.IsDouble(dimer))
  567. {
  568. MessageUtil.ShowTips("外径应该为数字");
  569. return;
  570. }
  571. if (!StringUtil.IsDouble(height))
  572. {
  573. MessageUtil.ShowTips("壁厚应该为数字");
  574. return;
  575. }
  576. UltraGridRow uRow = this.ultraGrid8.ActiveRow;
  577. if(uRow == null)
  578. {
  579. MessageUtil.ShowTips("炉计划为空,不能调整重量!");
  580. return;
  581. }
  582. string jugeNo = uRow.Cells["JUDGE_NO"].Text;
  583. string wgt = (0.02466 * Math.Abs((double.Parse(dimer) - double.Parse(height))) * double.Parse(height)/1000).ToString2();
  584. if (MessageUtil.ShowYesNoAndQuestion("是否确认调整理论重量?") == DialogResult.No)
  585. {
  586. return;
  587. }
  588. CoreClientParam ccp = new CoreClientParam();
  589. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  590. ccp.MethodName = "adjustWgt";
  591. ccp.ServerParams = new object[] { jugeNo, wgt };
  592. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  593. if (ccp.ReturnCode != -1)
  594. {
  595. if (ccp.ReturnInfo.Equals("调整成功!"))
  596. {
  597. QuerySinglePlan();
  598. MessageUtil.ShowTips(ccp.ReturnInfo);
  599. }
  600. else
  601. {
  602. MessageUtil.ShowTips(ccp.ReturnInfo);
  603. }
  604. }
  605. }
  606. /// <summary>
  607. /// 回报过磅重量
  608. /// </summary>
  609. private void insertProssWt()
  610. {
  611. this.ultraGrid6.UpdateData();
  612. UltraGridRow uRow = this.ultraGrid6.ActiveRow;
  613. //string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  614. string departMentid = UserInfo.GetDeptid();
  615. if (uRow == null)
  616. {
  617. MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
  618. return;
  619. }
  620. if(uRow.Cells["ProductFlag"].Value.ToString() != "801402")
  621. {
  622. MessageUtil.ShowTips("只允许成品类回报过磅重量!");
  623. return;
  624. }
  625. if (Double.Parse(uRow.Cells["PonderGrossWt"].Value.ToString3()) <= 0)
  626. {
  627. MessageUtil.ShowTips("请输入正确的过磅重量!");
  628. return;
  629. }
  630. ArrayList list = new ArrayList();
  631. list.Add(uRow.Cells["JudgeStoveNo"].Value.ToString());
  632. list.Add(uRow.Cells["PonderGrossWt"].Value.ToString3());
  633. CoreClientParam ccp = new CoreClientParam();
  634. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  635. ccp.MethodName = "insertProssWt";
  636. ccp.ServerParams = new object[] { list, departMentid };
  637. ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
  638. if (ccp.ReturnCode != -1)
  639. {
  640. if (ccp.ReturnInfo.Equals("回报成功!"))
  641. {
  642. QueryMat();
  643. MatZcMEntity2bindingSource.Clear();
  644. MatZcMEntity2bindingSource.Clear();
  645. MessageUtil.ShowTips(ccp.ReturnInfo);
  646. }
  647. else
  648. {
  649. MessageUtil.ShowTips(ccp.ReturnInfo);
  650. }
  651. }
  652. }
  653. /// <summary>
  654. /// 打印入库单
  655. /// </summary>
  656. private void printPipe()
  657. {
  658. this.ultraGrid7.UpdateData();
  659. string jugeAppleCode = "";
  660. IQueryable<UltraGridRow> checkRows = this.ultraGrid7.Rows.AsQueryable().Where(a=>a.GetValue("CHK") == "True");
  661. if(checkRows.Count() == 0)
  662. {
  663. MessageUtil.ShowTips("请选择需要打印的判定数据信息!");
  664. return;
  665. }
  666. foreach (UltraGridRow uRow in checkRows)
  667. {
  668. jugeAppleCode = uRow.Cells["JugdeApplyCode"].Value.ToString();
  669. }
  670. if (jugeAppleCode == "")
  671. {
  672. MessageUtil.ShowTips("未申请判定,不允许打印缴库单!");
  673. return;
  674. }
  675. int jugeAppleM = checkRows.GroupBy(a => a.GetValue("JugdeApplyCode")).Count();
  676. if (jugeAppleM > 1)
  677. {
  678. MessageUtil.ShowTips("只有同一申请单号的信息才允许同时打印!");
  679. return;
  680. }
  681. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYM.cpt&format=pdf&JUGDE_APPLY_CODE=" + jugeAppleCode;
  682. FrmExcel fre = new FrmExcel(this.ob, strurl);
  683. fre.AutoSize = true;
  684. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  685. fre.WindowState = FormWindowState.Maximized;
  686. fre.Show();
  687. }
  688. /// <summary>
  689. /// 结炉回退
  690. /// </summary>
  691. private void cancelDoBeside()
  692. {
  693. this.ultraGrid1.UpdateData();
  694. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  695. if (uRow.Index < 0 || uRow == null)
  696. {
  697. MessageUtil.ShowTips("请选择需要结炉回退的主信息!");
  698. return;
  699. }
  700. string jugeNo = uRow.Cells["JUDGE_NO"].Text.Trim();
  701. string lotNo = uRow.Cells["LOT_NO"].Text.Trim();
  702. //string planId = uRow.Cells["ID"].Text.Trim();
  703. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryFApply", new object[] { jugeNo }, ob);//查询炉号是否有已申请判定的
  704. if (int.Parse(ds.Rows[0][0].ToString()) > 0)
  705. {
  706. MessageUtil.ShowTips("该炉已申请判定,不允许进行结炉回退!");
  707. return;
  708. }
  709. DataTable ds1 = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryFQY", new object[] { jugeNo }, ob);//查询炉号是否有已申请判定的
  710. if (int.Parse(ds1.Rows[0][0].ToString()) > 0)
  711. {
  712. MessageUtil.ShowTips("该炉有复取样废管,不允许进行结炉回退!");
  713. return;
  714. }
  715. if (MessageUtil.ShowYesNoAndQuestion("是否确认结炉回退?") == DialogResult.No)
  716. {
  717. return;
  718. }
  719. //int count = ServerHelper.SetData("com.steering.mes.signature.FrmInOnlineStore.cancelDoBeside", new object[] { jugeNo,lotNo,PlineCode, proPlanId, gxPlanNo }, ob);
  720. CoreClientParam ccp = new CoreClientParam();
  721. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  722. ccp.MethodName = "cancelDoBeside";
  723. ccp.ServerParams = new object[] { jugeNo, lotNo, PlineCode, proPlanId, gxPlanNo };
  724. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  725. if (ccp.ReturnCode != -1)
  726. {
  727. if (ccp.ReturnInfo.Equals("结炉回退成功!"))
  728. {
  729. QuerySinglePlan();
  730. MessageUtil.ShowTips(ccp.ReturnInfo);
  731. }
  732. else
  733. {
  734. MessageUtil.ShowTips(ccp.ReturnInfo);
  735. }
  736. }
  737. //if (count > 0)
  738. //{
  739. // QuerySinglePlan();
  740. // MessageUtil.ShowTips("回退成功!");
  741. //}
  742. }
  743. /// <summary>
  744. /// 交库结炉(验证进程表数据与入库数据一致性(合格))
  745. /// </summary>
  746. private void doBeside()
  747. {
  748. this.ultraGrid8.UpdateData();
  749. UltraGridRow uRow = this.ultraGrid8.ActiveRow;
  750. if (uRow.Index < 0 || uRow == null)
  751. {
  752. MessageUtil.ShowTips("请选择需要结炉的主信息!");
  753. return;
  754. }
  755. NativeMethodNew na = new NativeMethodNew(this.ob);
  756. string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
  757. string jugeNo = uRow.Cells["JUDGE_STOVE_NO"].Text.Trim();
  758. string lotNo = uRow.Cells["LOT_NO"].Text.Trim();
  759. if (MessageUtil.ShowYesNoAndQuestion("是否确认结炉?") == DialogResult.No)
  760. {
  761. return;
  762. }
  763. CoreClientParam ccp = new CoreClientParam();
  764. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  765. ccp.MethodName = "doBeside";
  766. ccp.ServerParams = new object[] { jugeNo, lotNo, plinCode, _UserID, proPlanId, gxPlanNo };
  767. ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
  768. if (ccp.ReturnCode != -1)
  769. {
  770. if (ccp.ReturnInfo.Equals("结炉成功!"))
  771. {
  772. QuerySinglePlan();
  773. MilPlanEntity3bindingSource.Clear();
  774. this.dataTable2.Clear();
  775. MessageUtil.ShowTips(ccp.ReturnInfo);
  776. }
  777. else
  778. {
  779. MessageUtil.ShowTips(ccp.ReturnInfo);
  780. }
  781. }
  782. }
  783. /// <summary>
  784. /// 查询仓库信息
  785. /// </summary>
  786. /// <param name="plineCode"></param>
  787. /// <returns></returns>
  788. private DataTable getStoreNo(string plineCode)
  789. {
  790. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryStoreNo", new object[] { plineCode }, ob);
  791. if (ds.Rows.Count > 0)
  792. {
  793. return ds;
  794. }
  795. else
  796. {
  797. return null;
  798. }
  799. }
  800. /// <summary>
  801. /// 交库
  802. /// </summary>
  803. private void DoSave()
  804. {
  805. string storeNo = "";
  806. string location = "";
  807. string storagetype = "";
  808. string storagetypedesc = "";
  809. string strInbound = "800701";//入库类型
  810. string strInMemo = "";
  811. string strGroupNo = "";//组号
  812. string surplusFlag = "";//是否余材标识
  813. string sampleFlag = "";//是否减取样长度标识
  814. int k = 0;
  815. int b = 0;
  816. this.ultraGrid3.UpdateData();
  817. DataTable dte = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortMilState", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
  818. int acount = int.Parse(dte.Rows[0]["acount"].ToString2());
  819. int acount2 = int.Parse(dte.Rows[0]["acount2"].ToString2());
  820. if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" && acount > 0 && acount2 <= 0)
  821. {
  822. //if (MessageUtil.ShowYesNoAndQuestion("有样管未交库,是否确认继续非样管交库?") == DialogResult.No)
  823. //{
  824. // return;
  825. //}
  826. MessageUtil.ShowTips("有样管未交库,请先交样管!");
  827. return;
  828. }
  829. if (!textMemo.Text.Trim().ToString().Equals(""))
  830. {
  831. if (!StringUtil.IsNumber(textMemo.Text.Trim().ToString()))
  832. {
  833. MessageUtil.ShowTips("请输入正确的短尺长度!");
  834. return;
  835. }
  836. }
  837. DataTable dtMemo = PipeManageClass.getComTypeInfo(strInbound, ob);
  838. if (dtMemo.Rows.Count >= 1)
  839. {
  840. strInMemo = dtMemo.Rows[0]["MEMO"].ToString();
  841. }
  842. NativeMethodNew na = new NativeMethodNew(this.ob);
  843. //string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  844. string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
  845. ArrayList list = new ArrayList();
  846. DataTable ds = null;
  847. //选择250中间库,168中间库则去中间库;其它则是产出库
  848. //if (this.ultraGrid8.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Equals("10")) //交库返线,取位置备份表仓库信息
  849. //{
  850. // ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryStoreNo", new object[] { plinCode, this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text }, ob);
  851. //}
  852. //else
  853. //{
  854. // ds = getStoreNo(plinCode); //取对应产线产出库
  855. //}
  856. ds = getStoreNo(plinCode); //取对应产线产出库
  857. if (ds == null)
  858. {
  859. MessageUtil.ShowTips("无轧管在线库基础信息,请维护!");
  860. return;
  861. }
  862. string storageNo = ds.Rows[0]["STORAGE_NO"].ToString();
  863. //选择250中间库,168中间库则去中间库;
  864. if (this.cmbStorage.Value.ToString2().Equals("BZJ1") || this.cmbStorage.Value.ToString2().Equals("BZJ2"))
  865. {
  866. storageNo = this.cmbStorage.Value.ToString2();
  867. }
  868. DataTable dtDept = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryDept", new object[] { plinCode }, ob);
  869. string Deptid = dtDept.Rows[0]["DEPARTMENT_CODE"].ToString();
  870. string Department = dtDept.Rows[0]["DEPARTMENT_DESC"].ToString();
  871. list.Add(storageNo);
  872. list.Add(storageNo + "10101");
  873. list.Add(ds.Rows[0]["STORAGE_TYPE_NO"].ToString());
  874. list.Add(ds.Rows[0]["STORAGE_TYPE_NAME"].ToString());
  875. list.Add(this.UserInfo.GetUserName());
  876. list.Add(Deptid);
  877. list.Add(Department);
  878. list.Add(Deptid);
  879. list.Add(Department);
  880. list.Add(this.UserInfo.GetUserOrder());
  881. list.Add(this.UserInfo.GetUserGroup());
  882. //list.Add(PipeManageClass.GetDepartIdBySectionId(this.UserInfo.GetDeptid(), this.ob));
  883. //list.Add(PipeManageClass.GetDepartBySectionId(this.UserInfo.GetDeptid(), this.ob));
  884. ArrayList parm = new ArrayList();
  885. //foreach(UltraGridRow uRow in checkMagRows)
  886. //{
  887. // MilPlanEntity3 milPlanEntity = (MilPlanEntity3)uRow.ListObject;
  888. // string milPlanTity = JSONFormat.Format(milPlanEntity);
  889. // parm.Add(milPlanTity);
  890. //}
  891. //if (this.ultraGrid8.ActiveRow.Cells["LOT_NO"].Text.Trim() != "试轧料")
  892. //{
  893. if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.Trim() == "待处理")
  894. {
  895. MessageUtil.ShowTips("待处理品不允许进行入库!");
  896. return;
  897. }
  898. //}
  899. if (this.cmbStorage.Value.ToString2() == "")
  900. {
  901. MessageUtil.ShowTips("请选择去向,再进行交库!");
  902. return;
  903. }
  904. MilPlanEntity3 mi = (MilPlanEntity3)this.ultraGrid3.ActiveRow.ListObject;
  905. mi.PlineCode = plinCode;
  906. if (plinCode == "C009")
  907. {
  908. mi.PlineName = "258机组";
  909. }
  910. else if (plinCode == "C008")
  911. {
  912. mi.PlineName = "250机组";
  913. }
  914. else if (plinCode == "C010")
  915. {
  916. mi.PlineName = "168机组";
  917. }
  918. else if (plinCode == "C017")
  919. {
  920. mi.PlineName = "460机组";
  921. }
  922. else if (plinCode == "C072")
  923. {
  924. mi.PlineName = "天淮508机组";
  925. }
  926. if (mi.MaterialDesc.Equals(""))
  927. {
  928. mi.MaterialDesc = this.ultraGrid1.ActiveRow.Cells["OUTWL_DESC"].Text.ToString();
  929. }
  930. string milPlanTity = JSONFormat.Format(mi);
  931. int s = 0;
  932. int m = 0;
  933. int n = 0;
  934. int z = 0;
  935. int y = 0;
  936. int p = 0;
  937. int num = 0;
  938. int x = 0;
  939. int totalNum = 0;
  940. //if (this.ultraGrid3.ActiveRow.Cells["GoType"].Text.Equals("成品") || this.ultraGrid3.ActiveRow.Cells["GoType"].Text.Equals("半成品"))
  941. //{
  942. // DataTable df = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQuerySampleNum", new object[] { mi.JudgeStoveNo.ToString(), plinCode, proPlanId, gxPlanNo }, ob);
  943. // if (int.Parse(df.Rows[0][0].ToString()) <= 0)
  944. // {
  945. // MessageUtil.ShowTips("交库信息中无样管信息,不允许进行交库!");
  946. // return;
  947. // }
  948. //}
  949. foreach (UltraGridRow uRow in ultraGrid2.Rows)
  950. {
  951. if (uRow.Cells["BATCH_NO"].Text == "")
  952. {
  953. s = s + 1;
  954. }
  955. }
  956. if (s > 0)
  957. {
  958. MessageUtil.ShowTips("未进行分批,不允许交库!");
  959. return;
  960. }
  961. foreach (UltraGridRow row1 in ultraGrid2.Rows)
  962. {
  963. if (Convert.ToBoolean(row1.Cells["CHK"].Value) == true)
  964. {
  965. if (row1.Cells["ACT_LEN"].Value.ToString2() != "")
  966. {
  967. if (double.Parse(row1.Cells["ACT_LEN"].Value.ToString2()) > 0)
  968. {
  969. }
  970. else
  971. {
  972. m = m + 1;
  973. }
  974. }
  975. else
  976. {
  977. m = m + 1;
  978. }
  979. if (row1.Cells["ACT_COUNT"].Value.ToString2() != "")
  980. {
  981. if (int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2()) > 0)
  982. {
  983. }
  984. else
  985. {
  986. n = n + 1;
  987. }
  988. }
  989. else
  990. {
  991. n = n + 1;
  992. }
  993. if (row1.Cells["ACT_WEIGHT"].Value.ToString2() != "")
  994. {
  995. if (double.Parse(row1.Cells["ACT_WEIGHT"].Value.ToString2()) > 0)
  996. {
  997. }
  998. else
  999. {
  1000. z = z + 1;
  1001. }
  1002. }
  1003. else
  1004. {
  1005. z = z + 1;
  1006. }
  1007. if (row1.Cells["BATCH_NO"].Value.ToString2() == "")
  1008. {
  1009. y = y + 1;
  1010. }
  1011. //if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text != "")
  1012. //{
  1013. // if (row1.Cells["FLAW_STAUS"].Value.ToString2() == "" || row1.Cells["TESTING_STAUS"].Value.ToString2() == "")
  1014. // {
  1015. // p = p + 1;
  1016. // }
  1017. //}
  1018. //if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格")
  1019. //{
  1020. // if (!row1.Cells["FLAW_STAUS"].Text.ToString2().Contains("合格") || !row1.Cells["TESTING_STAUS"].Text.ToString2().Contains("合格"))
  1021. // {
  1022. // MessageUtil.ShowTips("合格品下,探伤、质检状态都应为合格!");
  1023. // return;
  1024. // }
  1025. //}
  1026. //else
  1027. //{
  1028. // if (row1.Cells["FLAW_STAUS"].Text.ToString2().Contains("合格") || row1.Cells["TESTING_STAUS"].Text.ToString2().Contains("合格"))
  1029. // {
  1030. // MessageUtil.ShowTips("不是合格品下,探伤、质检状态都不应为合格!");
  1031. // return;
  1032. // }
  1033. //}
  1034. if (row1.Cells["THACT_COUNT"].Text.ToString3() != "")
  1035. {
  1036. if (int.Parse(row1.Cells["ACT_COUNT"].Text.ToString3()) + int.Parse(row1.Cells["INSTORECOUNT"].Text.ToString3()) > int.Parse(row1.Cells["THACT_COUNT"].Text.ToString3()))
  1037. {
  1038. x = x + 1;
  1039. }
  1040. }
  1041. ArrayList parm1 = new ArrayList();
  1042. parm1.Add(row1.Cells["ACT_LEN"].Value.ToString2());
  1043. parm1.Add(row1.Cells["ACT_COUNT"].Value.ToString2());
  1044. parm1.Add(row1.Cells["ACT_WEIGHT"].Value.ToString2());
  1045. parm1.Add(row1.Cells["BATCH_NO"].Value.ToString2());
  1046. if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" || this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "样管")
  1047. {
  1048. parm1.Add("40740401");//探伤结果
  1049. parm1.Add("40740601");//表检结果
  1050. }
  1051. else if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "判废")
  1052. {
  1053. parm1.Add("");//探伤结果
  1054. parm1.Add("");//表检结果
  1055. }
  1056. parm1.Add(row1.Cells["THACT_COUNT"].Value.ToString3());
  1057. parm.Add(parm1);
  1058. totalNum = totalNum + int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2());
  1059. num++;
  1060. }
  1061. }
  1062. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  1063. int offlinePro = checkMagRows.GroupBy(a => a.GetValue("BATCH_NO")).Count();
  1064. if (checkMagRows.Count() > 1)
  1065. {
  1066. if (offlinePro == 1)
  1067. {
  1068. MessageUtil.ShowTips("批号一样,长度不一样请分开交库!");
  1069. return;
  1070. }
  1071. }
  1072. if (num <= 0)
  1073. {
  1074. MessageUtil.ShowTips("请勾选产出信息!");
  1075. return;
  1076. }
  1077. if (m > 0)
  1078. {
  1079. MessageUtil.ShowTips("长度不能为空,必须大于零!");
  1080. return;
  1081. }
  1082. if (n > 0)
  1083. {
  1084. MessageUtil.ShowTips("支数不能为空,必须大于零!");
  1085. return;
  1086. }
  1087. if (z > 0)
  1088. {
  1089. MessageUtil.ShowTips("重量不能为空,必须大于零!");
  1090. return;
  1091. }
  1092. if (y > 0)
  1093. {
  1094. MessageUtil.ShowTips("批号不能为空,请选择!");
  1095. return;
  1096. }
  1097. //if (p > 0)
  1098. //{
  1099. // MessageUtil.ShowTips("请选择探伤结果和表检结果!");
  1100. // return;
  1101. //}
  1102. if (x > 0)
  1103. {
  1104. MessageUtil.ShowTips("输入的实际支数加已在线库支数不能大于理论支数!");
  1105. return;
  1106. }
  1107. if (this.surplusChk.Checked)
  1108. {
  1109. surplusFlag = "1";
  1110. }
  1111. else
  1112. {
  1113. surplusFlag = "0";
  1114. }
  1115. if (this.sampleLen.Checked)
  1116. {
  1117. sampleFlag = "1";
  1118. }
  1119. else
  1120. {
  1121. sampleFlag = "0";
  1122. }
  1123. if(mi.Target.ToString().Equals("A") && surplusFlag == "1")
  1124. {
  1125. MessageUtil.ShowTips("A字头不允许进行无合同交库!");
  1126. return;
  1127. }
  1128. //DataTable dtSlample = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortSlample", new object[] { this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text }, ob);
  1129. //if (dtSlample.Rows.Count > 0)
  1130. //{
  1131. // MessageUtil.ShowTips("请先将样管交库!");
  1132. // return;
  1133. //}
  1134. string contractNo = this.ultraGrid1.ActiveRow.Cells["ORDER_NO"].Text.Trim();
  1135. string target = "";
  1136. string pckFlag = "";//打捆标志
  1137. string matRturnFlag = "";//交货材料要求标志
  1138. string testType = "";//双探类别
  1139. string testGrade = "";//等级
  1140. DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlan", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
  1141. target = dd.Rows[0]["TARGET"].ToString();
  1142. if (target.Equals("A"))
  1143. {
  1144. DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryOrderAsk", new object[] { contractNo }, ob);
  1145. if (dt.Rows.Count > 0)
  1146. {
  1147. for (int i = 0; i < dt.Rows.Count; i++)
  1148. {
  1149. if (dt.Rows[i]["ASK_SUB_ITME_VAL_DESC"].ToString().Contains("打捆"))
  1150. {
  1151. k = k + 1;
  1152. }
  1153. else if (dt.Rows[i]["ASK_ITME"].ToString().Equals("121009"))
  1154. {
  1155. b = b + 1;
  1156. }
  1157. }
  1158. }
  1159. if (k > 0 && b > 0)
  1160. {
  1161. if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆、交货材料是否满足要求?") == DialogResult.No)
  1162. {
  1163. return;
  1164. }
  1165. pckFlag = "1";
  1166. matRturnFlag = "1";
  1167. }
  1168. else if (k > 0 && b < 1)
  1169. {
  1170. if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆是否满足要求?") == DialogResult.No)
  1171. {
  1172. return;
  1173. }
  1174. pckFlag = "1";
  1175. matRturnFlag = "0";
  1176. }
  1177. else if (b > 0 && k < 1)
  1178. {
  1179. if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求交货材料是否满足要求?") == DialogResult.No)
  1180. {
  1181. return;
  1182. }
  1183. pckFlag = "0";
  1184. matRturnFlag = "1";
  1185. }
  1186. else
  1187. {
  1188. pckFlag = "0";
  1189. matRturnFlag = "0";
  1190. }
  1191. if (doQueryPk(this.ultraGrid8.ActiveRow.Cells["ORD_LN_DLY_PK"].Value.ToString()))
  1192. {
  1193. DataTable dtest = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryEntrustT", new object[] { BaseMethod.getJudgeStoveNo(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text), proPlanId, gxPlanNo }, ob);
  1194. if (dtest.Rows.Count > 0)
  1195. {
  1196. testType = "UT";
  1197. testGrade = dtest.Rows[0][0].ToString();
  1198. }
  1199. else
  1200. {
  1201. MessageUtil.ShowTips("此炉是需要进行双探的管子,需走离线委外加工!");
  1202. return;
  1203. }
  1204. }
  1205. }
  1206. DataTable portDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
  1207. string portCount = portDt.Rows[0][0].ToString3();//理论支数
  1208. DataTable matDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
  1209. string matCount = matDt.Rows[0][0].ToString3();//已交库支
  1210. DataTable instoreDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeLXCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
  1211. string pipeLXCount = instoreDt.Rows[0][0].ToString3(); //交库点离线支
  1212. if (totalNum + int.Parse(matCount) + int.Parse(pipeLXCount) > int.Parse(portCount))
  1213. {
  1214. MessageUtil.ShowTips("总交库支数已大于产出支数,请核对支数再交库!");
  1215. return;
  1216. }
  1217. if (MessageUtil.ShowYesNoAndQuestion("是否确认交库?") == DialogResult.No)
  1218. {
  1219. return;
  1220. }
  1221. CoreClientParam ccp = new CoreClientParam();
  1222. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  1223. ccp.MethodName = "doPipeIn";
  1224. ccp.ServerParams = new object[] { milPlanTity, list, parm, strInbound, strInMemo, this.cmbStorage.Value.ToString2(), this.cmbStorage.Text.Trim(), surplusFlag, sampleFlag, pckFlag, matRturnFlag, testType, testGrade, this.textMemo.Text.Trim(), this.textMemo2.Text.Trim() };
  1225. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1226. if (ccp.ReturnCode != -1)
  1227. {
  1228. if (ccp.ReturnInfo.Equals("交库成功!"))
  1229. {
  1230. QuerySinglePlan();
  1231. MessageUtil.ShowTips(ccp.ReturnInfo);
  1232. }
  1233. else
  1234. {
  1235. MessageUtil.ShowTips(ccp.ReturnInfo);
  1236. }
  1237. }
  1238. }
  1239. /// <summary>
  1240. /// 查询是否需双探
  1241. /// </summary>
  1242. /// <param name="orderPk"></param>
  1243. private bool doQueryPk(string orderPk)
  1244. {
  1245. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryProcessSeq", new object[] { orderPk }, ob);
  1246. if (ds.Rows.Count > 0)
  1247. {
  1248. if (ds.Rows[0]["PROCESS_SEQ"].ToString().Equals("F"))
  1249. {
  1250. return true;
  1251. }
  1252. }
  1253. return false;
  1254. }
  1255. /// <summary>
  1256. /// 撤销交库
  1257. /// </summary>
  1258. private void cancelInList()
  1259. {
  1260. this.ultraGrid4.UpdateData();
  1261. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid4.Rows.AsQueryable().Where(" CHK = 'True'");
  1262. if (checkMagRows.Count() == 0)
  1263. {
  1264. MessageUtil.ShowTips("请勾选需要撤销的入库记录!");
  1265. return;
  1266. }
  1267. ArrayList parm = new ArrayList();
  1268. foreach(UltraGridRow uRow in checkMagRows)
  1269. {
  1270. YdmZcInlistEntity inListEntity = (YdmZcInlistEntity)uRow.ListObject;
  1271. string inListTity = JSONFormat.Format(inListEntity);
  1272. parm.Add(inListTity);
  1273. }
  1274. if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销?") == DialogResult.No) return;
  1275. CoreClientParam ccp = new CoreClientParam();
  1276. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  1277. ccp.MethodName = "cancelPipeIn";
  1278. ccp.ServerParams = new object[] {parm };
  1279. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1280. if (ccp.ReturnCode != -1)
  1281. {
  1282. if (ccp.ReturnInfo.Equals("撤销成功!"))
  1283. {
  1284. DoQueryInList();
  1285. MessageUtil.ShowTips(ccp.ReturnInfo);
  1286. }
  1287. else
  1288. {
  1289. MessageUtil.ShowTips(ccp.ReturnInfo);
  1290. }
  1291. }
  1292. }
  1293. /// <summary>
  1294. /// 申请判定
  1295. /// </summary>
  1296. private void DoDecision()
  1297. {
  1298. this.ultraGrid7.UpdateData();
  1299. int m =0 ;
  1300. int n = 0;
  1301. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
  1302. if (checkMagRows.Count() == 0)
  1303. {
  1304. MessageUtil.ShowTips("请选择需要申请判定的主信息!");
  1305. return;
  1306. }
  1307. ArrayList parm = new ArrayList();
  1308. foreach(UltraGridRow uRow in checkMagRows)
  1309. {
  1310. if (uRow.Cells["QcmStaus"].Text.Trim() == "判废"||uRow.Cells["QcmStaus"].Text.Trim() == "待处理")
  1311. {
  1312. m= m+1;
  1313. }
  1314. if (uRow.Cells["JugdeApplyCode"].Text.Trim() != "")
  1315. {
  1316. n = n + 1;
  1317. }
  1318. MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
  1319. string matZcTity = JSONFormat.Format(matZcEntity);
  1320. parm.Add(matZcTity);
  1321. }
  1322. if (m > 0)
  1323. {
  1324. MessageUtil.ShowTips("废品/待处理的炉批组信息,不允许申请判定!");
  1325. return;
  1326. }
  1327. if(n>0)
  1328. {
  1329. MessageUtil.ShowTips("正在进行判定的炉批组信息,不允许重复申请判定!");
  1330. return;
  1331. }
  1332. CoreClientParam ccp = new CoreClientParam();
  1333. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  1334. ccp.MethodName = "doDecision";
  1335. ccp.ServerParams = new object[] { parm, this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraGrid6.ActiveRow.Cells["ProductFlag"].Value.ToString() };
  1336. ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
  1337. if (ccp.ReturnCode != -1)
  1338. {
  1339. if (ccp.ReturnInfo.Equals("申请判定成功!"))
  1340. {
  1341. QueryMat();
  1342. MessageUtil.ShowTips(ccp.ReturnInfo);
  1343. }
  1344. else
  1345. {
  1346. MessageUtil.ShowTips(ccp.ReturnInfo);
  1347. }
  1348. }
  1349. }
  1350. /// <summary>
  1351. /// 撤销申请判定
  1352. /// </summary>
  1353. private void cancelDoDecision()
  1354. {
  1355. this.ultraGrid7.UpdateData();
  1356. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
  1357. if (checkMagRows.Count() == 0)
  1358. {
  1359. MessageUtil.ShowTips("请选择需要撤销申请判定的主信息!");
  1360. return;
  1361. }
  1362. ArrayList parm = new ArrayList();
  1363. foreach(UltraGridRow uRow in checkMagRows)
  1364. {
  1365. MatZcMEntity matZcTity = (MatZcMEntity)uRow.ListObject;
  1366. string matTity = JSONFormat.Format(matZcTity);
  1367. parm.Add(matTity);
  1368. }
  1369. if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销?") == DialogResult.No) return;
  1370. CoreClientParam ccp = new CoreClientParam();
  1371. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  1372. ccp.MethodName = "cancelDoDecision";
  1373. ccp.ServerParams = new object[] { parm };
  1374. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1375. if (ccp.ReturnCode != -1)
  1376. {
  1377. if (ccp.ReturnInfo.Equals("撤销成功!"))
  1378. {
  1379. QueryMat();
  1380. MessageUtil.ShowTips(ccp.ReturnInfo);
  1381. }
  1382. else
  1383. {
  1384. MessageUtil.ShowTips(ccp.ReturnInfo);
  1385. }
  1386. }
  1387. }
  1388. /// <summary>
  1389. /// 查询入库实绩
  1390. /// </summary>
  1391. private void DoQueryInList()
  1392. {
  1393. string plinCode = "";
  1394. string jugeNo = "";
  1395. string startTim = "";
  1396. string endTim = "";
  1397. //string departMentId = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(),ob);
  1398. string departMentId = UserInfo.GetDeptid();
  1399. NativeMethodNew na = new NativeMethodNew(this.ob);
  1400. plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  1401. if (this.chkHeatNo1.Checked && this.txtHeatNo1.Text.Trim() != "")
  1402. {
  1403. jugeNo = this.txtHeatNo1.Text.Trim();
  1404. }
  1405. if (chkTim1.Checked)
  1406. {
  1407. if (DateTime.Parse(StartTime1.Value.ToString()) > DateTime.Parse(EndTime1.Value.ToString()))
  1408. {
  1409. MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  1410. return;
  1411. }
  1412. else
  1413. {
  1414. startTim = this.StartTime1.Value.ToString("yyyy-MM-dd");
  1415. endTim = this.EndTime1.Value.ToString("yyyy-MM-dd");
  1416. }
  1417. }
  1418. ArrayList list = new ArrayList();
  1419. list.Add(jugeNo);
  1420. list.Add(plinCode);
  1421. List<YdmZcInlistEntity> listSource = EntityHelper.GetData<YdmZcInlistEntity>(
  1422. "com.steering.mes.signature.FrmInOnlineStore.doQueryInList", new object[] { list, startTim, endTim, departMentId, plineCodes }, this.ob);
  1423. YdmZcInlistEntitybindingSource.DataSource = listSource;
  1424. }
  1425. /// <summary>
  1426. /// 查询库存实绩
  1427. /// </summary>
  1428. private void QueryMatButess()
  1429. {
  1430. string plinCode = "";
  1431. string jugeNo = "";
  1432. string startTim = "";
  1433. string endTim = "";
  1434. //string departMentId = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(),ob);
  1435. string departMentId = UserInfo.GetDeptid();
  1436. NativeMethodNew na = new NativeMethodNew(this.ob);
  1437. plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  1438. if (this.chkHeatNo3.Checked && this.txtHeatNo3.Text.Trim() != "")
  1439. {
  1440. jugeNo = this.txtHeatNo3.Text.Trim();
  1441. }
  1442. if (chkTim3.Checked)
  1443. {
  1444. if (DateTime.Parse(StartTime3.Value.ToString()) > DateTime.Parse(EndTime3.Value.ToString()))
  1445. {
  1446. MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  1447. return;
  1448. }
  1449. else
  1450. {
  1451. startTim = this.StartTime3.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1452. endTim = this.EndTime3.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1453. }
  1454. }
  1455. ArrayList list = new ArrayList();
  1456. list.Add(jugeNo);
  1457. list.Add(plinCode);
  1458. List<MatZcMEntity> listSource = EntityHelper.GetData<MatZcMEntity>(
  1459. "com.steering.mes.signature.FrmInOnlineStore.doQueryMatButess", new object[] { list, startTim, endTim, departMentId, plineCodes }, this.ob);
  1460. MatZcMEntitybindingSource.DataSource = listSource;
  1461. }
  1462. /// <summary>
  1463. /// 查询材料表
  1464. /// </summary>
  1465. private void QueryMat()
  1466. {
  1467. string plinCode = "";
  1468. string jugeNo = "";
  1469. string startTim = "";
  1470. string endTim = "";
  1471. string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  1472. NativeMethodNew na = new NativeMethodNew(this.ob);
  1473. plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  1474. if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "")
  1475. {
  1476. jugeNo = this.txtHeatNo2.Text.Trim();
  1477. }
  1478. if (chkTim2.Checked)
  1479. {
  1480. if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString()))
  1481. {
  1482. MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  1483. return;
  1484. }
  1485. else
  1486. {
  1487. startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1488. endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1489. }
  1490. }
  1491. ArrayList list = new ArrayList();
  1492. list.Add(jugeNo);
  1493. list.Add(plinCode);
  1494. List<MatZcMEntity> listSource = EntityHelper.GetData<MatZcMEntity>(
  1495. "com.steering.mes.signature.FrmInOnlineStore.doQueryMat", new object[] { list, startTim, endTim, departMentid, plinCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString(), plineCodes }, this.ob);
  1496. MatZcMEntity1bindingSource.DataSource = listSource;
  1497. }
  1498. /// <summary>
  1499. /// 查询炉顺序
  1500. /// </summary>
  1501. private void QuerySinglePlan()
  1502. {
  1503. string plinCode = "";
  1504. string startTim = "";
  1505. string endTim = "";
  1506. string jugeNo = "";
  1507. string lotNo = "";
  1508. if(this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
  1509. {
  1510. jugeNo = this.txtJugeNo.Text.Trim();
  1511. }
  1512. if(chkTim.Checked)
  1513. {
  1514. if (DateTime.Parse(StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
  1515. {
  1516. MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  1517. return;
  1518. }
  1519. else
  1520. {
  1521. startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1522. endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1523. }
  1524. }
  1525. if(this.chkLotNo.Checked&&this.txtLotNo.Text.Trim() !="")
  1526. {
  1527. lotNo = this.txtLotNo.Text.Trim();
  1528. }
  1529. NativeMethodNew na = new NativeMethodNew(this.ob);
  1530. plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  1531. string nodeStaus = this.ultraOptionSet2.CheckedItem.DataValue.ToString();
  1532. ArrayList list = new ArrayList();
  1533. list.Add(jugeNo);
  1534. list.Add(lotNo);
  1535. list.Add(plinCode);
  1536. this.dtPlan.Clear();
  1537. this.dataTable1.Clear();
  1538. this.dataTable2.Clear();
  1539. this.MilPlanEntity3bindingSource.Clear();
  1540. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.querySinglePlan", new object[] { list, startTim, endTim, nodeStaus, plineCodes }, ob);
  1541. GridHelper.CopyDataToDatatable(ref ds, ref dtPlan, true);
  1542. }
  1543. /// <summary>
  1544. /// 查询炉投入产出
  1545. /// </summary>
  1546. private void QuerySingleJugStove(string jugeNo, string lotNo, string plinCode)
  1547. {
  1548. //string plinCode = "";
  1549. string startTim = "";
  1550. string endTim = "";
  1551. NativeMethodNew na = new NativeMethodNew(this.ob);
  1552. //plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  1553. string nodeStaus = this.ultraOptionSet2.CheckedItem.DataValue.ToString();
  1554. //if(this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
  1555. //{
  1556. // jugeNo = this.txtJugeNo.Text.Trim();
  1557. //}
  1558. //if(chkTim.Checked)
  1559. //{
  1560. // if (DateTime.Parse(StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
  1561. // {
  1562. // MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
  1563. // return;
  1564. // }
  1565. // else
  1566. // {
  1567. // startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1568. // endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1569. // }
  1570. //}
  1571. //if(this.chkLotNo.Checked&&this.txtLotNo.Text.Trim() !="")
  1572. //{
  1573. // lotNo = this.txtLotNo.Text.Trim();
  1574. //}
  1575. ArrayList list = new ArrayList();
  1576. list.Add(plinCode);
  1577. list.Add(jugeNo);
  1578. list.Add(lotNo);
  1579. list.Add(plinCode);
  1580. list.Add(jugeNo);
  1581. list.Add(lotNo);
  1582. list.Add(plinCode);
  1583. list.Add(jugeNo);
  1584. list.Add(lotNo);
  1585. list.Add(plinCode);
  1586. list.Add(jugeNo);
  1587. list.Add(lotNo);
  1588. list.Add(plinCode);
  1589. list.Add(jugeNo);
  1590. list.Add(lotNo);
  1591. list.Add(plinCode);
  1592. list.Add(jugeNo);
  1593. list.Add(lotNo);
  1594. dataSet1.Clear();
  1595. this.dataTable1.Clear();
  1596. DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQuerySingleJugStove", new object[] { list, startTim, endTim, nodeStaus }, ob);
  1597. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  1598. }
  1599. private void QueryMinMaxDS()
  1600. {
  1601. UltraGridRow uRow = this.ultraGrid8.ActiveRow;
  1602. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryMinMaxD", new object[] { uRow.Cells["JUDGE_NO"].Value.ToString() }, ob);
  1603. DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryMinMaxS", new object[] { uRow.Cells["JUDGE_NO"].Value.ToString() }, ob);
  1604. if (ds.Rows.Count > 0)
  1605. {
  1606. this.txt_dimer.Text = ds.Rows[0]["DIMATER"].ToString();
  1607. }
  1608. else
  1609. {
  1610. this.txt_dimer.Text = "0";
  1611. }
  1612. if (dd.Rows.Count > 0)
  1613. {
  1614. this.txt_height.Text = dd.Rows[0]["HEIGHT"].ToString();
  1615. }
  1616. else
  1617. {
  1618. this.txt_height.Text = "0";
  1619. }
  1620. }
  1621. private void FrmInOnlineStore_Load(object sender, EventArgs e)
  1622. {
  1623. DateTime now = DateTime.Now;
  1624. DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
  1625. DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
  1626. this.StartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
  1627. this.EndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
  1628. this.StartTime1.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
  1629. this.EndTime1.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
  1630. this.StartTime2.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
  1631. this.EndTime2.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
  1632. this.StartTime3.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
  1633. this.EndTime3.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
  1634. EntityHelper.ShowGridCaption<MilPlanEntity3>(ultraGrid3.DisplayLayout.Bands[0]);
  1635. EntityHelper.ShowGridCaption<YdmZcInlistEntity>(ultraGrid4.DisplayLayout.Bands[0]);
  1636. EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid6.DisplayLayout.Bands[0]);
  1637. EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid5.DisplayLayout.Bands[0]);
  1638. EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid7.DisplayLayout.Bands[0]);
  1639. //EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid9.DisplayLayout.Bands[0]);
  1640. PipeManageClass.InitComboEditor2(cmbStorage, "com.steering.mes.signature.FrmInOnlineStore.getStoreNo", "STORAGE_NO",this.UserInfo.GetDeptid(), this.ob, false);
  1641. PipeManageClass.InitComboEditor(txt_UtGrade, "com.steering.mes.signature.FrmInOnlineStore.getTestGrade", "BASECODE", this.ob, false);
  1642. InitBindColumn();
  1643. NativeMethodNew na = new NativeMethodNew(this.ob);
  1644. Departm = UserInfo.GetDepartment();
  1645. PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
  1646. plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob);
  1647. //if (!PlineCode.Equals("C072"))
  1648. //{
  1649. // label7.Visible = false;
  1650. // textMemo.Visible = false;
  1651. //}
  1652. Sign();
  1653. }
  1654. private void InitBindColumn()
  1655. {
  1656. //材料状态
  1657. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
  1658. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
  1659. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
  1660. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
  1661. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
  1662. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
  1663. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
  1664. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
  1665. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
  1666. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
  1667. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
  1668. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
  1669. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
  1670. this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
  1671. //材料类别
  1672. this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
  1673. this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
  1674. this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
  1675. //材料状态
  1676. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
  1677. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
  1678. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
  1679. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
  1680. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
  1681. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
  1682. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
  1683. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
  1684. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
  1685. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
  1686. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
  1687. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
  1688. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
  1689. this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
  1690. //材料类别
  1691. this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
  1692. this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
  1693. this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
  1694. //材料状态
  1695. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
  1696. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
  1697. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
  1698. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
  1699. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
  1700. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
  1701. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
  1702. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
  1703. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
  1704. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
  1705. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
  1706. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
  1707. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
  1708. this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
  1709. //材料类别
  1710. this.ultraGrid5.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
  1711. this.ultraGrid5.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
  1712. this.ultraGrid5.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
  1713. //材料状态
  1714. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
  1715. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
  1716. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
  1717. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
  1718. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
  1719. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
  1720. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
  1721. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
  1722. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
  1723. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
  1724. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
  1725. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
  1726. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
  1727. this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
  1728. this.ultraGrid4.DisplayLayout.ValueLists[1].ValueListItems.Add("00", "合格");
  1729. this.ultraGrid4.DisplayLayout.ValueLists[1].ValueListItems.Add("11", "待处理");
  1730. this.ultraGrid4.DisplayLayout.ValueLists[1].ValueListItems.Add("22", "废品");
  1731. this.ultraGrid4.DisplayLayout.ValueLists[2].ValueListItems.Add("0", "非样管");
  1732. this.ultraGrid4.DisplayLayout.ValueLists[2].ValueListItems.Add("1", "样管");
  1733. //string[] arr = new string[3] { "801501", "801502", "801503" };
  1734. //DataTable dt = ClsLoad.GetValueListDataTable(arr, this.ob);
  1735. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["MAT_STATUS"].ValueList = ClsLoad.GeneralValuelist(ref dt, "BASECODE", "BASENAME");
  1736. }
  1737. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  1738. {
  1739. string goType = "";
  1740. NativeMethodNew na = new NativeMethodNew(this.ob);
  1741. string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
  1742. //doQueryQaJugeStove(this.ultraGrid1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString(), plinCode);
  1743. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryGoType", new object[] { this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString() }, this.ob);
  1744. if (ds.Rows.Count > 0)
  1745. {
  1746. goType = ds.Rows[0][0].ToString();
  1747. }
  1748. doQueryQaInStore(this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Value.ToString(), this.ultraGrid1.ActiveRow.Cells["LOT_NO"].Value.ToString(), plinCode, goType);
  1749. }
  1750. /// <summary>
  1751. /// 签名
  1752. /// </summary>
  1753. private void Sign()
  1754. {
  1755. ColUserName col = new ColUserName();
  1756. col.StationId = "12";
  1757. col.PlineCode = PlineCode;
  1758. col.ColGroup = UserInfo.GetUserGroup();
  1759. col.Ob = this.ob;
  1760. col.ShowDialog();
  1761. _UserID = col.getUserId();
  1762. _UserName = col.getUserName();
  1763. }
  1764. /// <summary>
  1765. /// 查询表检炉批
  1766. /// </summary>
  1767. private void doQueryQaJugeStove(string jugeStove,string plineCode)
  1768. {
  1769. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryQaStove", new object[] { jugeStove, plineCode }, ob);
  1770. GridHelper.CopyDataToDatatable(ref ds, ref dataTable2, true);
  1771. }
  1772. //private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  1773. //{
  1774. // NativeMethodNew na = new NativeMethodNew(this.ob);
  1775. // string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  1776. // doQueryQaInStore(this.ultraGrid2.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString(), this.ultraGrid2.ActiveRow.Cells["LOT_NO"].Value.ToString(), plinCode);
  1777. //}
  1778. /// <summary>
  1779. /// 查询产出详细信息
  1780. /// </summary>
  1781. /// <param name="p"></param>
  1782. /// <param name="p_2"></param>
  1783. /// <param name="plinCode"></param>
  1784. private void doQueryQaInStore(string p, string p_2, string plinCode,string goType)
  1785. {
  1786. ArrayList parm = new ArrayList();
  1787. parm.Add(p);
  1788. parm.Add(p_2);
  1789. parm.Add(plinCode);
  1790. parm.Add(p);
  1791. parm.Add(p_2);
  1792. parm.Add(plinCode);
  1793. parm.Add(p);
  1794. parm.Add(p_2);
  1795. parm.Add(plinCode);
  1796. //parm.Add(p);
  1797. //parm.Add(p_2);
  1798. //parm.Add(plinCode);
  1799. //parm.Add(p);
  1800. //parm.Add(p_2);
  1801. //parm.Add(plinCode);
  1802. MilPlanEntity3bindingSource.Clear();
  1803. List<MilPlanEntity3> listSource = EntityHelper.GetData<MilPlanEntity3>(
  1804. "com.steering.mes.signature.FrmInOnlineStore.doQuerySurface", new object[] { parm,goType }, this.ob);
  1805. MilPlanEntity3bindingSource.DataSource = listSource;
  1806. }
  1807. private void ultraGrid3_AfterSelectChange(object sender, Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs e)
  1808. {
  1809. foreach (UltraGridRow uRow in ultraGrid3.Selected.Rows)
  1810. {
  1811. if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
  1812. {
  1813. uRow.Cells["CHK"].Value = true;
  1814. }
  1815. }
  1816. }
  1817. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  1818. {
  1819. string judgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Value.ToString();
  1820. string lotNo = this.ultraGrid1.ActiveRow.Cells["LOT_NO"].Value.ToString();
  1821. string length = this.ultraGrid3.ActiveRow.Cells["ActLen"].Value.ToString2();
  1822. string staus = this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString();
  1823. string id = this.ultraGrid3.ActiveRow.Cells["id"].Value.ToString();
  1824. string sampleFlag = "";
  1825. ArrayList list = new ArrayList();
  1826. list.Add(judgeStoveNo);
  1827. list.Add(lotNo);
  1828. if (this.sampleLen.Checked)
  1829. {
  1830. sampleFlag = "1";
  1831. }
  1832. else
  1833. {
  1834. sampleFlag = "0";
  1835. }
  1836. //doQueryNum(list, staus);
  1837. //getBacthNo(judgeStoveNo, lotNo,id);
  1838. getBacthNoInformation(judgeStoveNo, lotNo, id, this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString(), sampleFlag);
  1839. }
  1840. /// <summary>
  1841. /// 查询炉次信息
  1842. /// </summary>
  1843. private void getBacthNoInformation(string judgeStoveNo, string lotNo, string id, string flag, string sampleFlag)
  1844. {
  1845. this.dataTable2.Clear();
  1846. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryBacthNoInformation", new object[] { judgeStoveNo, lotNo, id, flag, sampleFlag }, ob);
  1847. GridHelper.CopyDataToDatatable(ref ds, ref dataTable2, true);
  1848. DataTable portDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortCount", new object[] { judgeStoveNo, lotNo, id }, ob);
  1849. string portCount = portDt.Rows[0][0].ToString3();
  1850. DataTable matDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeCount", new object[] { judgeStoveNo, lotNo, id }, ob);
  1851. string matCount = matDt.Rows[0][0].ToString3();
  1852. DataTable lxDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeLXCount", new object[] { judgeStoveNo, lotNo, id }, ob);
  1853. string lxCount = lxDt.Rows[0][0].ToString3();
  1854. this.ultraLabel3.Text = "炉号:" + judgeStoveNo + " " + "理论支数:" + portCount + " " + "已交库支数:" + matCount + " " + "离线支数:" + lxCount;
  1855. ultraLabel3.ForeColor = Color.Red;
  1856. }
  1857. /// <summary>
  1858. /// 查询几大类的支数、长度、重量信息
  1859. /// </summary>
  1860. /// <param name="list"></param>
  1861. /// <param name="staus"></param>
  1862. private void doQueryNum(ArrayList list,string staus)
  1863. {
  1864. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryNum", new object[] { list, staus }, ob);
  1865. GridHelper.CopyDataToDatatable(ref ds, ref dataTable2, true);
  1866. }
  1867. UltraComboEditor bacthNo = new UltraComboEditor();
  1868. UltraComboEditor flawStaus = new UltraComboEditor();
  1869. UltraComboEditor testingStaus = new UltraComboEditor();
  1870. private void getBacthNo(string jugeNo,string lotNo,string id)
  1871. {
  1872. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryBacthNo", new object[] { jugeNo, lotNo, id }, ob);
  1873. PipeManageClass.InitComboEditor(bacthNo, ds, "BATCHCODE", false);
  1874. PipeManageClass.BindColumn(bacthNo, "BATCH_NO", this.Controls, this.ultraGrid2,0);
  1875. PipeManageClass.InitComboEditor(flawStaus, "com.steering.mes.signature.FrmInOnlineStore.doQueryFlawStaus", "BASECODE",this.ob, false);
  1876. PipeManageClass.BindColumn(flawStaus, "FLAW_STAUS", this.Controls, this.ultraGrid2, 0);
  1877. PipeManageClass.InitComboEditor(testingStaus, "com.steering.mes.signature.FrmInOnlineStore.doQueryTestingStaus", "BASECODE", this.ob, false);
  1878. PipeManageClass.BindColumn(testingStaus, "TESTING_STAUS", this.Controls, this.ultraGrid2, 0);
  1879. }
  1880. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  1881. {
  1882. this.ultraGrid2.UpdateData();
  1883. string isSampleFlag = "";
  1884. string stausFlag = "";
  1885. if (e.Cell.Column.Key == "ACT_LEN" || e.Cell.Column.Key == "ACT_COUNT")
  1886. {
  1887. //if (e.Cell.DataChanged)
  1888. //{
  1889. if (e.Cell.Row.Cells["ACT_COUNT"].Value.ToString2() != "" && e.Cell.Row.Cells["ACT_COUNT"].Value.ToString2() != "0" && e.Cell.Row.Cells["ACT_LEN"].Value.ToString2() != "" && double.Parse(e.Cell.Row.Cells["ACT_LEN"].Value.ToString2()) > 0)
  1890. {
  1891. if (this.ultraGrid3.ActiveRow != null)
  1892. {
  1893. if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.ToString() == "样管")
  1894. {
  1895. isSampleFlag = "1";
  1896. stausFlag = "0";
  1897. }
  1898. else if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.ToString() == "合格")
  1899. {
  1900. isSampleFlag = "0";
  1901. stausFlag = "0";
  1902. }
  1903. else
  1904. {
  1905. isSampleFlag = "0";
  1906. stausFlag = "2";
  1907. }
  1908. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryWgt", new object[] { this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString(), int.Parse(e.Cell.Row.Cells["ACT_COUNT"].Value.ToString2()), stausFlag, isSampleFlag }, ob);
  1909. e.Cell.Row.Cells["ACT_WEIGHT"].Value = ds.Rows[0]["ACT_WEIGHT"].ToString2();
  1910. }
  1911. else
  1912. {
  1913. MessageUtil.ShowTips("请选择炉批行信息!");
  1914. return;
  1915. }
  1916. }
  1917. //}
  1918. }
  1919. if (e.Cell.Column.Key == "CHK")
  1920. {
  1921. if (Convert.ToBoolean(e.Cell.Value))
  1922. {
  1923. for (int i = 0; i < e.Cell.Row.Cells.Count; i++)
  1924. {
  1925. e.Cell.Row.Cells[i].Activation = Activation.AllowEdit;
  1926. }
  1927. }
  1928. //else
  1929. //{
  1930. // e.Cell.Row.Delete();
  1931. //}
  1932. }
  1933. }
  1934. private void FrmInOnlineStore_Shown(object sender, EventArgs e)
  1935. {
  1936. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
  1937. {
  1938. toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
  1939. }
  1940. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
  1941. {
  1942. toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
  1943. }
  1944. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
  1945. {
  1946. toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
  1947. }
  1948. if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
  1949. {
  1950. toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
  1951. }
  1952. if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
  1953. {
  1954. toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
  1955. }
  1956. if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
  1957. {
  1958. toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
  1959. }
  1960. if (toolMenu.Toolbars[0].Tools.Exists("Print"))
  1961. {
  1962. toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
  1963. }
  1964. if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
  1965. {
  1966. toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
  1967. }
  1968. if (toolMenu.Toolbars[0].Tools.Exists("updateTarget"))
  1969. {
  1970. toolMenu.Toolbars[0].Tools["updateTarget"].InstanceProps.Visible = DefaultableBoolean.False;
  1971. }
  1972. }
  1973. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  1974. {
  1975. if (toolMenu == null) return;
  1976. if (ultraTabControl1.SelectedTab.Key == "1")
  1977. {
  1978. if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
  1979. {
  1980. toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.True;
  1981. }
  1982. if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
  1983. {
  1984. toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.True;
  1985. }
  1986. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
  1987. {
  1988. toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
  1989. }
  1990. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
  1991. {
  1992. toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
  1993. }
  1994. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
  1995. {
  1996. toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
  1997. }
  1998. if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
  1999. {
  2000. toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
  2001. }
  2002. if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
  2003. {
  2004. toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
  2005. }
  2006. if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
  2007. {
  2008. toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.True;
  2009. }
  2010. if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
  2011. {
  2012. toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.True;
  2013. }
  2014. if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
  2015. {
  2016. toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
  2017. }
  2018. if (toolMenu.Toolbars[0].Tools.Exists("Print"))
  2019. {
  2020. toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
  2021. }
  2022. if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
  2023. {
  2024. toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
  2025. }
  2026. if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
  2027. {
  2028. toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.True;
  2029. }
  2030. if (toolMenu.Toolbars[0].Tools.Exists("Export"))
  2031. {
  2032. toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
  2033. }
  2034. if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
  2035. {
  2036. toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.True;
  2037. }
  2038. if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
  2039. {
  2040. toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.True;
  2041. }
  2042. }
  2043. else if (ultraTabControl1.SelectedTab.Key == "2")
  2044. {
  2045. if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
  2046. {
  2047. toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.False;
  2048. }
  2049. if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
  2050. {
  2051. toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.False;
  2052. }
  2053. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
  2054. {
  2055. toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
  2056. }
  2057. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
  2058. {
  2059. toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
  2060. }
  2061. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
  2062. {
  2063. toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.True;
  2064. }
  2065. if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
  2066. {
  2067. toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.True;
  2068. }
  2069. if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
  2070. {
  2071. toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
  2072. }
  2073. if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
  2074. {
  2075. toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
  2076. }
  2077. if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
  2078. {
  2079. toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
  2080. }
  2081. if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
  2082. {
  2083. toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
  2084. }
  2085. if (toolMenu.Toolbars[0].Tools.Exists("Print"))
  2086. {
  2087. toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
  2088. }
  2089. if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
  2090. {
  2091. toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
  2092. }
  2093. if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
  2094. {
  2095. toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.False;
  2096. }
  2097. if (toolMenu.Toolbars[0].Tools.Exists("Export"))
  2098. {
  2099. toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.True;
  2100. }
  2101. if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
  2102. {
  2103. toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.False;
  2104. }
  2105. if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
  2106. {
  2107. toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.False;
  2108. }
  2109. }
  2110. else if (ultraTabControl1.SelectedTab.Key == "3")
  2111. {
  2112. if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
  2113. {
  2114. toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.False;
  2115. }
  2116. if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
  2117. {
  2118. toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.False;
  2119. }
  2120. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
  2121. {
  2122. toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.True;
  2123. }
  2124. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
  2125. {
  2126. toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
  2127. }
  2128. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
  2129. {
  2130. toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
  2131. }
  2132. if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
  2133. {
  2134. toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
  2135. }
  2136. if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
  2137. {
  2138. toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.True;
  2139. }
  2140. if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
  2141. {
  2142. toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
  2143. }
  2144. if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
  2145. {
  2146. toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
  2147. }
  2148. if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
  2149. {
  2150. toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.True;
  2151. }
  2152. if (toolMenu.Toolbars[0].Tools.Exists("Print"))
  2153. {
  2154. toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.True;
  2155. }
  2156. if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
  2157. {
  2158. toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.True;
  2159. }
  2160. if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
  2161. {
  2162. toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.False;
  2163. }
  2164. if (toolMenu.Toolbars[0].Tools.Exists("Export"))
  2165. {
  2166. toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
  2167. }
  2168. if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
  2169. {
  2170. toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.False;
  2171. }
  2172. if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
  2173. {
  2174. toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.False;
  2175. }
  2176. }
  2177. else if (ultraTabControl1.SelectedTab.Key == "4")
  2178. {
  2179. if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
  2180. {
  2181. toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.False;
  2182. }
  2183. if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
  2184. {
  2185. toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.False;
  2186. }
  2187. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
  2188. {
  2189. toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
  2190. }
  2191. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
  2192. {
  2193. toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.True;
  2194. }
  2195. if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
  2196. {
  2197. toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
  2198. }
  2199. if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
  2200. {
  2201. toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
  2202. }
  2203. if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
  2204. {
  2205. toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
  2206. }
  2207. if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
  2208. {
  2209. toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
  2210. }
  2211. if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
  2212. {
  2213. toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
  2214. }
  2215. if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
  2216. {
  2217. toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
  2218. }
  2219. if (toolMenu.Toolbars[0].Tools.Exists("Print"))
  2220. {
  2221. toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
  2222. }
  2223. if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
  2224. {
  2225. toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
  2226. }
  2227. if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
  2228. {
  2229. toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.False;
  2230. }
  2231. if (toolMenu.Toolbars[0].Tools.Exists("Export"))
  2232. {
  2233. toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
  2234. }
  2235. if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
  2236. {
  2237. toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.False;
  2238. }
  2239. if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
  2240. {
  2241. toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.False;
  2242. }
  2243. }
  2244. }
  2245. private void chkTim_CheckedChanged(object sender, EventArgs e)
  2246. {
  2247. this.StartTime.Enabled = this.EndTime.Enabled = this.chkTim.Checked;
  2248. }
  2249. private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e)
  2250. {
  2251. this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked;
  2252. }
  2253. private void chkLotNo_CheckedChanged(object sender, EventArgs e)
  2254. {
  2255. this.txtLotNo.Enabled = this.chkLotNo.Checked;
  2256. }
  2257. private void chkTim1_CheckedChanged(object sender, EventArgs e)
  2258. {
  2259. this.StartTime1.Enabled = this.EndTime1.Enabled = this.chkTim1.Checked;
  2260. }
  2261. private void chkHeatNo1_CheckedChanged(object sender, EventArgs e)
  2262. {
  2263. this.txtHeatNo1.Enabled = this.chkHeatNo1.Checked;
  2264. }
  2265. private void chkTim2_CheckedChanged(object sender, EventArgs e)
  2266. {
  2267. this.StartTime2.Enabled = this.EndTime2.Enabled = this.chkTim2.Checked;
  2268. }
  2269. private void chkHeatNo2_CheckedChanged(object sender, EventArgs e)
  2270. {
  2271. this.txtHeatNo2.Enabled = this.chkHeatNo2.Checked;
  2272. }
  2273. private void chkTim3_CheckedChanged(object sender, EventArgs e)
  2274. {
  2275. this.StartTime3.Enabled = this.EndTime3.Enabled = this.chkTim3.Checked;
  2276. }
  2277. private void chkHeatNo3_CheckedChanged(object sender, EventArgs e)
  2278. {
  2279. this.txtHeatNo3.Enabled = this.chkHeatNo3.Checked;
  2280. }
  2281. private void ultraGrid6_AfterRowActivate(object sender, EventArgs e)
  2282. {
  2283. UltraGridRow uRow = this.ultraGrid6.ActiveRow;
  2284. this.MatZcMEntity2bindingSource.Clear();
  2285. List<MatZcMEntity> listSource = EntityHelper.GetData<MatZcMEntity>(
  2286. "com.steering.mes.signature.FrmInOnlineStore.doQueryMatData", new object[] { uRow.Cells["HeatPlanNo"].Value.ToString(), this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  2287. MatZcMEntity2bindingSource.DataSource = listSource;
  2288. }
  2289. private void ultraGrid7_AfterRowActivate(object sender, EventArgs e)
  2290. {
  2291. //查询转移信息
  2292. UltraGridRow uRow = this.ultraGrid7.ActiveRow;
  2293. List<MatZcMEntity> listSource = EntityHelper.GetData<MatZcMEntity>(
  2294. "com.steering.mes.signature.FrmInOnlineStore.doQueryMatDataOut", new object[] { uRow.Cells["HeatPlanNo"].Value.ToString(), this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  2295. MatZcMEntity3bindingSource.DataSource = listSource;
  2296. }
  2297. private void ultraGrid8_AfterRowActivate(object sender, EventArgs e)
  2298. {
  2299. proPlanId = this.ultraGrid8.ActiveRow.Cells["PRO_PLAN_ID"].Text.ToString();
  2300. gxPlanNo = this.ultraGrid8.ActiveRow.Cells["GX_PLAN_NO"].Text.ToString();
  2301. PlineCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
  2302. QuerySingleJugStove(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, this.ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, PlineCode);
  2303. //QueryMinMaxDS();
  2304. QueryThickDs(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text);
  2305. QueryMilPlanPrt(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text);
  2306. this.textMemo.Text = "";
  2307. }
  2308. /// <summary>
  2309. /// 查询目标外径、控制壁厚
  2310. /// </summary>
  2311. /// <param name="p"></param>
  2312. private void QueryThickDs(string p)
  2313. {
  2314. DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryThickDs", new object[] { p }, ob);
  2315. if (dt.Rows.Count > 0)
  2316. {
  2317. if (dt.Rows[0]["VARIETIES"].ToString().Contains("套管") || dt.Rows[0]["VARIETIES"].ToString().Contains("油管") || dt.Rows[0]["VARIETIES"].ToString().Contains("接箍"))
  2318. {
  2319. if (dt.Rows[0]["VARIETIES"].ToString().Contains("管线"))
  2320. {
  2321. this.txt_dimer.Text = Math.Round((double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString3()) * 1.003),2).ToString();
  2322. }
  2323. else
  2324. {
  2325. this.txt_dimer.Text = Math.Round((double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString3()) * 1.006),2).ToString();
  2326. //if (double.Parse(dt.Rows[0]["AIMOUTDIAMETER"].ToString()) > 0)
  2327. //{
  2328. // this.txt_dimer.Text = (double.Parse(dt.Rows[0]["AIMOUTDIAMETER"].ToString()) * 1.005).ToString();
  2329. //}
  2330. //else
  2331. //{
  2332. // this.txt_dimer.Text = (double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString()) * 1.005).ToString();
  2333. //}
  2334. }
  2335. }
  2336. else
  2337. {
  2338. this.txt_dimer.Text = (double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString3())).ToString();
  2339. //if (double.Parse(dt.Rows[0]["AIMOUTDIAMETER"].ToString()) > 0)
  2340. //{
  2341. // this.txt_dimer.Text = dt.Rows[0]["AIMOUTDIAMETER"].ToString();
  2342. //}
  2343. //else
  2344. //{
  2345. // this.txt_dimer.Text = dt.Rows[0]["OUTDIAMETER"].ToString();
  2346. //}
  2347. }
  2348. this.txt_height.Text = dt.Rows[0]["CONTROL_THICKP"].ToString3();
  2349. }
  2350. else
  2351. {
  2352. this.txt_dimer.Text = "0";
  2353. this.txt_height.Text = "0";
  2354. }
  2355. }
  2356. private void QueryMilPlanPrt(string p)
  2357. {
  2358. DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlanPrt", new object[] { p }, ob);
  2359. if (dt.Rows[0][0].ToString() == "0")
  2360. {
  2361. this.chkPrn.Checked = false;
  2362. }
  2363. else if (dt.Rows[0][0].ToString() == "1")
  2364. {
  2365. this.chkPrn.Checked = true;
  2366. }
  2367. }
  2368. private void sampleLen_CheckedChanged(object sender, EventArgs e)
  2369. {
  2370. string judgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Value.ToString();
  2371. string lotNo = this.ultraGrid1.ActiveRow.Cells["LOT_NO"].Value.ToString();
  2372. string length = this.ultraGrid3.ActiveRow.Cells["ActLen"].Value.ToString2();
  2373. string staus = this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString();
  2374. string id = this.ultraGrid3.ActiveRow.Cells["id"].Value.ToString();
  2375. string sampleFlag = "";
  2376. if (this.sampleLen.Checked)
  2377. {
  2378. sampleFlag = "1";
  2379. }
  2380. else
  2381. {
  2382. sampleFlag = "0";
  2383. }
  2384. if (staus.Equals("样管"))
  2385. {
  2386. getBacthNoInformation(judgeStoveNo, lotNo, id, this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString(), sampleFlag);
  2387. }
  2388. }
  2389. private void chkPrn_CheckedChanged(object sender, EventArgs e)
  2390. {
  2391. UltraGridRow uRow = this.ultraGrid8.ActiveRow;
  2392. if(uRow == null)
  2393. {
  2394. MessageUtil.ShowTips("请选择对应炉进行勾选是否过磅!");
  2395. return;
  2396. }
  2397. string jugeNo = uRow.Cells["JUDGE_STOVE_NO"].Text.ToString();
  2398. string chkPrnFlag = "";
  2399. if (chkPrn.Checked)
  2400. {
  2401. chkPrnFlag = "1";
  2402. }
  2403. else
  2404. {
  2405. chkPrnFlag = "0";
  2406. }
  2407. int count = ServerHelper.SetData("com.steering.mes.signature.FrmInOnlineStore.doUpdatePrn", new object[] { jugeNo, chkPrnFlag }, ob);
  2408. if (count < 0)
  2409. {
  2410. MessageUtil.ShowTips("修改过磅标识异常!");
  2411. return;
  2412. }
  2413. }
  2414. /// <summary>
  2415. /// 导出
  2416. /// </summary>
  2417. private void ExportData()
  2418. {
  2419. if (this.ultraTabControl1.Tabs[1].Active)
  2420. {
  2421. GridHelper.ulGridToExcel(ultraGrid4, "交库实绩");
  2422. }
  2423. else if (this.ultraTabControl1.Tabs[3].Active)
  2424. {
  2425. GridHelper.ulGridToExcel(ultraGrid5, "库存实绩");
  2426. }
  2427. }
  2428. }
  2429. }