FrmStraighteningResult.cs 174 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632
  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.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using com.steering.mes.zgmil.entity;
  13. using Infragistics.Win.UltraWinGrid;
  14. using Core.Mes.Client.Comm.Tool;
  15. using Core.StlMes.Client.ZGMil.NodeResultQuery;
  16. using Core.StlMes.Client.ZGMil.ResultConrtrol;
  17. using Core.StlMes.Client.ZGMil.Entity;
  18. using System.Net;
  19. using Core.StlMes.Client.ZGMil.Common;
  20. using Core.StlMes.Client.ZGMil.Popup;
  21. using CoreFS.SA06;
  22. namespace Core.StlMes.Client.ZGMil.Result
  23. {
  24. public partial class FrmStraighteningResult : FrmBase
  25. {
  26. #region 初始化
  27. private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
  28. public Infragistics.Win.UltraWinGrid.UltraGrid Grid
  29. {
  30. get { return _grid; }
  31. }
  32. public FrmStraighteningResult()
  33. {
  34. InitializeComponent();
  35. }
  36. int PanelSizeFlag = 0;
  37. RollingInfomation rf = new RollingInfomation();
  38. FeedRowPlan QuertFeedplan = new FeedRowPlan();
  39. MilPlan QueryMainPlan = new MilPlan();
  40. FeedRowPlan Feedplan = new FeedRowPlan();
  41. MilPlan MainPlan = new MilPlan();
  42. SawResult FeedSawResult = new SawResult();
  43. string PlanStatusQuery = "79";
  44. string PlanStartStatusQuery = "00"; //查询结炉实绩起始状态
  45. MilStraighteningResultEntity StraighteningResult = new MilStraighteningResultEntity();
  46. private string ActiveJUDGE_STOVE_NO = null;//主计划活动行的判定炉号
  47. private string ActiveStatus = null;////主计划活动行的状态
  48. private string proPlanId = null;//轧管订单编号
  49. private string gxPlanNo = null;//工序排产序号
  50. private string lotNo = null;//生产批号
  51. private string ActiveOFFLINE_FLAG = null;
  52. private string ActiveResultNo = null;
  53. private string WorkStand = "";//工作台
  54. private string Departm = "";//部门
  55. private string PlineCode = "";//产线
  56. private string stoveno = "";
  57. private string lotno = "";
  58. private string Flage = "";//
  59. MilStraighteningResultEntity temprstraght = new MilStraighteningResultEntity();//保存当前实绩类
  60. private string offlinenode = "";
  61. private string Shift = "";
  62. private string Group = "";
  63. private string _User = "";
  64. private string _UserName = ""; //签名 姓名
  65. private string _Url = ""; //签名 Url
  66. private string _UserID = ""; //签名 签名ID
  67. private string ChangeUserID = "";
  68. private string beforeQualifiedNum = "";//上道工序合格支数
  69. private string qualifiedNum = "";//该工序合格支数
  70. private string scrapNum = "";//该工序废品支数
  71. private string offineHas = "";//已下线支数
  72. private string offineHead = "";//返线支数
  73. protected override void OnLoad(EventArgs e)
  74. {
  75. base.OnLoad(e);
  76. //取消卡片筛选
  77. rollingInfomation1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  78. rollingCard1.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  79. straighteningResult1.UltraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  80. frmStraighteningResult11.UltraGrid4.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  81. frmStraighteningResult21.UltraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  82. ultraGridPlan.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  83. ultraGrid_GHDL1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  84. ultraGrid_GHDL2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  85. ultraGrid_GHDL3.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  86. //ChangeGridColor();
  87. InitControl();
  88. //PanelSizeFlag = 0;
  89. //splitContainer2.SplitterDistance = 180;
  90. foreach (UltraGridColumn ugc in ultraGridPlan.DisplayLayout.Bands[0].Columns)
  91. {
  92. ugc.SortIndicator = SortIndicator.Disabled;
  93. }
  94. }
  95. protected override void OnShown(EventArgs e)
  96. {
  97. base.OnShown(e);
  98. string hostname = Dns.GetHostName();
  99. IPAddress ip = Dns.GetHostByName(hostname).AddressList[0];
  100. NativeMethodNew na = new NativeMethodNew(this.ob);
  101. WorkStand = na.GetOperateResult(ip.ToString(), "1");
  102. if (!WorkStand.Contains("矫直"))
  103. {
  104. //MessageBox.Show("提示:该电脑不是矫直操作台电脑,不允许操作改界面", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  105. //this.Dispose();
  106. //this.Close();
  107. //return;
  108. }
  109. if (WorkStand.Contains("矫直") && WorkStand.Contains("1"))
  110. {
  111. offlinenode = "01";
  112. }
  113. if (WorkStand.Contains("矫直") && WorkStand.Contains("2"))
  114. {
  115. offlinenode = "02";
  116. }
  117. if (WorkStand.Contains("矫直") && WorkStand.Contains("3"))
  118. {
  119. offlinenode = "03";
  120. }
  121. Departm = UserInfo.GetDepartment();
  122. PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
  123. if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017") || PlineCode.Equals("C072"))
  124. {
  125. this.rollingCard1.ChangCard();
  126. }
  127. PlanQuery();
  128. //foreach (UltraGridRow ugr in ultraGridPlan.Rows)
  129. //{
  130. // ugr.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
  131. //}
  132. Shift = UserInfo.GetUserOrder();
  133. Group = UserInfo.GetUserGroup();
  134. Sign();
  135. ShowShift();
  136. }
  137. private void ShowShift()
  138. {
  139. colShowShiftGroup1.Ob = this.ob;
  140. colShowShiftGroup1.Group = this.UserInfo.GetUserGroup();
  141. colShowShiftGroup1.Shift = this.UserInfo.GetUserOrder();
  142. colShowShiftGroup1.ShowShift();
  143. colShowShiftGroup1.Timer1.Enabled = true;
  144. }
  145. /// <summary>
  146. /// 初始化控件
  147. /// </summary>
  148. public void InitControl()
  149. {
  150. if (chkLotNo.Checked)
  151. {
  152. txtLOT_NO.Enabled = true;
  153. }
  154. else
  155. {
  156. txtLOT_NO.Enabled = false;
  157. }
  158. if (chkHeatNo.Checked)
  159. {
  160. txtJudgeStoveNo.Enabled = true;
  161. }
  162. else
  163. {
  164. txtJudgeStoveNo.Enabled = false;
  165. }
  166. }
  167. #endregion
  168. /// <summary>
  169. /// 签名
  170. /// </summary>
  171. private void Sign()
  172. {
  173. ColUserName col = new ColUserName();
  174. col.StationId = "7";
  175. col.PlineCode = PlineCode;
  176. col.ColGroup = Group;
  177. col.Ob = this.ob;
  178. col.ShowDialog();
  179. _UserID = col.getUserId();
  180. _UserName = col.getUserName();
  181. }
  182. /// <summary>
  183. /// 按钮事件
  184. /// </summary>
  185. /// <param name="sender"></param>
  186. /// <param name="ToolbarKey"></param>
  187. public override void ToolBar_Click(object sender, string ToolbarKey)
  188. {
  189. switch (ToolbarKey)
  190. {
  191. case "Query":
  192. PlanQuery();
  193. break;
  194. case "Save":
  195. StraighteningSave();
  196. break;
  197. case "Node":
  198. StraighteningNode();
  199. break;
  200. case "DoNodeBack":
  201. NodeBack();
  202. break;
  203. case "NodeQuery":
  204. NodeQuery();
  205. break;
  206. case "colchang":
  207. colchang();
  208. break;
  209. case "DoChangeCancel":
  210. ChangeShiftBack();
  211. break;
  212. case "DoPrint":
  213. PrintResult();
  214. break;
  215. case "Dooffline":
  216. Offline();
  217. break;
  218. case "Doofflinre2":
  219. Offline2();
  220. break;
  221. case "Doofflinre3":
  222. Offline3();
  223. break;
  224. case "ReLine1":
  225. BackLine1();
  226. break;
  227. case "ReLine2":
  228. BackLine2();
  229. break;
  230. case "ReLine3":
  231. BackLine3();
  232. break;
  233. case "DoStart":
  234. DoStart();
  235. break;
  236. case "DoStartBack":
  237. StartBack();
  238. break;
  239. case "DoSign":
  240. Sign();
  241. break;
  242. case "Close":
  243. this.Dispose();
  244. this.Close();
  245. break;
  246. }
  247. }
  248. #region 辅助事件方法及赋值
  249. /// <summary>
  250. /// 修改IS_START名称
  251. /// </summary>
  252. public void ChangeCellName()
  253. {
  254. if (ultraGridPlan.Rows.Count > 0)
  255. {
  256. NativeMethodNew na = new NativeMethodNew(this.ob);
  257. foreach (UltraGridRow ugr in ultraGridPlan.Rows)
  258. {
  259. //String Judge_Stove_No = ugr.Cells["JUDGE_DTOVE_NO"].Value.ToString();
  260. //if (na.isBegineNode(Judge_Stove_No, 0))
  261. //{
  262. // ugr.Appearance.BackColor = Color.YellowGreen;
  263. //}
  264. if (ugr.Cells["IS_START"].Value.ToString() != "未开始矫直" && ugr.Cells["IS_START"].Value.ToString() != "已开始矫直" && ugr.Cells["IS_START"].Value.ToString() != "已完成矫直")
  265. {
  266. switch (Convert.ToInt32(ugr.Cells["IS_START"].Value))
  267. {
  268. case 3:
  269. ugr.Cells["IS_START"].Value = "未开始矫直";
  270. break;
  271. case 0:
  272. ugr.Cells["IS_START"].Value = "已开始矫直";
  273. break;
  274. case 1:
  275. ugr.Cells["IS_START"].Value = "已完成矫直";
  276. break;
  277. }
  278. }
  279. }
  280. }
  281. }
  282. public void ChangeGridColor()
  283. {
  284. foreach (UltraGridRow ugr in ultraGridPlan.Rows)
  285. {
  286. if (ugr.Cells["IS_START"].Value.ToString() == "已完成矫直")
  287. {
  288. ugr.Appearance.BackColor = Color.YellowGreen;
  289. }
  290. }
  291. if (ultraGrid_GHDL1.Rows.Count > 0)
  292. {
  293. foreach (UltraGridRow ugr in ultraGrid_GHDL1.Rows)
  294. {
  295. if (ugr != null)
  296. {
  297. switch (ugr.Cells["STATUS"].Value.ToString())
  298. {
  299. case "剔除":
  300. ugr.Appearance.BackColor = Color.Yellow;
  301. break;
  302. }
  303. switch (ugr.Cells["CHANGE_FLAG"].Value.ToString())
  304. {
  305. case "待接班确认":
  306. ugr.Appearance.BackColor = Color.LightGreen;
  307. break;
  308. }
  309. }
  310. }
  311. }
  312. if (ultraGrid_GHDL2.Rows.Count > 0)
  313. {
  314. foreach (UltraGridRow ugr in ultraGrid_GHDL2.Rows)
  315. {
  316. if (ugr != null)
  317. {
  318. switch (ugr.Cells["STATUS"].Value.ToString())
  319. {
  320. case "剔除":
  321. ugr.Appearance.BackColor = Color.Yellow;
  322. break;
  323. }
  324. switch (ugr.Cells["CHANGE_FLAG"].Value.ToString())
  325. {
  326. case "待接班确认":
  327. ugr.Appearance.BackColor = Color.LightGreen;
  328. break;
  329. }
  330. }
  331. }
  332. }
  333. if (ultraGrid_GHDL3.Rows.Count > 0)
  334. {
  335. foreach (UltraGridRow ugr in ultraGrid_GHDL3.Rows)
  336. {
  337. if (ugr != null)
  338. {
  339. switch (ugr.Cells["STATUS"].Value.ToString())
  340. {
  341. case "剔除":
  342. ugr.Appearance.BackColor = Color.Yellow;
  343. break;
  344. }
  345. switch (ugr.Cells["CHANGE_FLAG"].Value.ToString())
  346. {
  347. case "待接班确认":
  348. ugr.Appearance.BackColor = Color.LightGreen;
  349. break;
  350. }
  351. }
  352. }
  353. }
  354. }
  355. private void chkLotNo_CheckedChanged(object sender, EventArgs e)
  356. {
  357. this.txtLOT_NO.Enabled = this.chkLotNo.Checked;
  358. }
  359. private void chkHeatNo_CheckedChanged(object sender, EventArgs e)
  360. {
  361. if (this.chkHeatNo.Checked)
  362. {
  363. this.txtJudgeStoveNo.Enabled = true;
  364. }
  365. else
  366. {
  367. this.txtJudgeStoveNo.Enabled = false;
  368. }
  369. if (chkStatusQuery.Checked)
  370. {
  371. PlanStatusQuery = "99";
  372. PlanStartStatusQuery = "80";
  373. }
  374. else
  375. {
  376. PlanStatusQuery = "79";
  377. PlanStartStatusQuery = "00";
  378. }
  379. }
  380. /// <summary>
  381. /// 流通卡赋值
  382. /// </summary>
  383. /// <param name="dt"></param>
  384. public void RollingCardEditGrid(DataTable dt, string heatno)
  385. {
  386. if (dt.Rows.Count > 0)
  387. {
  388. //上料切前剔除支数
  389. this.rollingCard1.Value.FeedScrapNum = dt.Rows[0]["SCRAP_FEED"].ToString();
  390. //上料切前合格支数
  391. this.rollingCard1.Value.FeedQualifiedNum = dt.Rows[0]["QUALIFIED_FEED"].ToString();
  392. //上料剔除支数
  393. this.rollingCard1.Value.FeedScrapDBNum = dt.Rows[0]["SCRAP_DBFEED"].ToString();
  394. //上料合格支数
  395. this.rollingCard1.Value.FeedQualifiedDBNum = dt.Rows[0]["QUALIFIED_DBFEED"].ToString();
  396. //加热炉剔除支数
  397. this.rollingCard1.Value.FurScrapNum = dt.Rows[0]["SCRAP_FUR"].ToString();
  398. //加热炉合格支数
  399. this.rollingCard1.Value.FurQualifiedNum = dt.Rows[0]["QUALIFIED_FUR"].ToString();
  400. //穿孔剔除支数
  401. this.rollingCard1.Value.PerScrapNum = dt.Rows[0]["SCRAP_PER"].ToString();
  402. //穿孔合格支数
  403. this.rollingCard1.Value.PerQualifiedNum = dt.Rows[0]["QUALIFIED_PER"].ToString();
  404. //连轧剔除支数
  405. this.rollingCard1.Value.RollingScrapNum = dt.Rows[0]["SCRAP_ROLLING"].ToString();
  406. //连轧合格支数
  407. this.rollingCard1.Value.RollingQualifiedNum = dt.Rows[0]["QUALIFIED_ROLLING"].ToString();
  408. //再加热炉剔除支数
  409. this.rollingCard1.Value.RefurScrapNum = dt.Rows[0]["SCRAP_REFUR"].ToString();
  410. //再加热炉合格支数
  411. this.rollingCard1.Value.RefurQualifiedNum = dt.Rows[0]["QUALIFIED_REFUR"].ToString();
  412. //定径剔除支数
  413. this.rollingCard1.Value.SizingScrapNum = dt.Rows[0]["SCRAP_SIZING"].ToString();
  414. //定径合格支数
  415. this.rollingCard1.Value.SizingQualifiedNum = dt.Rows[0]["QUALIFIED_SIZING"].ToString();
  416. //分切前剔除支数
  417. this.rollingCard1.Value.SawScrapNumBE = dt.Rows[0]["SCRAP_SAW_BE"].ToString();
  418. //分切前合格支数
  419. this.rollingCard1.Value.SawQualifiedNumBE = dt.Rows[0]["QUALIFIED_SAW_BE"].ToString();
  420. //分切剔除支数
  421. this.rollingCard1.Value.SawScrapNum = dt.Rows[0]["SCRAP_SAW"].ToString();
  422. //分切合格支数
  423. this.rollingCard1.Value.SawQualifiedNum = dt.Rows[0]["QUALIFIED_SAW"].ToString();
  424. //矫直剔除支数
  425. this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
  426. //矫直合格支数
  427. this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
  428. //矫直下线支数
  429. this.rollingCard1.Value.OfflineStraight = dt.Rows[0]["OFFLINE_STRAIGHT"].ToString();
  430. //矫直返线支数
  431. this.rollingCard1.Value.BacklineStraight = dt.Rows[0]["BACKLINE_STRAIGHT"].ToString();
  432. //探伤剔除支数
  433. this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString();
  434. //探伤合格支数
  435. this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString();
  436. NativeMethodNew na = new NativeMethodNew(this.ob);
  437. if (na.isBegineNode(heatno, 8) || na.isBegineNode(heatno, 9) || na.isBegineNode(heatno, 10))
  438. {
  439. //探伤下线支数
  440. this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
  441. this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
  442. }
  443. else
  444. {
  445. if (dt.Rows[0]["OFFLINE_TESTING"].ToString() == "0")
  446. {
  447. this.rollingCard1.Value.OfflineTesting = "";
  448. this.rollingCard1.Value.BacklineTesting = "";
  449. }
  450. else
  451. {
  452. //探伤下线支数
  453. this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
  454. this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
  455. }
  456. }
  457. this.rollingCard1.UpdateData();
  458. }
  459. else
  460. {
  461. this.rollingCard1.ClearData();
  462. }
  463. }
  464. /// <summary>
  465. /// 流通卡赋值
  466. /// </summary>
  467. /// <param name="dt"></param>
  468. public void RollingCardEditGrid1(DataTable dt, string heatno)
  469. {
  470. if (dt.Rows.Count > 0)
  471. {
  472. //矫直剔除支数
  473. this.rollingCard1.Value.StraightScrapNum = dt.Rows[0]["SCRAP_STRAIGHT"].ToString();
  474. //矫直合格支数
  475. this.rollingCard1.Value.StraightQualifiedNum = dt.Rows[0]["QUALIFIED_STRAIGHT"].ToString();
  476. //矫直下线支数
  477. this.rollingCard1.Value.OfflineStraight = dt.Rows[0]["OFFLINE_STRAIGHT"].ToString();
  478. //矫直返线支数
  479. this.rollingCard1.Value.BacklineStraight = dt.Rows[0]["BACKLINE_STRAIGHT"].ToString();
  480. //探伤剔除支数
  481. this.rollingCard1.Value.TestingScrapNum = dt.Rows[0]["SCRAP_TESTING"].ToString();
  482. //探伤合格支数
  483. this.rollingCard1.Value.TestingQualifiedNum = dt.Rows[0]["QUALIFIED_TESTING"].ToString();
  484. NativeMethodNew na = new NativeMethodNew(this.ob);
  485. if (na.isBegineNode(heatno, 8) || na.isBegineNode(heatno, 9) || na.isBegineNode(heatno, 10))
  486. {
  487. //探伤下线支数
  488. this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
  489. this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
  490. }
  491. else
  492. {
  493. if (dt.Rows[0]["OFFLINE_TESTING"].ToString() == "0")
  494. {
  495. this.rollingCard1.Value.OfflineTesting = "";
  496. this.rollingCard1.Value.BacklineTesting = "";
  497. }
  498. else
  499. {
  500. //探伤下线支数
  501. this.rollingCard1.Value.OfflineTesting = dt.Rows[0]["OFFLINE_TESTING"].ToString();
  502. this.rollingCard1.Value.BacklineTesting = dt.Rows[0]["BACKLINE_TESTING"].ToString();
  503. }
  504. }
  505. this.rollingCard1.UpdateData();
  506. }
  507. else
  508. {
  509. this.rollingCard1.ClearData();
  510. }
  511. }
  512. public void RollingCardClear()
  513. {
  514. //上料切前剔除支数
  515. this.rollingCard1.Value.FeedScrapNum = "";
  516. //上料切前合格支数
  517. this.rollingCard1.Value.FeedQualifiedNum = "";
  518. //上料剔除支数
  519. this.rollingCard1.Value.FeedScrapDBNum = "";
  520. //上料合格支数
  521. this.rollingCard1.Value.FeedQualifiedDBNum = "";
  522. //加热炉剔除支数
  523. this.rollingCard1.Value.FurScrapNum = "";
  524. //加热炉合格支数
  525. this.rollingCard1.Value.FurQualifiedNum = "";
  526. //穿孔剔除支数
  527. this.rollingCard1.Value.PerScrapNum = "";
  528. //穿孔合格支数
  529. this.rollingCard1.Value.PerQualifiedNum = "";
  530. //连轧剔除支数
  531. this.rollingCard1.Value.RollingScrapNum = "";
  532. //连轧合格支数
  533. this.rollingCard1.Value.RollingQualifiedNum = "";
  534. //再加热炉剔除支数
  535. this.rollingCard1.Value.RefurScrapNum = "";
  536. //再加热炉合格支数
  537. this.rollingCard1.Value.RefurQualifiedNum = "";
  538. //定径剔除支数
  539. this.rollingCard1.Value.SizingScrapNum = "";
  540. //定径合格支数
  541. this.rollingCard1.Value.SizingQualifiedNum = "";
  542. //分切前剔除支数
  543. this.rollingCard1.Value.SawScrapNumBE = "";
  544. //分切前合格支数
  545. this.rollingCard1.Value.SawQualifiedNumBE = "";
  546. //分切剔除支数
  547. this.rollingCard1.Value.SawScrapNum = "";
  548. //分切合格支数
  549. this.rollingCard1.Value.SawQualifiedNum = "";
  550. //矫直剔除支数
  551. this.rollingCard1.Value.StraightScrapNum = "";
  552. //矫直合格支数
  553. this.rollingCard1.Value.StraightQualifiedNum = "";
  554. //矫直下线支数
  555. this.rollingCard1.Value.OfflineStraight = "";
  556. //矫直返线支数
  557. this.rollingCard1.Value.BacklineStraight = "";
  558. //探伤剔除支数
  559. this.rollingCard1.Value.TestingScrapNum = "";
  560. //探伤合格支数
  561. this.rollingCard1.Value.TestingQualifiedNum = "";
  562. //探伤下线支数
  563. this.rollingCard1.Value.OfflineTesting = "";
  564. this.rollingCard1.Value.BacklineTesting = "";
  565. this.rollingCard1.UpdateData();
  566. }
  567. /// <summary>
  568. /// 轧制信息Grid赋值
  569. /// </summary>
  570. /// <param name="dt">轧制计划信息datatable</param>
  571. public void GridEdit(DataTable dt)
  572. {
  573. if (dt.Rows.Count > 0)
  574. {
  575. DataRow row1 = dt.Rows[0];
  576. //熔炼炉号
  577. this.rollingInfomation1.Value.StoveNo = row1["stove_no"].ToString();
  578. //炉号
  579. this.rollingInfomation1.Value.JudgeStoveNo = BaseMethod.getJudgeStoveNo(row1["judge_stove_no"].ToString());
  580. //生产批号
  581. this.rollingInfomation1.Value.LotNo = row1["lot_no"].ToString();
  582. //工序合同号
  583. this.rollingInfomation1.Value.ContractNo = row1["contract_no"].ToString();
  584. //执行工艺号
  585. this.rollingInfomation1.Value.ImpProcess = row1["imp_process"].ToString();
  586. //执行工艺号路径
  587. this.rollingInfomation1.Value.ImpProcessPath = row1["imp_process_path"].ToString();
  588. //产线代码
  589. this.rollingInfomation1.Value.PlineCode = row1["pline_code"].ToString();
  590. //状态
  591. this.rollingInfomation1.Value.Status = row1["STATUS"].ToString();
  592. //监制
  593. this.rollingInfomation1.Value.Producer = row1["producer"].ToString();
  594. //工艺状态
  595. this.rollingInfomation1.Value.ProcessStatus = row1["process_status"].ToString();
  596. //单倍长
  597. this.rollingInfomation1.Value.DbLength = row1["db_length"].ToString();
  598. //单倍重
  599. this.rollingInfomation1.Value.DbHeight = row1["db_height"].ToString();
  600. //轧制长度
  601. this.rollingInfomation1.Value.RollLength = row1["roll_length"].ToString();
  602. //分切数
  603. this.rollingInfomation1.Value.SawNum = row1["saw_num"].ToString();
  604. //目标长度
  605. this.rollingInfomation1.Value.TargetLength = row1["target_length"].ToString();
  606. //最终用户
  607. this.rollingInfomation1.Value.FinishUser = row1["finish_user"].ToString();
  608. //目标库
  609. this.rollingInfomation1.Value.TargetLiabrary = row1["target_liabrary"].ToString();
  610. //品种
  611. this.rollingInfomation1.Value.Varieties = row1["varieties"].ToString();
  612. //成品规格
  613. this.rollingInfomation1.Value.PipeSize = row1["pipe_size"].ToString();
  614. //扣型
  615. this.rollingInfomation1.Value.BuckleType = row1["buckle_type"].ToString();
  616. //长度范围
  617. this.rollingInfomation1.Value.LengthRange = row1["length_range"].ToString();
  618. //轧管判定标准
  619. this.rollingInfomation1.Value.RollStandrad = row1["roll_standrad"].ToString();
  620. //断面
  621. this.rollingInfomation1.Value.PipeSection = row1["pipe_section"].ToString();
  622. //钢种代码
  623. this.rollingInfomation1.Value.SteelCode = row1["steelcode"].ToString();
  624. //钢种名称
  625. this.rollingInfomation1.Value.SteelName = row1["steelname"].ToString();
  626. //钢级代码
  627. this.rollingInfomation1.Value.GradeCode = row1["gradecode"].ToString();
  628. //钢级名称
  629. this.rollingInfomation1.Value.GradeName = row1["gradename"].ToString();
  630. //炼钢判定标准
  631. this.rollingInfomation1.Value.SteelStandrad = row1["steel_standrad"].ToString();
  632. //去向
  633. this.rollingInfomation1.Value.Target = row1["target"].ToString();
  634. //支
  635. this.rollingInfomation1.Value.PlanNum = row1["BRANCH"].ToString();
  636. //吨
  637. this.rollingInfomation1.Value.PlanTon = row1["TON"].ToString();
  638. //切损去向
  639. this.rollingInfomation1.Value.CutTarget = row1["cut_target"].ToString();
  640. //切损长度
  641. this.rollingInfomation1.Value.CutLength = row1["cut_length"].ToString();
  642. //切损重量
  643. this.rollingInfomation1.Value.CutHeight = row1["CUT_WEIGHT"].ToString();
  644. //倍尺数
  645. this.rollingInfomation1.Value.DbNum = row1["DB_NUM"].ToString();
  646. //标准类别代码
  647. this.rollingInfomation1.Value.StdStyle = row1["STD_STYLE"].ToString();
  648. //标准类别描述
  649. this.rollingInfomation1.Value.StdStyleDesc = row1["STD_STYLE_DESC"].ToString();
  650. //成品备注
  651. this.rollingInfomation1.Value.ReMark = row1["ReMark"].ToString();
  652. this.rollingInfomation1.UpdateData();
  653. }
  654. }
  655. /// <summary>
  656. /// 流通卡赋值
  657. /// </summary>
  658. public void GetRollingCard()
  659. {
  660. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  661. if (ugr != null)
  662. {
  663. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  664. DataTable dt = new DataTable();
  665. if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017"))
  666. {
  667. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  668. }
  669. else
  670. {
  671. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  672. }
  673. RollingCardEditGrid(dt, JudgeStoveNo);
  674. }
  675. }
  676. /// <summary>
  677. /// 流通卡赋值
  678. /// </summary>
  679. public void GetRollingCard1()
  680. {
  681. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  682. if (ugr != null)
  683. {
  684. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  685. DataTable dt = new DataTable();
  686. if (PlineCode.Equals("C009") || PlineCode.Equals("C012") || PlineCode.Equals("C017"))
  687. {
  688. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingCard1BackLine", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  689. }
  690. else
  691. {
  692. dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getRollingStaCard1", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  693. }
  694. RollingCardClear();
  695. RollingCardEditGrid1(dt, JudgeStoveNo);
  696. }
  697. }
  698. /// <summary>
  699. /// 查询跟踪记录信息
  700. /// </summary>
  701. public void ultraGridTC()
  702. {
  703. if (this.dtPlan.Rows.Count > 0)
  704. {
  705. this.dtTC1.Rows.Clear();
  706. this.dtTC2.Rows.Clear();
  707. this.dtTC3.Rows.Clear();
  708. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  709. string flagstatus = "0";
  710. if (this.ActiveStatus.Equals("已完成矫直"))
  711. {
  712. flagstatus = "1";
  713. }
  714. //UltraGridRow ugr = e.Row;
  715. if (ugr != null)
  716. {
  717. string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  718. MainPlan.JudgeStoveNo = HeatNo;
  719. DataTable dtMP1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingleMainPlanTC1", new object[] { MainPlan, flagstatus }, this.ob);
  720. DataTable dtMP2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingleMainPlanTC2", new object[] { MainPlan, flagstatus }, this.ob);
  721. DataTable dtMP3 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingleMainPlanTC3", new object[] { MainPlan, flagstatus }, this.ob);
  722. if (dtMP1.Rows.Count > 0)
  723. {
  724. //this.ultraTabControl2
  725. this.ultraTabControl2.Tabs[0].Visible = true;
  726. if (this.ultraTabControl1.Tabs[1].Visible == true)
  727. {
  728. this.frmStraighteningResult11.Using1();
  729. }
  730. GridHelper.CopyDataToDatatable(ref dtMP1, ref this.dtTC1, true);
  731. //ultraGrid_GHDL1.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  732. if (ultraGrid_GHDL1.Rows.Count > 0)
  733. {
  734. foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
  735. {
  736. ugr1.Cells["SCRAP_SLAB"].Value = "剔除钢管";
  737. ugr1.Cells["DELBACK"].Value = "剔料回退";
  738. ugr1.Cells["ChangShift"].Value = "交班操作";
  739. ugr1.Cells["BTNCHANGECOM"].Value = "接班操作";
  740. }
  741. }
  742. }
  743. else
  744. {
  745. this.ultraTabControl2.Tabs[0].Visible = false;
  746. if (this.ultraTabControl1.Tabs[1].Visible == true)
  747. {
  748. this.frmStraighteningResult11.NoUsing1();
  749. }
  750. }
  751. if (dtMP2.Rows.Count > 0)
  752. {
  753. this.ultraTabControl2.Tabs[1].Visible = true;
  754. if (this.ultraTabControl1.Tabs[1].Visible == true)
  755. {
  756. this.frmStraighteningResult11.Using2();
  757. }
  758. GridHelper.CopyDataToDatatable(ref dtMP2, ref this.dtTC2, true);
  759. //ultraGrid_GHDL2.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  760. if (ultraGrid_GHDL2.Rows.Count > 0)
  761. {
  762. foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
  763. {
  764. ugr1.Cells["SCRAP_SLAB"].Value = "剔除钢管";
  765. ugr1.Cells["DELBACK"].Value = "剔料回退";
  766. ugr1.Cells["ChangShift"].Value = "交班操作";
  767. ugr1.Cells["BTNCHANGECOM"].Value = "接班操作";
  768. }
  769. }
  770. }
  771. else
  772. {
  773. this.ultraTabControl2.Tabs[1].Visible = false;
  774. if (this.ultraTabControl1.Tabs[1].Visible == true)
  775. {
  776. this.frmStraighteningResult11.NoUsing2();
  777. }
  778. }
  779. if (dtMP3.Rows.Count > 0)
  780. {
  781. this.ultraTabControl2.Tabs[2].Visible = true;
  782. GridHelper.CopyDataToDatatable(ref dtMP3, ref this.dtTC3, true);
  783. //ultraGrid_GHDL3.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  784. if (ultraGrid_GHDL3.Rows.Count > 0)
  785. {
  786. foreach (UltraGridRow ugr1 in ultraGrid_GHDL3.Rows)
  787. {
  788. ugr1.Cells["SCRAP_SLAB"].Value = "剔除钢管";
  789. ugr1.Cells["DELBACK"].Value = "剔料回退";
  790. ugr1.Cells["ChangShift"].Value = "交班操作";
  791. ugr1.Cells["BTNCHANGECOM"].Value = "接班操作";
  792. }
  793. }
  794. }
  795. else
  796. {
  797. this.ultraTabControl2.Tabs[2].Visible = false;
  798. }
  799. ChangeGridColor();
  800. }
  801. }
  802. }
  803. /// <summary>
  804. /// 更新矫直实绩
  805. /// </summary>
  806. /// <param name="heatNo"></param>
  807. /// <param name="PliceCode"></param>
  808. public void GetStraightResult(string heatNo, string PliceCode)
  809. {
  810. StraighteningResult.Clear();
  811. string strheatno = heatNo;
  812. string factoryId = PliceCode;
  813. DataTable dtResult = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getPerResult", new object[] { strheatno, proPlanId, gxPlanNo }, this.ob);
  814. if (dtResult.Rows.Count > 0)
  815. {
  816. //获取表里相应的字段值到类中
  817. StraighteningResult = NativeMethod.GetTableToEntity(dtResult, StraighteningResult);
  818. if (factoryId == "C010")//168三个矫直台
  819. {
  820. ultraTabControl1.Tabs[0].Visible = true;
  821. ultraTabControl1.Tabs[1].Visible = false;
  822. ultraTabControl1.Tabs[2].Visible = false;
  823. //ultraTabControl2.Tabs[0].Visible = true;
  824. //ultraTabControl2.Tabs[1].Visible = true;
  825. //ultraTabControl2.Tabs[2].Visible = true;
  826. //设置168机组控件(straighteningResult1)值
  827. this.straighteningResult1.Value = StraighteningResult;
  828. if (WorkStand.Contains("矫直") && WorkStand.Contains("1"))
  829. {
  830. //this.straighteningResult1.NoUsing2();
  831. //this.straighteningResult1.NoUsing3();
  832. Flage = "1";
  833. }
  834. if (WorkStand.Contains("矫直") && WorkStand.Contains("2"))
  835. {
  836. //this.straighteningResult1.NoUsing1();
  837. //this.straighteningResult1.NoUsing3();
  838. Flage = "2";
  839. }
  840. if (WorkStand.Contains("矫直") && WorkStand.Contains("3"))
  841. {
  842. //this.straighteningResult1.NoUsing1();
  843. //this.straighteningResult1.NoUsing2();
  844. Flage = "3";
  845. }
  846. }
  847. else
  848. {
  849. if (factoryId == "C017")//460两个矫直台
  850. {
  851. ultraTabControl1.Tabs[0].Visible = false;
  852. ultraTabControl1.Tabs[1].Visible = false;
  853. ultraTabControl1.Tabs[2].Visible = true;
  854. //ultraTabControl1.Tabs[0].Visible = false;
  855. //ultraTabControl1.Tabs[1].Visible = true;
  856. //ultraTabControl1.Tabs[2].Visible = false;
  857. //ultraTabControl2.Tabs[0].Visible = true;
  858. //ultraTabControl2.Tabs[1].Visible = true;
  859. //ultraTabControl2.Tabs[2].Visible = false;
  860. // 设置460机组控件(frmStraighteningResult21)值
  861. this.frmStraighteningResult21.Value = StraighteningResult;
  862. //this.frmStraighteningResult11.Value = StraighteningResult;
  863. if (WorkStand.Contains("矫直") && WorkStand.Contains("1"))
  864. {
  865. //this.frmStraighteningResult21.NoUsing2();
  866. Flage = "1";
  867. }
  868. if (WorkStand.Contains("矫直") && WorkStand.Contains("2"))
  869. {
  870. //this.frmStraighteningResult21.NoUsing1();
  871. Flage = "2";
  872. }
  873. }
  874. else//2 个矫直台
  875. {
  876. ultraTabControl1.Tabs[0].Visible = false;
  877. ultraTabControl1.Tabs[1].Visible = true;
  878. ultraTabControl1.Tabs[2].Visible = false;
  879. //ultraTabControl2.Tabs[0].Visible = true;
  880. //ultraTabControl2.Tabs[1].Visible = true;
  881. //ultraTabControl2.Tabs[2].Visible = false;
  882. // 设置其他机组控件值
  883. this.frmStraighteningResult11.Value = StraighteningResult;
  884. if (WorkStand.Contains("矫直") && WorkStand.Contains("1"))
  885. {
  886. //this.frmStraighteningResult11.NoUsing2();
  887. Flage = "1";
  888. }
  889. if (WorkStand.Contains("矫直") && WorkStand.Contains("2"))
  890. {
  891. //this.frmStraighteningResult11.NoUsing1();
  892. Flage = "2";
  893. }
  894. }
  895. }
  896. }
  897. else
  898. {
  899. this.straighteningResult1.Value = StraighteningResult;
  900. this.frmStraighteningResult21.Value = StraighteningResult;
  901. this.frmStraighteningResult11.Value = StraighteningResult;
  902. }
  903. }
  904. #endregion
  905. #region 事件方法
  906. /// <summary>
  907. /// 主计划查询
  908. /// </summary>
  909. public void PlanQuery()
  910. {
  911. string PrimaKey = "";
  912. UltraGridRow ugr = this.ultraGridPlan.ActiveRow;
  913. if (ugr != null)
  914. {
  915. PrimaKey = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  916. }
  917. if (chkHeatNo.Checked == true)
  918. {
  919. if (this.txtJudgeStoveNo.Text == "")
  920. {
  921. MessageBox.Show("请输入炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  922. return;
  923. }
  924. else
  925. {
  926. QueryMainPlan.JudgeStoveNo = this.txtJudgeStoveNo.Text;
  927. }
  928. }
  929. else
  930. {
  931. QueryMainPlan.JudgeStoveNo = "";
  932. }
  933. if (chkLotNo.Checked == true)
  934. {
  935. if (this.txtLOT_NO.Text == "")
  936. {
  937. MessageBox.Show("请输入生产批号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  938. return;
  939. }
  940. else
  941. {
  942. QueryMainPlan.LotNo = this.txtLOT_NO.Text;
  943. }
  944. }
  945. else
  946. {
  947. QueryMainPlan.LotNo = "";
  948. }
  949. dtPlan.Rows.Clear();
  950. //ChangeGridColor();
  951. //查询主表记录
  952. QueryMainPlan.PlineCode = PlineCode;
  953. QueryMainPlan.Status = PlanStatusQuery;
  954. QueryMainPlan.StartStatus = PlanStartStatusQuery;
  955. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 8 }, this.ob);
  956. if (dt.Rows.Count == 0)
  957. {
  958. MessageBox.Show("未查询到匹配的数据,请重新查询!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  959. return;
  960. }
  961. else
  962. {
  963. GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);
  964. //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  965. ChangeCellName();
  966. ChangeGridColor();
  967. //this.ultraGridPlan.ActiveRow = null;
  968. if (ugr != null)
  969. {
  970. foreach (UltraGridRow ugr1 in ultraGridPlan.Rows)
  971. {
  972. ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString());
  973. if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == PrimaKey)
  974. {
  975. this.ultraGridPlan.ActiveRow = ugr1;
  976. }
  977. }
  978. }
  979. }
  980. }
  981. private String doQueryJugeNoStaus(string resultNo, string jugeNo, string plineCode)
  982. {
  983. string staus = "3";
  984. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.doQueryResultStaus", new object[] { resultNo, jugeNo, plineCode, "6", proPlanId, gxPlanNo }, ob);
  985. if (ds.Rows.Count > 0)
  986. {
  987. staus = ds.Rows[0]["NODE_FUR_FLAG"].ToString();
  988. }
  989. return staus;
  990. }
  991. /// <summary>
  992. /// 主表单击事件
  993. /// </summary>
  994. /// <param name="sender"></param>
  995. /// <param name="e"></param>
  996. private void ultraGridPlan_AfterRowActivate(object sender, EventArgs e)
  997. {
  998. if (this.dtPlan.Rows.Count > 0)
  999. {
  1000. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  1001. //UltraGridRow ugr = e.Row;
  1002. if (ugr != null)
  1003. {
  1004. //查询主计划信息
  1005. string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1006. string resultNo = ugr.Cells["ID"].Value.ToString();
  1007. proPlanId = ugr.Cells["PRO_PLAN_ID"].Value.ToString();
  1008. gxPlanNo = ugr.Cells["GX_PLAN_NO"].Value.ToString();
  1009. lotNo = ugr.Cells["LOT_NO"].Value.ToString();
  1010. MainPlan.JudgeStoveNo = HeatNo;
  1011. MainPlan.ProPlanId = proPlanId;
  1012. MainPlan.GxPlanNo = gxPlanNo;
  1013. ActiveJUDGE_STOVE_NO = HeatNo;
  1014. //string Status = ugr.Cells["IS_START"].Value.ToString();
  1015. string Status = doQueryJugeNoStaus(resultNo, HeatNo,PlineCode);
  1016. ActiveStatus = Status;
  1017. string PCode = ugr.Cells["Pline_Code"].Value.ToString();
  1018. PlineCode = PCode;
  1019. DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob);
  1020. if (dtMP.Rows.Count > 0)
  1021. {
  1022. ActiveResultNo = dtMP.Rows[0]["ID"].ToString();
  1023. ActiveOFFLINE_FLAG = dtMP.Rows[0]["OFFLINE_FLAG"].ToString();
  1024. if (dtMP.Rows[0]["PLINE_CODE"].ToString() == "C010")
  1025. {
  1026. ultraTabControl1.Tabs[0].Visible = true;
  1027. ultraTabControl1.Tabs[1].Visible = false;
  1028. ultraTabControl1.Tabs[2].Visible = false;
  1029. }
  1030. else
  1031. {
  1032. if (dtMP.Rows[0]["PLINE_CODE"].ToString() == "C017")
  1033. {
  1034. ultraTabControl1.Tabs[0].Visible = false;
  1035. ultraTabControl1.Tabs[1].Visible = false;
  1036. ultraTabControl1.Tabs[2].Visible = true;
  1037. }
  1038. else
  1039. {
  1040. ultraTabControl1.Tabs[0].Visible = false;
  1041. ultraTabControl1.Tabs[1].Visible = true;
  1042. ultraTabControl1.Tabs[2].Visible = false;
  1043. }
  1044. }
  1045. PlineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();
  1046. GridEdit(dtMP); //轧制计划信息
  1047. this.stoveno = dtMP.Rows[0]["STOVE_NO"].ToString();
  1048. this.lotno = dtMP.Rows[0]["LOT_NO"].ToString();
  1049. }
  1050. if (Status != "3")//查询跟踪记录表
  1051. {
  1052. ultraGridTC();
  1053. }
  1054. else
  1055. {
  1056. dtTC1.Rows.Clear();
  1057. dtTC2.Rows.Clear();
  1058. dtTC3.Rows.Clear();
  1059. }
  1060. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, ob);
  1061. GetStraightResult(HeatNo, PlineCode);//更新实绩
  1062. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  1063. {
  1064. GetRollingCard1();//更新流通卡
  1065. }
  1066. else
  1067. {
  1068. GetRollingCard();//更新流通卡
  1069. }
  1070. ChangeGridColor();
  1071. if (Status == "3" || Status == "1")//查询跟踪记录表
  1072. {
  1073. return;
  1074. }
  1075. UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
  1076. UltraGridRow ugr_roll = this.rollingCard1.UltraGrid4.Rows[0];
  1077. string JudgeStoveNo = ugr_plan.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1078. Status = ugr_plan.Cells["IS_START"].Value.ToString();
  1079. //查看结炉标识
  1080. DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  1081. if (dtFlag.Rows.Count > 0)
  1082. {
  1083. if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
  1084. {
  1085. //MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始分切,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1086. return;
  1087. }
  1088. if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
  1089. {
  1090. //MessageBox.Show("炉号【" + JudgeStoveNo + "】不能结炉,分切未完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1091. return;
  1092. }
  1093. }
  1094. else
  1095. {
  1096. return;
  1097. }
  1098. StraighteningResult.Clear();
  1099. if (PlineCode == "C010")
  1100. {
  1101. this.straighteningResult1.UltraGrid2.UpdateData();
  1102. StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.straighteningResult1.UltraGrid2, StraighteningResult);
  1103. int i = 0; int j = 0; int k = 0;
  1104. if (ultraGrid_GHDL1.Rows.Count > 0)
  1105. {
  1106. foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
  1107. {
  1108. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1109. {
  1110. i = i + 1;
  1111. }
  1112. }
  1113. }
  1114. if (ultraGrid_GHDL2.Rows.Count > 0)
  1115. {
  1116. foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
  1117. {
  1118. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1119. {
  1120. j = j + 1;
  1121. }
  1122. }
  1123. }
  1124. if (ultraGrid_GHDL3.Rows.Count > 0)
  1125. {
  1126. foreach (UltraGridRow ugr1 in ultraGrid_GHDL3.Rows)
  1127. {
  1128. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1129. {
  1130. k = k + 1;
  1131. }
  1132. }
  1133. }
  1134. StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
  1135. StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
  1136. StraighteningResult.QualifiedNum3 = k - int.Parse(StraighteningResult.ScrapNum3.ToString());
  1137. }
  1138. else
  1139. {
  1140. if (PlineCode == "C017")
  1141. {
  1142. this.frmStraighteningResult21.UltraGrid2.UpdateData();
  1143. StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult21.UltraGrid2, StraighteningResult);
  1144. int i = 0; int j = 0; int k = 0;
  1145. if (ultraGrid_GHDL1.Rows.Count > 0)
  1146. {
  1147. foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
  1148. {
  1149. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1150. {
  1151. i = i + 1;
  1152. }
  1153. }
  1154. }
  1155. if (ultraGrid_GHDL2.Rows.Count > 0)
  1156. {
  1157. foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
  1158. {
  1159. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1160. {
  1161. j = j + 1;
  1162. }
  1163. }
  1164. }
  1165. StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
  1166. StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
  1167. }
  1168. else
  1169. {
  1170. this.frmStraighteningResult11.UltraGrid4.UpdateData();
  1171. StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult11.UltraGrid4, StraighteningResult);
  1172. int i = 0; int j = 0; int k = 0;
  1173. if (ultraGrid_GHDL1.Rows.Count > 0)
  1174. {
  1175. foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
  1176. {
  1177. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1178. {
  1179. i = i + 1;
  1180. }
  1181. }
  1182. }
  1183. if (ultraGrid_GHDL2.Rows.Count > 0)
  1184. {
  1185. foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
  1186. {
  1187. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1188. {
  1189. j = j + 1;
  1190. }
  1191. }
  1192. }
  1193. StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
  1194. StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
  1195. }
  1196. }
  1197. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  1198. {
  1199. StraighteningResult.InMatNum = ds.Rows[0]["BRANCH"].ToString();
  1200. if (int.Parse(StraighteningResult.InMatNum.ToString()) >= int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString()))
  1201. {
  1202. StraighteningResult.QualifiedNum = int.Parse(StraighteningResult.InMatNum.ToString()) - int.Parse(this.rollingCard1.Value.OfflineStraight.ToString2()) - int.Parse(this.rollingCard1.Value.StraightScrapNum.ToString2());
  1203. }
  1204. }
  1205. else
  1206. {
  1207. if (!string.IsNullOrEmpty(ugr_roll.Cells["QualifiedNum10"].Value.ToString()))
  1208. {
  1209. //来料支数
  1210. StraighteningResult.InMatNum = ugr_roll.Cells["QualifiedNum10"].Value.ToString();
  1211. }
  1212. if (int.Parse(StraighteningResult.InMatNum.ToString()) > int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString()))
  1213. {
  1214. StraighteningResult.QualifiedNum = int.Parse(StraighteningResult.InMatNum.ToString()) - int.Parse(this.rollingCard1.Value.OfflineStraight.ToString2()) - int.Parse(this.rollingCard1.Value.StraightScrapNum.ToString2());
  1215. }
  1216. }
  1217. //else
  1218. //{
  1219. // MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1220. // return;
  1221. //}
  1222. //合格吨
  1223. double DBHeight = 0;
  1224. double BurnningRate = 0;
  1225. double BurnningRate1 = 0;
  1226. double DBNum = 1;
  1227. NativeMethodNew na = new NativeMethodNew(this.ob);
  1228. string JudgeStoveNotemp = BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "-01";
  1229. double percent = na.GetLengthPercent(JudgeStoveNotemp, this.ob, 0);
  1230. if (percent == 100.0)
  1231. {
  1232. MessageBox.Show("炉号:【" + JudgeStoveNo + "】尚未开始分切,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1233. return;
  1234. }
  1235. DataTable dtDBH = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getDbHeight", new object[] { JudgeStoveNo, ActiveResultNo, proPlanId, gxPlanNo }, this.ob);
  1236. if (dtDBH.Rows.Count > 0)
  1237. {
  1238. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_HEIGHT"].ToString()))
  1239. {
  1240. DBHeight = double.Parse(dtDBH.Rows[0]["DB_HEIGHT"].ToString());
  1241. }
  1242. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNNING_RATE"].ToString()))
  1243. {
  1244. BurnningRate = double.Parse(dtDBH.Rows[0]["BURNNING_RATE"].ToString());
  1245. }
  1246. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNINGRATE"].ToString()))
  1247. {
  1248. BurnningRate1 = double.Parse(dtDBH.Rows[0]["BURNINGRATE"].ToString());
  1249. }
  1250. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_NUM"].ToString()))
  1251. {
  1252. DBNum = double.Parse(dtDBH.Rows[0]["DB_NUM"].ToString());
  1253. }
  1254. }
  1255. //分产线 是否经过再加热炉
  1256. if (this.PlineCode == "C009" || PlineCode == "C012" || PlineCode == "C017")
  1257. {
  1258. double temp = DBHeight * (1 - (BurnningRate / 100));
  1259. double tempnum = double.Parse(StraighteningResult.QualifiedNum.ToString());
  1260. StraighteningResult.QaTon = temp * percent / 100 * tempnum;
  1261. }
  1262. else
  1263. {
  1264. double temp = DBHeight * (1 - (BurnningRate / 100)) * (1 - (BurnningRate1 / 100));
  1265. double tempnum = double.Parse(StraighteningResult.QualifiedNum.ToString());
  1266. StraighteningResult.QaTon = temp * percent / 100 * tempnum;
  1267. }
  1268. StraighteningResult.JudgeStoveNo = JudgeStoveNo;
  1269. StraighteningResult.NodeFurFlag = "1";
  1270. StraighteningResult.ColGroup = UserInfo.GetUserGroup();
  1271. StraighteningResult.ColShift = UserInfo.GetUserOrder();
  1272. StraighteningResult.ColUser = UserInfo.GetUserName();
  1273. StraighteningResult.GxPlanNo = gxPlanNo;
  1274. StraighteningResult.ProPlanId = proPlanId;
  1275. int countafter = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.Qunum", new object[] { StraighteningResult }, this.ob);
  1276. }
  1277. }
  1278. }
  1279. /// <summary>
  1280. /// 判断是否能开始当前炉次
  1281. /// </summary>
  1282. /// <returns></returns>
  1283. private bool IsStart()
  1284. {
  1285. bool Start = true;
  1286. foreach (UltraGridRow ugr in ultraGridPlan.Rows)
  1287. {
  1288. if (ugr.Cells["IS_START"].Value.ToString() == "已开始矫直")
  1289. {
  1290. MessageBox.Show("炉号【" + ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】正在矫直,不能两炉同时开始矫直", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1291. Start = false;
  1292. }
  1293. }
  1294. return Start;
  1295. }
  1296. /// <summary>
  1297. /// 双击上料事件
  1298. /// </summary>
  1299. /// <param name="sender"></param>
  1300. /// <param name="e"></param>
  1301. // private void ultraGridPlan_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
  1302. private void DoStart()
  1303. {
  1304. if (ultraGridPlan.Rows.Count > 0)
  1305. {
  1306. //if (!IsStart())
  1307. //{
  1308. // return;
  1309. //}
  1310. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  1311. if (ugr != null)
  1312. {
  1313. string HeatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1314. ActiveJUDGE_STOVE_NO = HeatNo;
  1315. MainPlan.JudgeStoveNo = HeatNo;
  1316. //string Status = ugr.Cells["IS_START"].Value.ToString();
  1317. string ResultNo = ugr.Cells["ID"].Value.ToString();
  1318. string Status = doQueryJugeNoStaus(ResultNo, HeatNo,PlineCode);
  1319. ActiveStatus = Status;
  1320. if (Status == "1")
  1321. {
  1322. MessageBox.Show("炉号:【" + HeatNo + "】已完成定径,不允许再次开始定径操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1323. return;
  1324. }
  1325. PlineCode = ugr.Cells["Pline_Code"].Value.ToString();
  1326. StraighteningResult.Clear();
  1327. if (Status == "0")
  1328. {
  1329. MessageBox.Show("矫直工序正在进行,无法进行再次矫直!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1330. return;
  1331. }
  1332. if (temprstraght != null)
  1333. {
  1334. StraighteningResult = NativeMethod.GetEntityToEntity(StraighteningResult, temprstraght);
  1335. StraighteningResult.ChangeNum = "";
  1336. StraighteningResult.InMatNum = "";
  1337. StraighteningResult.QualifiedNum = "";
  1338. StraighteningResult.QualifiedNum1 = "";
  1339. StraighteningResult.QualifiedNum2 = "";
  1340. StraighteningResult.QualifiedNum3 = "";
  1341. StraighteningResult.Remark = "";
  1342. StraighteningResult.ScrapNum = "";
  1343. StraighteningResult.ScrapNum1 = "";
  1344. StraighteningResult.ScrapNum2 = "";
  1345. StraighteningResult.ScrapNum3 = "";
  1346. StraighteningResult.SootBlowingTime = "";
  1347. StraighteningResult.StartTime = "";
  1348. StraighteningResult.EndTime = "";
  1349. }
  1350. DataTable dtMP = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlanForHeatNo", new object[] { MainPlan }, this.ob);
  1351. ActiveOFFLINE_FLAG = dtMP.Rows[0]["OFFLINE_FLAG"].ToString();
  1352. GridEdit(dtMP); //轧制计划信息
  1353. ActiveResultNo = dtMP.Rows[0]["ID"].ToString();
  1354. this.stoveno = dtMP.Rows[0]["STOVE_NO"].ToString();
  1355. this.lotno = dtMP.Rows[0]["LOT_NO"].ToString();
  1356. string PLineCode = dtMP.Rows[0]["PLINE_CODE"].ToString();
  1357. string LotNo = dtMP.Rows[0]["LOT_NO"].ToString();
  1358. string StoveNo = dtMP.Rows[0]["STOVE_NO"].ToString();
  1359. string Judge_stove_no = dtMP.Rows[0]["judge_stove_no"].ToString();
  1360. StraighteningResult.LotNo = LotNo;
  1361. StraighteningResult.ResultNo = ResultNo;
  1362. StraighteningResult.StoveNo = StoveNo;
  1363. StraighteningResult.PlineCode = PLineCode;
  1364. StraighteningResult.JudgeStoveNo = Judge_stove_no;
  1365. StraighteningResult.ColMode = "0";
  1366. StraighteningResult.ColGroup = UserInfo.GetUserGroup();
  1367. StraighteningResult.ColShift = UserInfo.GetUserOrder();
  1368. StraighteningResult.ColUser = UserInfo.GetUserName();
  1369. StraighteningResult.ProPlanId = proPlanId;
  1370. StraighteningResult.GxPlanNo = gxPlanNo;
  1371. //修改主表状态,插入矫直实绩
  1372. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.UpdateStraighteningStatue", new object[] { StraighteningResult }, this.ob);
  1373. if (count > 0)
  1374. {
  1375. NativeMethodNew na = new NativeMethodNew(this.ob);
  1376. na.InsertSTAferDoubleClick(HeatNo, 7, "0", proPlanId, gxPlanNo);
  1377. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 8 }, this.ob);
  1378. GridHelper.CopyDataToDatatable(ref dt, ref dtPlan, true);
  1379. //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  1380. ChangeCellName();
  1381. foreach (UltraGridRow ugr1 in this.ultraGridPlan.Rows)
  1382. {
  1383. ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString());
  1384. if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == HeatNo)
  1385. {
  1386. ultraGridPlan.ActiveRow = ugr1;
  1387. }
  1388. }
  1389. }
  1390. }
  1391. }
  1392. }
  1393. /// <summary>
  1394. /// 开始回退
  1395. /// </summary>
  1396. private void StartBack()
  1397. {
  1398. if (ultraGridPlan.Rows.Count > 0)
  1399. {
  1400. if (this.ultraGridPlan.ActiveRow == null)
  1401. {
  1402. MessageBox.Show("请选择需要回退的炉号!!!");
  1403. return;
  1404. }
  1405. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  1406. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1407. string ResultNo = ugr.Cells["ID"].Value.ToString();
  1408. //string StartStatus = ugr.Cells["IS_START"].Value.ToString();
  1409. string StartStatus = doQueryJugeNoStaus(ResultNo, JudgeStoveNo,PlineCode);
  1410. if (StartStatus == "1")
  1411. {
  1412. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已结炉,不能入炉回退!!!!");
  1413. return;
  1414. }
  1415. if (StartStatus == "3")
  1416. {
  1417. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未开始入炉,不能入炉回退!!!!");
  1418. return;
  1419. }
  1420. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.startBack", new object[] { JudgeStoveNo, ResultNo, 7, PlineCode, proPlanId, gxPlanNo }, this.ob);
  1421. ultraGridTC();
  1422. ChangeGridColor();
  1423. ChangeCellName();
  1424. PlanQuery();
  1425. }
  1426. }
  1427. /// <summary>
  1428. /// 保存跟踪记录表备注
  1429. /// </summary>
  1430. private void ultraGridMatSeq_AfterCellUpdate(object sender, CellEventArgs e)
  1431. {
  1432. UltraGridRow ugr = null;
  1433. string heatno = "";
  1434. int seq = 0;
  1435. string remark = "";
  1436. if (ultraTabControl2.Tabs[0].Visible == true)
  1437. {
  1438. ugr = ultraGrid_GHDL1.ActiveRow;
  1439. }
  1440. if (ultraTabControl2.Tabs[1].Visible == true)
  1441. {
  1442. ugr = ultraGrid_GHDL2.ActiveRow;
  1443. }
  1444. if (ultraTabControl2.Tabs[2].Visible == true)
  1445. {
  1446. ugr = ultraGrid_GHDL3.ActiveRow;
  1447. }
  1448. if (e.Cell.Column.Key == "REMARK")
  1449. {
  1450. if (ugr == null)
  1451. {
  1452. //MessageBox.Show("您未选择任何管号队列数据,请重新选择后再进行保存操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1453. return;
  1454. }
  1455. heatno = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1456. seq = Convert.ToInt16(ugr.Cells["SEQ"].Value.ToString());
  1457. if (!string.IsNullOrEmpty(ugr.Cells["REMARK"].Value.ToString()))
  1458. {
  1459. remark = ugr.Cells["REMARK"].Value.ToString();
  1460. }
  1461. else
  1462. {
  1463. remark = "";
  1464. }
  1465. NativeMethodNew na = new NativeMethodNew(this.ob);
  1466. na.SaveRackRemark(1, seq, heatno, remark);
  1467. }
  1468. }
  1469. /// <summary>
  1470. /// 保存
  1471. /// </summary>
  1472. public void StraighteningSave()
  1473. {
  1474. StraighteningResult.Clear();
  1475. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  1476. UltraGridRow ugr1 = straighteningResult1.UltraGrid2.Rows[0];
  1477. UltraGridRow ugr11 = frmStraighteningResult11.UltraGrid4.Rows[0];
  1478. UltraGridRow ugr21 = frmStraighteningResult21.UltraGrid2.Rows[0];
  1479. UltraGridRow ugr2 = this.rollingCard1.UltraGrid4.Rows[0];
  1480. string JudgeStoveNo = "";
  1481. string saveflag = "0";
  1482. if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
  1483. {
  1484. MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1485. return;
  1486. }
  1487. if (this.ultraGridPlan.ActiveRow == null)
  1488. {
  1489. JudgeStoveNo = ActiveJUDGE_STOVE_NO;
  1490. }
  1491. else
  1492. {
  1493. JudgeStoveNo = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1494. }
  1495. DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  1496. if (PlineCode == "C010")
  1497. {
  1498. this.straighteningResult1.UltraGrid2.UpdateData();
  1499. StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.straighteningResult1.UltraGrid2, StraighteningResult);
  1500. //StraighteningResult.QualifiedNum1 = "0";
  1501. //StraighteningResult.QualifiedNum1 = "0";
  1502. //StraighteningResult.QualifiedNum1 = "0";
  1503. //StraighteningResult.QualifiedNum1 = this.ultraGrid_GHDL1.Rows.Count - int.Parse(StraighteningResult.ScrapNum1.ToString());
  1504. //StraighteningResult.QualifiedNum2 = this.ultraGrid_GHDL2.Rows.Count - int.Parse(StraighteningResult.ScrapNum2.ToString());
  1505. //StraighteningResult.QualifiedNum3 = this.ultraGrid_GHDL3.Rows.Count - int.Parse(StraighteningResult.ScrapNum3.ToString());
  1506. }
  1507. else
  1508. {
  1509. if (PlineCode == "C017")
  1510. {
  1511. this.frmStraighteningResult21.UltraGrid2.UpdateData();
  1512. StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult21.UltraGrid2, StraighteningResult);
  1513. //StraighteningResult.QualifiedNum1 = "0";
  1514. //StraighteningResult.QualifiedNum1 = "0";
  1515. StraighteningResult.QualifiedNum3 = "0";
  1516. //StraighteningResult.QualifiedNum1 = this.ultraGrid_GHDL1.Rows.Count - int.Parse(StraighteningResult.ScrapNum1.ToString());
  1517. //StraighteningResult.QualifiedNum2 = this.ultraGrid_GHDL2.Rows.Count - int.Parse(StraighteningResult.ScrapNum2.ToString());
  1518. }
  1519. else
  1520. {
  1521. this.frmStraighteningResult11.UltraGrid4.UpdateData();
  1522. StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult11.UltraGrid4, StraighteningResult);
  1523. //StraighteningResult.QualifiedNum1 = "0";
  1524. //StraighteningResult.QualifiedNum1 = "0";
  1525. StraighteningResult.QualifiedNum3 = "0";
  1526. //StraighteningResult.QualifiedNum1 = this.ultraGrid_GHDL1.Rows.Count - int.Parse(StraighteningResult.ScrapNum1.ToString());
  1527. //StraighteningResult.QualifiedNum2 = this.ultraGrid_GHDL2.Rows.Count - int.Parse(StraighteningResult.ScrapNum2.ToString());
  1528. }
  1529. }
  1530. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);//查询计划是否为返线计划
  1531. if (dtFlag.Rows.Count > 0)
  1532. {
  1533. if (!string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
  1534. {
  1535. if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() == "1")
  1536. {
  1537. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  1538. {
  1539. //来料支数
  1540. StraighteningResult.InMatNum = ds.Rows[0]["BRANCH"].ToString();
  1541. StraighteningResult.QualifiedNum = "0";
  1542. }
  1543. else
  1544. {
  1545. if (!string.IsNullOrEmpty(ugr2.Cells["QualifiedNum10"].Value.ToString()))
  1546. {
  1547. //来料支数
  1548. StraighteningResult.InMatNum = ugr2.Cells["QualifiedNum10"].Value.ToString();
  1549. StraighteningResult.QualifiedNum = "0";
  1550. }
  1551. }
  1552. //if (int.Parse(StraighteningResult.InMatNum.ToString()) > int.Parse(ugr2.Cells["ScrapNum11"].Value.ToString()))
  1553. //{
  1554. // //合格支数
  1555. // StraighteningResult.QualifiedNum = int.Parse(StraighteningResult.InMatNum.ToString()) - int.Parse(ugr2.Cells["ScrapNum11"].Value.ToString());
  1556. //}
  1557. }
  1558. }
  1559. }
  1560. if (this.ultraGridPlan.ActiveRow == null && ActiveJUDGE_STOVE_NO == null)
  1561. {
  1562. MessageBox.Show("未选择任何炉号,请选择炉号后进行保存操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1563. return;
  1564. }
  1565. if (this.ultraGridPlan.ActiveRow == null)
  1566. {
  1567. StraighteningResult.JudgeStoveNo = ActiveJUDGE_STOVE_NO;
  1568. }
  1569. else
  1570. {
  1571. StraighteningResult.JudgeStoveNo = this.ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1572. }
  1573. if (ActiveStatus.Equals("3"))
  1574. {
  1575. MessageBox.Show("炉号:【" + StraighteningResult.JudgeStoveNo + "】未开始进行矫直,不允许进行保存操作!!!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1576. return;
  1577. }
  1578. if (ActiveStatus.Equals("1"))
  1579. {
  1580. saveflag = "1";
  1581. //MessageBox.Show("炉号:【" + StraighteningResult.JudgeStoveNo + "】已完成矫直,不允许进行保存操作!!!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1582. //return;
  1583. }
  1584. //if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + StraighteningResult.JudgeStoveNo + "】保存实绩?") == DialogResult.No)
  1585. //{
  1586. // return;
  1587. //}
  1588. ////剔除支数
  1589. //if (!string.IsNullOrEmpty(ugr1.Cells["ScrapNum"].Value.ToString()))
  1590. //{
  1591. // StraighteningResult.ScrapNum = ugr1.Cells["ScrapNum"].Value.ToString();
  1592. //}
  1593. //else
  1594. //{
  1595. // StraighteningResult.ScrapNum = "0";
  1596. //}
  1597. //入炉支数
  1598. //string lailiao = ugr2.Cells["QualifiedNum10"].Value.ToString();
  1599. //int ck = 0;
  1600. //if (string.IsNullOrEmpty(lailiao))
  1601. //{
  1602. // ck = 0;
  1603. //}
  1604. //else
  1605. //{
  1606. // ck = int.Parse(lailiao) - int.Parse(StraighteningResult.ScrapNum.ToString());
  1607. //}
  1608. StraighteningResult.ProPlanId = proPlanId;
  1609. StraighteningResult.GxPlanNo = gxPlanNo;
  1610. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.saveStraightening", new object[] { StraighteningResult, saveflag }, this.ob);
  1611. if (count > 0)
  1612. {
  1613. MessageBox.Show("炉号【" + StraighteningResult.JudgeStoveNo + "】保存成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1614. }
  1615. this.straighteningResult1.IsCellSelect = false;
  1616. this.frmStraighteningResult11.IsCellSelect = false;
  1617. this.frmStraighteningResult21.IsCellSelect = false;
  1618. temprstraght = NativeMethod.GetEntityToEntity(temprstraght, StraighteningResult);
  1619. GetRollingCard();
  1620. }
  1621. /// <summary>
  1622. /// 结炉操作
  1623. /// 1、判断上一道工序结炉状态,2、更新实绩表(包括结炉时间,结炉状态),3.更新主表NODE_STATUS
  1624. /// </summary>
  1625. public void StraighteningNode()
  1626. {
  1627. StraighteningSave();
  1628. StraighteningResult.Clear();
  1629. if (this.ultraGridPlan.ActiveRow == null)
  1630. {
  1631. MessageBox.Show("未选择任何炉号,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1632. return;
  1633. }
  1634. UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
  1635. UltraGridRow ugr_roll = this.rollingCard1.UltraGrid4.Rows[0];
  1636. string JudgeStoveNo = ugr_plan.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1637. string resultNo = ugr_plan.Cells["ID"].Value.ToString();
  1638. //string Status = ugr_plan.Cells["IS_START"].Value.ToString();
  1639. string Status = doQueryJugeNoStaus(resultNo, JudgeStoveNo,PlineCode);
  1640. NativeMethodNew na = new NativeMethodNew(this.ob);
  1641. int WaitChangeSeq1 = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "1", proPlanId, gxPlanNo);
  1642. int WaitChangeSeq2 = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "2", proPlanId, gxPlanNo);
  1643. if (WaitChangeSeq1 > 0)
  1644. {
  1645. MessageBox.Show("序号:【" + WaitChangeSeq1 + "】子管未接班确认,不能结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1646. return;
  1647. }
  1648. if (WaitChangeSeq2 > 0)
  1649. {
  1650. MessageBox.Show("序号:【" + WaitChangeSeq2 + "】子管未接班确认,不能结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1651. return;
  1652. }
  1653. if (this.PlineCode.Equals("C010"))
  1654. {
  1655. int WaitChangeSeq3 = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "3", proPlanId, gxPlanNo);
  1656. if (WaitChangeSeq3 > 0)
  1657. {
  1658. MessageBox.Show("序号:【" + WaitChangeSeq3 + "】子管未接班确认,不能结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1659. return;
  1660. }
  1661. }
  1662. if (Status == "1")
  1663. {
  1664. MessageBox.Show("炉号:【" + JudgeStoveNo + "】已完成矫直,不允许进行结炉操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1665. return;
  1666. }
  1667. if (Status != "0")
  1668. {
  1669. MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始矫直,不允许结炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1670. return;
  1671. }
  1672. //查看结炉标识
  1673. DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  1674. if (dtFlag.Rows.Count > 0)
  1675. {
  1676. if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
  1677. {
  1678. MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始分切,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1679. return;
  1680. }
  1681. if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
  1682. {
  1683. MessageBox.Show("炉号【" + JudgeStoveNo + "】不能结炉,分切未完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1684. return;
  1685. }
  1686. }
  1687. if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + JudgeStoveNo + "】结炉?") == DialogResult.No)
  1688. {
  1689. return;
  1690. }
  1691. if (PlineCode == "C010")
  1692. {
  1693. this.straighteningResult1.UltraGrid2.UpdateData();
  1694. StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.straighteningResult1.UltraGrid2, StraighteningResult);
  1695. int i = 0; int j = 0; int k = 0;
  1696. if (ultraGrid_GHDL1.Rows.Count > 0)
  1697. {
  1698. foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
  1699. {
  1700. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1701. {
  1702. i = i + 1;
  1703. }
  1704. }
  1705. }
  1706. if (ultraGrid_GHDL2.Rows.Count > 0)
  1707. {
  1708. foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
  1709. {
  1710. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1711. {
  1712. j = j + 1;
  1713. }
  1714. }
  1715. }
  1716. if (ultraGrid_GHDL3.Rows.Count > 0)
  1717. {
  1718. foreach (UltraGridRow ugr1 in ultraGrid_GHDL3.Rows)
  1719. {
  1720. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1721. {
  1722. k = k + 1;
  1723. }
  1724. }
  1725. }
  1726. StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
  1727. StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
  1728. StraighteningResult.QualifiedNum3 = k - int.Parse(StraighteningResult.ScrapNum3.ToString());
  1729. }
  1730. else
  1731. {
  1732. if (PlineCode == "C017")
  1733. {
  1734. this.frmStraighteningResult21.UltraGrid2.UpdateData();
  1735. StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult21.UltraGrid2, StraighteningResult);
  1736. int i = 0; int j = 0; int k = 0;
  1737. if (ultraGrid_GHDL1.Rows.Count > 0)
  1738. {
  1739. foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
  1740. {
  1741. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1742. {
  1743. i = i + 1;
  1744. }
  1745. }
  1746. }
  1747. if (ultraGrid_GHDL2.Rows.Count > 0)
  1748. {
  1749. foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
  1750. {
  1751. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1752. {
  1753. j = j + 1;
  1754. }
  1755. }
  1756. }
  1757. StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
  1758. StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
  1759. StraighteningResult.QualifiedNum3 = "0";
  1760. }
  1761. else
  1762. {
  1763. this.frmStraighteningResult11.UltraGrid4.UpdateData();
  1764. StraighteningResult = NativeMethod.GetUltraGridToEntityNEW(this.frmStraighteningResult11.UltraGrid4, StraighteningResult);
  1765. int i = 0; int j = 0; int k = 0;
  1766. if (ultraGrid_GHDL1.Rows.Count > 0)
  1767. {
  1768. foreach (UltraGridRow ugr1 in ultraGrid_GHDL1.Rows)
  1769. {
  1770. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1771. {
  1772. i = i + 1;
  1773. }
  1774. }
  1775. }
  1776. if (ultraGrid_GHDL2.Rows.Count > 0)
  1777. {
  1778. foreach (UltraGridRow ugr1 in ultraGrid_GHDL2.Rows)
  1779. {
  1780. if (!string.IsNullOrEmpty(ugr1.Cells["MAT_NO"].Value.ToString()))
  1781. {
  1782. j = j + 1;
  1783. }
  1784. }
  1785. }
  1786. StraighteningResult.QualifiedNum1 = i - int.Parse(StraighteningResult.ScrapNum1.ToString());
  1787. StraighteningResult.QualifiedNum2 = j - int.Parse(StraighteningResult.ScrapNum2.ToString());
  1788. StraighteningResult.QualifiedNum3 = "0";
  1789. }
  1790. }
  1791. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  1792. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  1793. {
  1794. //来料支数
  1795. StraighteningResult.InMatNum = ds.Rows[0]["BRANCH"].ToString();
  1796. if (int.Parse(StraighteningResult.InMatNum.ToString3()) >= int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString3()))
  1797. {
  1798. //合格支数
  1799. StraighteningResult.QualifiedNum = int.Parse(StraighteningResult.InMatNum.ToString()) - int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString3()) - int.Parse(ugr_roll.Cells["Offline11"].Value.ToString3());
  1800. }
  1801. else
  1802. {
  1803. MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1804. return;
  1805. }
  1806. }
  1807. else
  1808. {
  1809. if (!string.IsNullOrEmpty(ugr_roll.Cells["QualifiedNum10"].Value.ToString()))
  1810. {
  1811. //来料支数
  1812. StraighteningResult.InMatNum = ugr_roll.Cells["QualifiedNum10"].Value.ToString();
  1813. }
  1814. if (int.Parse(StraighteningResult.InMatNum.ToString3()) >= int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString3()))
  1815. {
  1816. //合格支数
  1817. StraighteningResult.QualifiedNum = int.Parse(StraighteningResult.InMatNum.ToString()) - int.Parse(ugr_roll.Cells["ScrapNum11"].Value.ToString3()) - int.Parse(ugr_roll.Cells["Offline11"].Value.ToString3());
  1818. }
  1819. else
  1820. {
  1821. MessageBox.Show("存在上一道工序已经剔除的管坯在本道工序也剔除了,请回退后再进行结炉操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1822. return;
  1823. }
  1824. }
  1825. //合格吨
  1826. double DBHeight = 0;
  1827. double BurnningRate = 0;
  1828. double BurnningRate1 = 0;
  1829. double DBNum = 1;
  1830. NativeMethodNew natemp = new NativeMethodNew(this.ob);
  1831. string JudgeStoveNotemp = BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "-01";
  1832. double percent = natemp.GetLengthPercent(JudgeStoveNotemp, this.ob, 0);
  1833. if (percent == 100.0)
  1834. {
  1835. MessageBox.Show("炉号:【" + JudgeStoveNo + "】尚未开始分切,不允许结炉", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1836. return;
  1837. }
  1838. DataTable dtDBH = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getDbHeight", new object[] { JudgeStoveNo, ActiveResultNo, proPlanId, gxPlanNo }, this.ob);
  1839. if (dtDBH.Rows.Count > 0)
  1840. {
  1841. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_HEIGHT"].ToString()))
  1842. {
  1843. DBHeight = double.Parse(dtDBH.Rows[0]["DB_HEIGHT"].ToString());
  1844. }
  1845. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNNING_RATE"].ToString()))
  1846. {
  1847. BurnningRate = double.Parse(dtDBH.Rows[0]["BURNNING_RATE"].ToString());
  1848. }
  1849. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["BURNINGRATE"].ToString()))
  1850. {
  1851. BurnningRate1 = double.Parse(dtDBH.Rows[0]["BURNINGRATE"].ToString());
  1852. }
  1853. if (!string.IsNullOrEmpty(dtDBH.Rows[0]["DB_NUM"].ToString()))
  1854. {
  1855. DBNum = double.Parse(dtDBH.Rows[0]["DB_NUM"].ToString());
  1856. }
  1857. }
  1858. //分产线 是否经过再加热炉
  1859. if (this.PlineCode == "C009" || PlineCode == "C012" || PlineCode == "C017")
  1860. {
  1861. double temp = DBHeight * (1 - (BurnningRate / 100));
  1862. double tempnum = double.Parse(StraighteningResult.QualifiedNum.ToString());
  1863. StraighteningResult.QaTon = temp * percent / 100 * tempnum;
  1864. }
  1865. else
  1866. {
  1867. double temp = DBHeight * (1 - (BurnningRate / 100)) * (1 - (BurnningRate1 / 100));
  1868. double tempnum = double.Parse(StraighteningResult.QualifiedNum.ToString());
  1869. StraighteningResult.QaTon = temp * percent / 100 * tempnum;
  1870. }
  1871. StraighteningResult.JudgeStoveNo = JudgeStoveNo;
  1872. StraighteningResult.NodeFurFlag = "1";
  1873. StraighteningResult.ColGroup = UserInfo.GetUserGroup();
  1874. StraighteningResult.ColShift = UserInfo.GetUserOrder();
  1875. StraighteningResult.ColUser = UserInfo.GetUserName();
  1876. StraighteningResult.UserId = _UserID;
  1877. StraighteningResult.ProPlanId = proPlanId;
  1878. StraighteningResult.GxPlanNo = gxPlanNo;
  1879. StraighteningResult.LotNo = lotNo;
  1880. StraighteningResult.PlineCode = PlineCode;
  1881. CoreClientParam ccp = new CoreClientParam();
  1882. ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
  1883. ccp.MethodName = "updateMilSlab";
  1884. ccp.ServerParams = new object[] { JudgeStoveNo, "9", proPlanId, gxPlanNo };
  1885. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1886. if (ccp.ReturnCode != -1)
  1887. {
  1888. if (ccp.ReturnInfo.Equals("修改成功!"))
  1889. {
  1890. //更新进程表,废品入库存
  1891. ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
  1892. ccp.MethodName = "updateProcessL";
  1893. ccp.ServerParams = new object[] { JudgeStoveNo, "9", "9", proPlanId, gxPlanNo, lotNo, PlineCode };
  1894. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1895. if (ccp.ReturnCode != -1)
  1896. {
  1897. if (ccp.ReturnInfo.Equals("修改成功!"))
  1898. {
  1899. //结炉操作:保存实绩,修改结炉状态
  1900. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.saveStraighteningNODE", new object[] { StraighteningResult }, this.ob);
  1901. //MessageBox.Show("结炉操作完成", "提示 :", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1902. if (count > 0)
  1903. {
  1904. //int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.scrapNodeMat", new object[] { JudgeStoveNo, 8, 0 }, this.ob);
  1905. ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
  1906. ccp.MethodName = "assignmentMatNo";
  1907. ccp.ServerParams = new object[] { JudgeStoveNo, "8", PlineCode, proPlanId, gxPlanNo };
  1908. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1909. if (ccp.ReturnCode != -1)
  1910. {
  1911. if (ccp.ReturnInfo.Equals("修改成功!"))
  1912. {
  1913. //往跟踪记录表插入探伤开始时间
  1914. NativeMethodNew nas = new NativeMethodNew(this.ob);
  1915. nas.InsertSTAferDoubleClick(JudgeStoveNo, 7, "1", proPlanId, gxPlanNo);
  1916. NativeMethod.CheckNodeMatStatus(JudgeStoveNo, proPlanId, gxPlanNo, 7, this.ob);
  1917. this.straighteningResult1.IsCellSelect = false;
  1918. this.frmStraighteningResult11.IsCellSelect = false;
  1919. this.frmStraighteningResult21.IsCellSelect = false;
  1920. temprstraght = NativeMethod.GetEntityToEntity(temprstraght, StraighteningResult);
  1921. DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getSingleMainPlan", new object[] { QueryMainPlan, 8 }, this.ob);
  1922. GridHelper.CopyDataToDatatable(ref dt1, ref dtPlan, true);
  1923. //ultraGridPlan.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  1924. ChangeCellName();
  1925. foreach (UltraGridRow ugr1 in this.ultraGridPlan.Rows)
  1926. {
  1927. ugr1.Cells["JUDGE_NO"].Value = BaseMethod.getJudgeStoveNo(ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString());
  1928. if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == JudgeStoveNo)
  1929. {
  1930. ultraGridPlan.ActiveRow = ugr1;
  1931. }
  1932. }
  1933. this.dataSet2.Clear();
  1934. MessageUtil.ShowTips("炉号:【" + JudgeStoveNo + "】结炉成功!");
  1935. }
  1936. }
  1937. else
  1938. {
  1939. MessageUtil.ShowTips(ccp.ReturnInfo);
  1940. }
  1941. }
  1942. }
  1943. else
  1944. {
  1945. MessageUtil.ShowTips(ccp.ReturnInfo);
  1946. }
  1947. }
  1948. }
  1949. }
  1950. }
  1951. /// <summary>
  1952. ///
  1953. /// </summary>
  1954. private void NodeBack()
  1955. {
  1956. if (this.ultraGridPlan.ActiveRow == null)
  1957. {
  1958. MessageBox.Show("请选择需要回退的炉号!!!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1959. return;
  1960. }
  1961. UltraGridRow ugr = ultraGridPlan.ActiveRow;
  1962. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  1963. string ResultNo = ugr.Cells["ID"].Value.ToString();
  1964. //string NodeFlag = ugr.Cells["IS_START"].Value.ToString();
  1965. string NodeFlag = doQueryJugeNoStaus(ResultNo, JudgeStoveNo, PlineCode);
  1966. DataTable dtMat = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryMatScrap", new object[] { JudgeStoveNo, PlineCode, proPlanId, gxPlanNo }, this.ob);
  1967. if (dtMat.Rows.Count > 0)
  1968. {
  1969. if (int.Parse(dtMat.Rows[0][0].ToString()) > 0)
  1970. {
  1971. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】的废品已发运,不能结炉回退!!!!");
  1972. return;
  1973. }
  1974. }
  1975. DataTable dtKG_FLAG = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetStraightKG_Flag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, this.ob);
  1976. if (dtKG_FLAG.Rows.Count > 0)
  1977. {
  1978. string kgflag = dtKG_FLAG.Rows[0]["KG_FLAG"].ToString();
  1979. //if (kgflag.Equals("1"))
  1980. //{
  1981. // MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】 为探伤返线生成,不允许结炉回退。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1982. // return;
  1983. //}
  1984. }
  1985. if (NodeFlag != "1")
  1986. {
  1987. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】未结炉,不能结炉回退!!!!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1988. return;
  1989. }
  1990. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.doQueryOffline", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  1991. if (ds.Rows.Count > 0)
  1992. {
  1993. MessageUtil.ShowTips("探伤工序存在下线实绩,不允许结炉回退!");
  1994. return;
  1995. }
  1996. DataTable ds1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.doQueryStraighteningOfflineBack", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  1997. if (ds1.Rows.Count > 0)
  1998. {
  1999. string BACKLINE_NUM = ds1.Rows[0]["BACKLINE_NUM"].ToString();
  2000. MessageUtil.ShowTips("矫直工序存在离线数据已 返线或者组炉 " + BACKLINE_NUM + "支,不允许结炉回退!");
  2001. return;
  2002. }
  2003. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, proPlanId, gxPlanNo }, this.ob);
  2004. if (dt.Rows.Count > 0)
  2005. {
  2006. string NodeProcess = ""; //当前炉次结炉工序
  2007. string NodeStatus = dt.Rows[0][0].ToString();
  2008. switch (NodeStatus)
  2009. {
  2010. case "30":
  2011. NodeProcess = "穿孔";
  2012. break;
  2013. case "40":
  2014. NodeProcess = "连轧";
  2015. break;
  2016. case "50":
  2017. NodeProcess = "再加热炉";
  2018. break;
  2019. case "60":
  2020. NodeProcess = "定径";
  2021. break;
  2022. case "70":
  2023. NodeProcess = "分切";
  2024. break;
  2025. case "80":
  2026. NodeProcess = "矫直";
  2027. break;
  2028. case "90":
  2029. NodeProcess = "探伤";
  2030. break;
  2031. case "96":
  2032. NodeProcess = "质检";
  2033. break;
  2034. }
  2035. if (NodeStatus != "80")
  2036. {
  2037. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】 " + NodeProcess + "工序已结炉,当前工序不能结炉回退", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2038. return;
  2039. }
  2040. }
  2041. ////判断当前炉次下道工序是否结炉 下道工序结炉 - 不允许回退
  2042. //int Seq = 0;
  2043. //DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.changeFlagQuery", new object[] { JudgeStoveNo, ResultNo, 7 , proPlanId, gxPlanNo}, this.ob);
  2044. //if (dt2.Rows.Count > 0)
  2045. //{
  2046. // Seq = int.Parse(dt2.Rows[0][0].ToString());
  2047. //}
  2048. //int count2 = ServerHelper.SetData("com.steering.mes.zgmil.coup.FeedSawResult.nodeBack", new object[] { JudgeStoveNo, ResultNo, 7, PlineCode, Seq, 0 }, this.ob);
  2049. string Group = UserInfo.GetUserGroup();
  2050. string Shift = UserInfo.GetUserOrder();
  2051. //查询结炉班次班组
  2052. DataTable dtNodeGroup = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.doNodeBackCheck", new object[] { JudgeStoveNo, ResultNo, 7, proPlanId, gxPlanNo }, this.ob);
  2053. if (dtNodeGroup.Rows.Count > 0)
  2054. {
  2055. string NodeShift = dtNodeGroup.Rows[0][0].ToString();
  2056. string NodeGroup = dtNodeGroup.Rows[0][1].ToString();
  2057. if (Shift == NodeShift && Group == NodeGroup)
  2058. {
  2059. NativeMethodNew nas = new NativeMethodNew(this.ob);
  2060. if (this.ultraTabControl2.Tabs[0].Visible == true)
  2061. {
  2062. nas.NodeBack(JudgeStoveNo, ResultNo, this.PlineCode, 0, "1", proPlanId, gxPlanNo, lotNo);
  2063. }
  2064. if (this.ultraTabControl2.Tabs[1].Visible == true)
  2065. {
  2066. nas.NodeBack(JudgeStoveNo, ResultNo, this.PlineCode, 0, "2", proPlanId, gxPlanNo, lotNo);
  2067. }
  2068. if (this.ultraTabControl2.Tabs[2].Visible == true)
  2069. {
  2070. nas.NodeBack(JudgeStoveNo, ResultNo, this.PlineCode, 0, "3", proPlanId, gxPlanNo, lotNo);
  2071. }
  2072. CoreClientParam ccp = new CoreClientParam();
  2073. ccp.ServerName = "com.steering.mes.zgmil.coup.FrmOffLine";
  2074. ccp.MethodName = "insertMatScrapBack";
  2075. ccp.ServerParams = new object[] { JudgeStoveNo, proPlanId, gxPlanNo, PlineCode, "9" };
  2076. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2077. if (ccp.ReturnCode != -1)
  2078. { MessageUtil.ShowTips(ccp.ReturnInfo); }
  2079. ChangeGridColor();
  2080. PlanQuery();
  2081. }
  2082. else
  2083. {
  2084. switch (NodeShift)
  2085. {
  2086. case "0":
  2087. NodeShift = "白班";
  2088. break;
  2089. case "1":
  2090. NodeShift = "早班";
  2091. break;
  2092. case "2":
  2093. NodeShift = "中班";
  2094. break;
  2095. case "3":
  2096. NodeShift = "夜班";
  2097. break;
  2098. }
  2099. switch (NodeGroup)
  2100. {
  2101. case "1":
  2102. NodeGroup = "甲班";
  2103. break;
  2104. case "2":
  2105. NodeGroup = "乙班";
  2106. break;
  2107. case "3":
  2108. NodeGroup = "丙班";
  2109. break;
  2110. case "4":
  2111. NodeGroup = "丁班";
  2112. break;
  2113. }
  2114. switch (this.UserInfo.GetUserOrder())
  2115. {
  2116. case "0":
  2117. Shift = "白班";
  2118. break;
  2119. case "1":
  2120. Shift = "早班";
  2121. break;
  2122. case "2":
  2123. Shift = "中班";
  2124. break;
  2125. case "3":
  2126. Shift = "夜班";
  2127. break;
  2128. }
  2129. switch (this.UserInfo.GetUserGroup())
  2130. {
  2131. case "1":
  2132. Group = "甲班";
  2133. break;
  2134. case "2":
  2135. Group = "乙班";
  2136. break;
  2137. case "3":
  2138. Group = "丙班";
  2139. break;
  2140. case "4":
  2141. Group = "丁班";
  2142. break;
  2143. }
  2144. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(JudgeStoveNo) + "】已由" + NodeGroup + "," + NodeShift + "结炉,当班不能结炉回退");
  2145. return;
  2146. }
  2147. }
  2148. }
  2149. /// <summary>
  2150. /// 1#剔除
  2151. /// </summary>
  2152. /// <param name="sender"></param>
  2153. /// <param name="e"></param>
  2154. private void ultraGrid_GHDL1_ClickCellButton(object sender, CellEventArgs e)
  2155. {
  2156. int countss = 0;
  2157. MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity();
  2158. UltraGridRow ugr = ultraGrid_GHDL1.ActiveRow;
  2159. UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
  2160. string PlanStatuss = ultraGridPlan.ActiveRow.Cells["IS_START"].Value.ToString();
  2161. if (PlanStatuss != "已开始矫直")
  2162. {
  2163. MessageBox.Show("炉号【" + ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】不是已开始矫直状态,不允许操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2164. return;
  2165. }
  2166. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2167. String MAT_NO = ugr.Cells["MAT_NO"].Value.ToString();
  2168. String Seq = ugr.Cells["seq"].Value.ToString();
  2169. int Seq1 = int.Parse(Seq);
  2170. string Status = ugr1.Cells["IS_START"].Value.ToString();
  2171. string DlSTATUS = ugr.Cells["Status"].Value.ToString();
  2172. string plcode = ugr1.Cells["Pline_Code"].Value.ToString();
  2173. string offline = ugr.Cells["OFFLINE_FLAG"].Value.ToString();
  2174. //if (ActiveOFFLINE_FLAG.Equals("2"))
  2175. //{
  2176. // if (!offline.Equals("返线"))
  2177. // {
  2178. // MessageBox.Show("当前为矫直返线,只允许对下线状态为返线的子管进行操作,", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2179. // return;
  2180. // }
  2181. //}
  2182. string shif = ugr.Cells["COL_SHIFT"].Value.ToString();
  2183. string group = ugr.Cells["COL_GROUP"].Value.ToString();
  2184. Shift = UserInfo.GetUserOrder();
  2185. Group = UserInfo.GetUserGroup();
  2186. NativeMethodNew nasssss = new NativeMethodNew(this.ob);
  2187. if (nasssss.IsRackOperate(shif, group))
  2188. {
  2189. MessageBox.Show("序号:【" + Seq + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2190. return;
  2191. }
  2192. DataTable ds = new DataTable();
  2193. DataTable dd = new DataTable();
  2194. if (e.Cell.Column.Key == "SCRAP_SLAB")
  2195. {
  2196. if (Status != "已开始矫直")
  2197. {
  2198. MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始矫直,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2199. return;
  2200. }
  2201. if (DlSTATUS == "剔除")
  2202. {
  2203. MessageBox.Show("序号【" + Seq + "】该条已经剔除,不能重复剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2204. return;
  2205. }
  2206. int ScrapNumBefore = 0;
  2207. DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 8, "1", proPlanId, gxPlanNo }, this.ob);
  2208. ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  2209. DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "1", proPlanId, gxPlanNo }, this.ob);
  2210. if (dtcount.Rows.Count > 0)
  2211. {
  2212. countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  2213. }
  2214. if (this.ultraGrid_GHDL1.Rows.Count - (countss + 1) < ScrapNumBefore)
  2215. {
  2216. if (e.Cell.Column.Key == "SCRAP_SLAB")
  2217. {
  2218. MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2219. return;
  2220. }
  2221. else if (e.Cell.Column.Key == "ChangShift")
  2222. {
  2223. MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能进行交班操作!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2224. return;
  2225. }
  2226. }
  2227. //if (MessageUtil.ShowYesNoAndQuestion("是否剔除该子管") == DialogResult.No)
  2228. //{
  2229. // return;
  2230. //}
  2231. ScrapSlab.JudgeStoveNo = JudgeStoveNo;
  2232. ScrapSlab.Seq = Seq;
  2233. ScrapSlab.ProcessNo = "9";
  2234. ScrapSlab.Flag = "0";
  2235. ScrapSlab.ColMode = "1";
  2236. ScrapSlab.ColUser = UserInfo.GetUserName();
  2237. ScrapSlab.ColGroup = UserInfo.GetUserGroup();
  2238. ScrapSlab.ColShift = UserInfo.GetUserOrder();
  2239. ScrapSlab.ColNo = "1";
  2240. ScrapSlab.ProPlanId = proPlanId;
  2241. ScrapSlab.GxPlanNo = gxPlanNo;
  2242. //剔管操作,:1、插入MIL_SLAB_SCRAP_SEQ表,2、探伤跟踪记录表状态,3、修改加探伤实绩表剔除支数
  2243. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.scrapFurMat", new object[] { ScrapSlab, "1" }, this.ob);
  2244. //MessageBox.Show("管序号【" + Seq + "】剔除成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2245. //CoreClientParam ccp = new CoreClientParam();
  2246. //ccp.ServerName = "com.steering.mes.zgmil.coup.FrmStraighteningResult";
  2247. //ccp.MethodName = "updatePorcessOcupStaus";
  2248. //ccp.ServerParams = new object[] { ScrapSlab, "9" };
  2249. //if (ccp.ReturnCode != -1)
  2250. //{
  2251. // if (ccp.ReturnInfo.Equals("修改成功!"))
  2252. // {
  2253. ultraGridTC();//查询跟踪记录表
  2254. GetStraightResult(JudgeStoveNo, plcode);//更新实绩
  2255. ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  2256. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  2257. {
  2258. GetRollingCard1();
  2259. }
  2260. else
  2261. {
  2262. GetRollingCard();//更新流通卡
  2263. }
  2264. ChangeGridColor();
  2265. // }
  2266. //}
  2267. }
  2268. if (e.Cell.Column.Key == "DELBACK")
  2269. {
  2270. //if (MessageUtil.ShowYesNoAndQuestion("是否回退该剔除的坯料") == DialogResult.No)
  2271. //{
  2272. // return;
  2273. //}
  2274. if (!DlSTATUS.Equals("剔除"))
  2275. {
  2276. MessageBox.Show("该坯料未被剔除,请确认后重新选择!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2277. return;
  2278. }
  2279. NativeMethodNew na = new NativeMethodNew(this.ob);
  2280. int counts = 0;
  2281. //if(Flage.Equals("1"))
  2282. //{
  2283. counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 9, 1, 0, proPlanId, gxPlanNo);
  2284. //}
  2285. //if (Flage.Equals("2"))
  2286. //{
  2287. // counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 10,1, 0);
  2288. //}
  2289. //if (Flage.Equals("3s"))
  2290. //{
  2291. // counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 11, 1, 0);
  2292. //}
  2293. if (counts > 0)
  2294. {
  2295. ultraGridTC();//查询跟踪记录表
  2296. GetStraightResult(JudgeStoveNo, plcode);//更新实绩
  2297. ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  2298. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  2299. {
  2300. GetRollingCard1();
  2301. }
  2302. else
  2303. {
  2304. GetRollingCard();//更新流通卡
  2305. }
  2306. ChangeGridColor();
  2307. //MessageBox.Show("剔料回退成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2308. }
  2309. else
  2310. {
  2311. MessageBox.Show("剔料回退失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2312. return;
  2313. }
  2314. }
  2315. if (e.Cell.Column.Key == "ChangShift")
  2316. {
  2317. string seqlast = "";
  2318. int ScrapNumBefore = 0;
  2319. DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "1", proPlanId, gxPlanNo }, this.ob);
  2320. ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  2321. DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "1", proPlanId, gxPlanNo }, this.ob);
  2322. if (dtcount.Rows.Count > 0)
  2323. {
  2324. countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  2325. }
  2326. if (this.ultraGrid_GHDL1.Rows.Count - (countss + 1) < ScrapNumBefore)
  2327. {
  2328. MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2329. return;
  2330. }
  2331. if (ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("确认交班") || ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
  2332. {
  2333. MessageBox.Show("序号:【" + Seq + "】已进行了交接班操作,不允许再次进行", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2334. return;
  2335. }
  2336. //找到本台交接班的第一只
  2337. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetRackChangeFlag", new object[] { JudgeStoveNo, ActiveResultNo, Seq.ToString(), 1, "1", Shift, Group, proPlanId, gxPlanNo }, this.ob);
  2338. if (dt.Rows.Count > 0)
  2339. {
  2340. if (!string.IsNullOrEmpty(dt.Rows[0]["SEQ"].ToString()))
  2341. {
  2342. seqlast = dt.Rows[0]["SEQ"].ToString();
  2343. }
  2344. else
  2345. {
  2346. //seqlast = "1";
  2347. }
  2348. }
  2349. else
  2350. {
  2351. //seqlast = "1";
  2352. }
  2353. if (int.Parse(seqlast) > int.Parse(Seq))
  2354. {
  2355. MessageBox.Show("您所选的管号队列交接班支已被上一班操作,不允许进行交接班", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2356. return;
  2357. }
  2358. else
  2359. {
  2360. //针对矫直探伤需重写
  2361. //HOTMethod hm = new HOTMethod(this.ob);
  2362. //hm.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 6, int.Parse(Seq), 0);
  2363. NativeMethodNew na = new NativeMethodNew(this.ob);
  2364. na.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, int.Parse(Seq), "1");
  2365. }
  2366. }
  2367. if (e.Cell.Column.Key == "BTNCHANGECOM")
  2368. {
  2369. NativeMethodNew na = new NativeMethodNew(this.ob);
  2370. int WaitChangeSeq = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "1", proPlanId, gxPlanNo);
  2371. if (WaitChangeSeq == 0)
  2372. {
  2373. MessageBox.Show("没有待交班确认的管号。");
  2374. return;
  2375. }
  2376. if (WaitChangeSeq != int.Parse(Seq))
  2377. {
  2378. MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
  2379. return;
  2380. }
  2381. if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
  2382. {
  2383. return;
  2384. }
  2385. int count =0;
  2386. //if (ChangeUserID == "")
  2387. //{
  2388. // FrmChangeGroup frmCg = new FrmChangeGroup(this.ob);
  2389. // frmCg.ShowDialog();
  2390. // if (frmCg.DialogResult == DialogResult.OK)
  2391. // {
  2392. // ChangeUserID = frmCg._UserID;
  2393. // //ChangePassWord = frmCg._PassWord;
  2394. // }
  2395. if (this.DoRelogin(DoCheck))
  2396. {
  2397. count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "1", proPlanId, gxPlanNo);
  2398. }
  2399. //}
  2400. //else
  2401. //{
  2402. // count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "1");
  2403. //}
  2404. if (count < 1)
  2405. {
  2406. MessageBox.Show("交接班失败,请查找原因后重新操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2407. return;
  2408. }
  2409. }
  2410. //过渡方法,接班后重登陆初始化导致Grid.Row为null
  2411. if (ultraGridPlan.Rows == null)
  2412. {
  2413. return;
  2414. }
  2415. ultraGridTC();
  2416. GetStraightResult(JudgeStoveNo, PlineCode);//更新实绩
  2417. ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  2418. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  2419. {
  2420. GetRollingCard1();
  2421. }
  2422. else
  2423. {
  2424. GetRollingCard();//更新流通卡
  2425. }
  2426. ChangeGridColor();
  2427. }
  2428. /// <summary>
  2429. /// 2#台剔除
  2430. /// </summary>
  2431. /// <param name="sender"></param>
  2432. /// <param name="e"></param>
  2433. private void ultraGrid_GHDL2_ClickCellButton(object sender, CellEventArgs e)
  2434. {
  2435. int countss = 0;
  2436. MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity();
  2437. UltraGridRow ugr = ultraGrid_GHDL2.ActiveRow;
  2438. UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
  2439. string PlanStatuss = ultraGridPlan.ActiveRow.Cells["IS_START"].Value.ToString();
  2440. if (PlanStatuss != "已开始矫直")
  2441. {
  2442. MessageBox.Show("炉号【" + ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】不是已开始矫直状态,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2443. return;
  2444. }
  2445. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2446. String MAT_NO = ugr.Cells["MAT_NO"].Value.ToString();
  2447. String Seq = ugr.Cells["seq"].Value.ToString();
  2448. int Seq1 = int.Parse(Seq);
  2449. string Status = ugr1.Cells["IS_START"].Value.ToString();
  2450. string DlSTATUS = ugr.Cells["Status"].Value.ToString();
  2451. string plcode = ugr1.Cells["Pline_Code"].Value.ToString();
  2452. string offline = ugr.Cells["OFFLINE_FLAG"].Value.ToString();
  2453. if (ActiveOFFLINE_FLAG.Equals("2"))
  2454. {
  2455. if (!offline.Equals("返线"))
  2456. {
  2457. MessageBox.Show("当前为矫直返线,只允许对下线状态为返线的子管进行操作,", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2458. return;
  2459. }
  2460. }
  2461. string shif = ugr.Cells["COL_SHIFT"].Value.ToString();
  2462. string group = ugr.Cells["COL_GROUP"].Value.ToString();
  2463. Shift = UserInfo.GetUserOrder();
  2464. Group = UserInfo.GetUserGroup();
  2465. NativeMethodNew nasssss = new NativeMethodNew(this.ob);
  2466. DataTable ds = new DataTable();
  2467. if (nasssss.IsRackOperate(shif, group))
  2468. {
  2469. MessageBox.Show("序号:【" + Seq + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2470. return;
  2471. }
  2472. if (e.Cell.Column.Key == "SCRAP_SLAB")
  2473. {
  2474. if (Status != "已开始矫直")
  2475. {
  2476. MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始矫直,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2477. return;
  2478. }
  2479. if (DlSTATUS == "剔除")
  2480. {
  2481. MessageBox.Show("序号【" + Seq + "】该条已经剔除,不能重复剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2482. return;
  2483. }
  2484. int ScrapNumBefore = 0;
  2485. DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "2", proPlanId, gxPlanNo }, this.ob);
  2486. ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  2487. DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "2", proPlanId, gxPlanNo }, this.ob);
  2488. if (dtcount.Rows.Count > 0)
  2489. {
  2490. countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  2491. }
  2492. if (this.ultraGrid_GHDL2.Rows.Count - (countss + 1) < ScrapNumBefore)
  2493. {
  2494. MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2495. return;
  2496. }
  2497. //if (MessageUtil.ShowYesNoAndQuestion("是否剔除该子管") == DialogResult.No)
  2498. //{
  2499. // return;
  2500. //}
  2501. ScrapSlab.JudgeStoveNo = JudgeStoveNo;
  2502. ScrapSlab.Seq = Seq;
  2503. ScrapSlab.ProcessNo = "9";
  2504. ScrapSlab.Flag = "0";
  2505. ScrapSlab.ColMode = "1";
  2506. ScrapSlab.ColUser = UserInfo.GetUserName();
  2507. ScrapSlab.ColGroup = UserInfo.GetUserGroup();
  2508. ScrapSlab.ColShift = UserInfo.GetUserOrder();
  2509. ScrapSlab.ColNo = "2";
  2510. ScrapSlab.ProPlanId = proPlanId;
  2511. ScrapSlab.GxPlanNo = gxPlanNo;
  2512. //剔管操作,:1、插入MIL_SLAB_SCRAP_SEQ表,2、探伤跟踪记录表状态,3、修改加探伤实绩表剔除支数
  2513. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.scrapFurMat", new object[] { ScrapSlab, "2" }, this.ob);
  2514. //MessageBox.Show("管序号【" + Seq + "】剔除成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2515. ultraGridTC();//查询跟踪记录表
  2516. GetStraightResult(JudgeStoveNo, plcode);//更新实绩
  2517. ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  2518. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  2519. {
  2520. GetRollingCard1();
  2521. }
  2522. else
  2523. {
  2524. GetRollingCard();//更新流通卡
  2525. }
  2526. ChangeGridColor();
  2527. }
  2528. if (e.Cell.Column.Key == "DELBACK")
  2529. {
  2530. //if (MessageUtil.ShowYesNoAndQuestion("是否回退该剔除的坯料") == DialogResult.No)
  2531. //{
  2532. // return;
  2533. //}
  2534. if (!DlSTATUS.Equals("剔除"))
  2535. {
  2536. MessageBox.Show("该坯料未被剔除,请确认后重新选择!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2537. return;
  2538. }
  2539. NativeMethodNew na = new NativeMethodNew(this.ob);
  2540. int counts = 0;
  2541. //if (Flage.Equals("1"))
  2542. //{
  2543. // counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 9, 1, 0);
  2544. //}
  2545. //if (Flage.Equals("2"))
  2546. //{
  2547. counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 10, 1, 0, proPlanId, gxPlanNo);
  2548. //}
  2549. //if (Flage.Equals("3s"))
  2550. //{
  2551. // counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 11, 1, 0);
  2552. //}
  2553. if (counts > 0)
  2554. {
  2555. ultraGridTC();//查询跟踪记录表
  2556. GetStraightResult(JudgeStoveNo, plcode);//更新实绩
  2557. ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  2558. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  2559. {
  2560. GetRollingCard1();
  2561. }
  2562. else
  2563. {
  2564. GetRollingCard();//更新流通卡
  2565. }
  2566. ChangeGridColor();
  2567. //MessageBox.Show("剔料回退成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2568. }
  2569. else
  2570. {
  2571. MessageBox.Show("剔料回退失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2572. return;
  2573. }
  2574. }
  2575. if (e.Cell.Column.Key == "ChangShift")
  2576. {
  2577. string seqlast = "";
  2578. int ScrapNumBefore = 0;
  2579. DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "2", proPlanId, gxPlanNo }, this.ob);
  2580. ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  2581. DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "2", proPlanId, gxPlanNo }, this.ob);
  2582. if (dtcount.Rows.Count > 0)
  2583. {
  2584. countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  2585. }
  2586. if (this.ultraGrid_GHDL2.Rows.Count - (countss + 1) < ScrapNumBefore)
  2587. {
  2588. MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2589. return;
  2590. }
  2591. if (ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("确认交班") || ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
  2592. {
  2593. MessageBox.Show("序号:【" + Seq + "】已进行了交接班操作,不允许再次进行", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2594. return;
  2595. }
  2596. //找到本台交接班的第一只
  2597. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetRackChangeFlag", new object[] { JudgeStoveNo, ActiveResultNo, Seq.ToString(), 1, "2", Shift, Group, proPlanId, gxPlanNo }, this.ob);
  2598. if (dt.Rows.Count > 0)
  2599. {
  2600. if (!string.IsNullOrEmpty(dt.Rows[0]["SEQ"].ToString()))
  2601. {
  2602. seqlast = dt.Rows[0]["SEQ"].ToString();
  2603. }
  2604. else
  2605. {
  2606. //seqlast = "1";
  2607. }
  2608. }
  2609. else
  2610. {
  2611. //seqlast = "1";
  2612. }
  2613. if (int.Parse(seqlast) > int.Parse(Seq))
  2614. {
  2615. MessageBox.Show("您所选的管号队列交接班支已被上一班操作,不允许进行交接班", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2616. return;
  2617. }
  2618. else
  2619. {
  2620. //针对矫直探伤需重写
  2621. //HOTMethod hm = new HOTMethod(this.ob);
  2622. //hm.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 6, int.Parse(Seq), 0);
  2623. NativeMethodNew na = new NativeMethodNew(this.ob);
  2624. na.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, int.Parse(Seq), "2");
  2625. }
  2626. }
  2627. if (e.Cell.Column.Key == "BTNCHANGECOM")
  2628. {
  2629. NativeMethodNew na = new NativeMethodNew(this.ob);
  2630. int WaitChangeSeq = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "2", proPlanId, gxPlanNo);
  2631. if (WaitChangeSeq == 0)
  2632. {
  2633. MessageBox.Show("没有待交班确认的管号。");
  2634. return;
  2635. }
  2636. if (WaitChangeSeq != int.Parse(Seq))
  2637. {
  2638. MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
  2639. return;
  2640. }
  2641. if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
  2642. {
  2643. return;
  2644. }
  2645. int count = 0;
  2646. if (this.DoRelogin(DoCheck))
  2647. {
  2648. count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "2", proPlanId, gxPlanNo);
  2649. }
  2650. //else
  2651. //{
  2652. // count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "2");
  2653. //}
  2654. if (count < 1)
  2655. {
  2656. MessageBox.Show("交接班失败,请查找原因后重新操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2657. return;
  2658. }
  2659. }
  2660. if (this.ultraGridPlan.Rows == null)
  2661. {
  2662. return;
  2663. }
  2664. ultraGridTC();
  2665. GetStraightResult(JudgeStoveNo, PlineCode);//更新实绩
  2666. ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  2667. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  2668. {
  2669. GetRollingCard1();
  2670. }
  2671. else
  2672. {
  2673. GetRollingCard();//更新流通卡
  2674. }
  2675. ChangeGridColor();
  2676. }
  2677. /// <summary>
  2678. /// 3#台剔除
  2679. /// </summary>
  2680. /// <param name="sender"></param>
  2681. /// <param name="e"></param>
  2682. private void ultraGrid_GHDL3_ClickCellButton(object sender, CellEventArgs e)
  2683. {
  2684. int countss = 0;
  2685. MilSlabScrapSeqEntity ScrapSlab = new MilSlabScrapSeqEntity();
  2686. UltraGridRow ugr = ultraGrid_GHDL3.ActiveRow;
  2687. UltraGridRow ugr1 = ultraGridPlan.ActiveRow;
  2688. string PlanStatuss = ultraGridPlan.ActiveRow.Cells["IS_START"].Value.ToString();
  2689. if (PlanStatuss != "已开始矫直")
  2690. {
  2691. MessageBox.Show("炉号【" + ultraGridPlan.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】不是已开始矫直状态,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2692. return;
  2693. }
  2694. string JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  2695. String MAT_NO = ugr.Cells["MAT_NO"].Value.ToString();
  2696. String Seq = ugr.Cells["seq"].Value.ToString();
  2697. int Seq1 = int.Parse(Seq);
  2698. string Status = ugr1.Cells["IS_START"].Value.ToString();
  2699. string DlSTATUS = ugr.Cells["Status"].Value.ToString();
  2700. string plcode = ugr1.Cells["Pline_Code"].Value.ToString();
  2701. string offline = ugr.Cells["OFFLINE_FLAG"].Value.ToString();
  2702. if (ActiveOFFLINE_FLAG.Equals("2"))
  2703. {
  2704. if (!offline.Equals("返线"))
  2705. {
  2706. MessageBox.Show("当前为矫直返线,只允许对下线状态为返线的子管进行操作,", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2707. return;
  2708. }
  2709. }
  2710. string shif = ugr.Cells["COL_SHIFT"].Value.ToString();
  2711. string group = ugr.Cells["COL_GROUP"].Value.ToString();
  2712. Shift = UserInfo.GetUserOrder();
  2713. Group = UserInfo.GetUserGroup();
  2714. NativeMethodNew nasssss = new NativeMethodNew(this.ob);
  2715. DataTable ds = new DataTable();
  2716. if (nasssss.IsRackOperate(shif, group))
  2717. {
  2718. MessageBox.Show("序号:【" + Seq + "】子管已由" + shif + "," + group + "操作,不允许再进行操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2719. return;
  2720. }
  2721. if (e.Cell.Column.Key == "SCRAP_SLAB")
  2722. {
  2723. if (Status != "已开始矫直")
  2724. {
  2725. MessageBox.Show("炉号【" + JudgeStoveNo + "】未开始矫直,不能剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2726. return;
  2727. }
  2728. if (DlSTATUS == "剔除")
  2729. {
  2730. MessageBox.Show("序号【" + Seq + "】该条已经剔除,不能重复剔除", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2731. return;
  2732. }
  2733. int ScrapNumBefore = 0;
  2734. DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "3", proPlanId, gxPlanNo }, this.ob);
  2735. ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  2736. DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "3", proPlanId, gxPlanNo }, this.ob);
  2737. if (dtcount.Rows.Count > 0)
  2738. {
  2739. countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  2740. }
  2741. if (this.ultraGrid_GHDL3.Rows.Count - (countss + 1) < ScrapNumBefore)
  2742. {
  2743. MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2744. return;
  2745. }
  2746. //if (MessageUtil.ShowYesNoAndQuestion("是否剔除该子管") == DialogResult.No)
  2747. //{
  2748. // return;
  2749. //}
  2750. ScrapSlab.JudgeStoveNo = JudgeStoveNo;
  2751. ScrapSlab.Seq = Seq;
  2752. ScrapSlab.ProcessNo = "9";
  2753. ScrapSlab.Flag = "0";
  2754. ScrapSlab.ColMode = "1";
  2755. ScrapSlab.ColUser = UserInfo.GetUserName();
  2756. ScrapSlab.ColGroup = UserInfo.GetUserGroup();
  2757. ScrapSlab.ColShift = UserInfo.GetUserOrder();
  2758. ScrapSlab.ColNo = "3";
  2759. ScrapSlab.ProPlanId = proPlanId;
  2760. ScrapSlab.GxPlanNo = gxPlanNo;
  2761. //剔管操作,:1、插入MIL_SLAB_SCRAP_SEQ表,2、探伤跟踪记录表状态,3、修改加探伤实绩表剔除支数
  2762. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.scrapFurMat", new object[] { ScrapSlab, "3" }, this.ob);
  2763. //MessageBox.Show("管序号【" + Seq + "】剔除成功!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2764. ultraGridTC();//查询跟踪记录表
  2765. GetStraightResult(JudgeStoveNo, plcode);//更新实绩
  2766. ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  2767. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  2768. {
  2769. GetRollingCard1();
  2770. }
  2771. else
  2772. {
  2773. GetRollingCard();//更新流通卡
  2774. }
  2775. ChangeGridColor();
  2776. }
  2777. if (e.Cell.Column.Key == "DELBACK")
  2778. {
  2779. //if (MessageUtil.ShowYesNoAndQuestion("是否回退该剔除的坯料") == DialogResult.No)
  2780. //{
  2781. // return;
  2782. //}
  2783. if (!DlSTATUS.Equals("剔除"))
  2784. {
  2785. MessageBox.Show("该坯料未被剔除,请确认后重新选择!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2786. return;
  2787. }
  2788. NativeMethodNew na = new NativeMethodNew(this.ob);
  2789. int counts = 0;
  2790. //if (Flage.Equals("1"))
  2791. //{
  2792. // counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 9, 1, 0);
  2793. //}
  2794. //if (Flage.Equals("2"))
  2795. //{
  2796. //counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 10, 1, 0);
  2797. //}
  2798. //if (Flage.Equals("3s"))
  2799. //{
  2800. counts = na.DeleteSlabSeq(JudgeStoveNo, Seq.ToString(), 11, 1, 0, proPlanId, gxPlanNo);
  2801. //}
  2802. if (counts > 0)
  2803. {
  2804. ultraGridTC();//查询跟踪记录表
  2805. GetStraightResult(JudgeStoveNo, plcode);//更新实绩
  2806. ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  2807. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  2808. {
  2809. GetRollingCard1();
  2810. }
  2811. else
  2812. {
  2813. GetRollingCard();//更新流通卡
  2814. }
  2815. ChangeGridColor();
  2816. //MessageBox.Show("剔料回退成功", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2817. }
  2818. else
  2819. {
  2820. MessageBox.Show("剔料回退失败", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2821. return;
  2822. }
  2823. }
  2824. #region 原来的交接班方法
  2825. //if (e.Cell.Column.Key == "ChangShift")
  2826. //{
  2827. // int ScrapNumBefore = 0;
  2828. // DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "3" }, this.ob);
  2829. // ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  2830. // DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "3" }, this.ob);
  2831. // if (dtcount.Rows.Count > 0)
  2832. // {
  2833. // countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  2834. // }
  2835. // if (this.ultraGrid_GHDL3.Rows.Count - (countss + 1) < ScrapNumBefore)
  2836. // {
  2837. // MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2838. // return;
  2839. // }
  2840. // NativeMethodNew nas = new NativeMethodNew(this.ob);
  2841. // Shift = UserInfo.GetUserOrder();
  2842. // Group = UserInfo.GetUserGroup();
  2843. // if (ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("正常"))
  2844. // {
  2845. // int count = nas.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "3");
  2846. // if (count < 1)
  2847. // {
  2848. // MessageBox.Show("交接班失败,请查找原因后重新操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2849. // return;
  2850. // }
  2851. // }
  2852. // if (ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("交班点"))//回退
  2853. // {
  2854. // }
  2855. //}
  2856. #endregion
  2857. if (e.Cell.Column.Key == "ChangShift")
  2858. {
  2859. string seqlast = "";
  2860. int ScrapNumBefore = 0;
  2861. DataTable dtcountaftersaw = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.scrapMatCheckAfterSaw", new object[] { JudgeStoveNo, 9, "3", proPlanId, gxPlanNo }, this.ob);
  2862. ScrapNumBefore = int.Parse(dtcountaftersaw.Rows[0]["Countss"].ToString());
  2863. DataTable dtcount = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetRackCounts", new object[] { JudgeStoveNo, Seq1, "3", proPlanId, gxPlanNo }, this.ob);
  2864. if (dtcount.Rows.Count > 0)
  2865. {
  2866. countss = int.Parse(dtcount.Rows[0]["COUNTSS"].ToString());
  2867. }
  2868. if (this.ultraGrid_GHDL3.Rows.Count - (countss + 1) < ScrapNumBefore)
  2869. {
  2870. MessageBox.Show("不存在序号为【" + Seq + "】的管号,可能是被前道工序剔除,不能再次剔除!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2871. return;
  2872. }
  2873. if (ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("确认交班") || ugr.Cells["CHANGE_FLAG"].Value.ToString().Equals("待接班确认"))
  2874. {
  2875. MessageBox.Show("序号:【" + Seq + "】已进行了交接班操作,不允许再次进行", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2876. return;
  2877. }
  2878. //找到本台交接班的第一只
  2879. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.EddyCurrentTestingResult.GetRackChangeFlag", new object[] { JudgeStoveNo, ActiveResultNo, Seq.ToString(), 1, "3", Shift, Group, proPlanId, gxPlanNo }, this.ob);
  2880. if (dt.Rows.Count > 0)
  2881. {
  2882. if (!string.IsNullOrEmpty(dt.Rows[0]["SEQ"].ToString()))
  2883. {
  2884. seqlast = dt.Rows[0]["SEQ"].ToString();
  2885. }
  2886. else
  2887. {
  2888. //seqlast = "1";
  2889. }
  2890. }
  2891. else
  2892. {
  2893. //seqlast = "1";
  2894. }
  2895. if (int.Parse(seqlast) > int.Parse(Seq))
  2896. {
  2897. MessageBox.Show("您所选的管号队列交接班支已被上一班操作,不允许进行交接班", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2898. return;
  2899. }
  2900. else
  2901. {
  2902. //针对矫直探伤需重写
  2903. //HOTMethod hm = new HOTMethod(this.ob);
  2904. //hm.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, "", 6, int.Parse(Seq), 0);
  2905. NativeMethodNew na = new NativeMethodNew(this.ob);
  2906. na.UpdateChangeFlag(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, int.Parse(Seq), "3");
  2907. }
  2908. }
  2909. if (e.Cell.Column.Key == "BTNCHANGECOM")
  2910. {
  2911. NativeMethodNew na = new NativeMethodNew(this.ob);
  2912. int WaitChangeSeq = na.GetWaitChangeSeq(ActiveJUDGE_STOVE_NO, ActiveResultNo, 0, "3", proPlanId, gxPlanNo);
  2913. if (WaitChangeSeq == 0)
  2914. {
  2915. MessageBox.Show("没有待交班确认的管号。");
  2916. return;
  2917. }
  2918. if (WaitChangeSeq != int.Parse(Seq))
  2919. {
  2920. MessageBox.Show("交班管序号与接班管序号不符,请确认后接班。");
  2921. return;
  2922. }
  2923. if (MessageUtil.ShowYesNoAndQuestion("确认炉号:【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】序号:【" + Seq + "】交班?") == DialogResult.No)
  2924. {
  2925. return;
  2926. }
  2927. int count = 0;
  2928. if (this.DoRelogin(DoCheck))
  2929. {
  2930. count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "3", proPlanId, gxPlanNo);
  2931. }
  2932. //else
  2933. //{
  2934. // count = na.ChangeShift(JudgeStoveNo, this.ActiveResultNo, Seq.ToString(), this.PlineCode, Shift, Group, 1, 1, "3");
  2935. //}
  2936. if (count < 1)
  2937. {
  2938. MessageBox.Show("交接班失败,请查找原因后重新操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  2939. return;
  2940. }
  2941. }
  2942. if (this.ultraGridPlan.Rows == null)
  2943. {
  2944. return;
  2945. }
  2946. ultraGridTC();
  2947. GetStraightResult(JudgeStoveNo, PlineCode);//更新实绩
  2948. ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { JudgeStoveNo, proPlanId, gxPlanNo }, ob);
  2949. if (ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  2950. {
  2951. GetRollingCard1();
  2952. }
  2953. else
  2954. {
  2955. GetRollingCard();//更新流通卡
  2956. }
  2957. ChangeGridColor();
  2958. }
  2959. public string DoCheck(CoreUserInfo User)
  2960. {
  2961. return "";
  2962. }
  2963. /// <summary>
  2964. /// ///计划表ROW点击变换判断
  2965. /// </summary>
  2966. /// <param name="sender"></param>
  2967. /// <param name="e"></param>
  2968. private void ultraGridPlan_BeforeRowActivate(object sender, RowEventArgs e)
  2969. {
  2970. if (this.straighteningResult1.IsCellSelect == true)
  2971. {
  2972. NativeMethodNew na = new NativeMethodNew(this.ob);
  2973. if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 7))
  2974. {
  2975. this.straighteningResult1.IsCellSelect = false;
  2976. return;
  2977. }
  2978. //if (MessageBox.Show("提示:穿孔实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  2979. //{
  2980. this.straighteningResult1.IsCellSelect = false;
  2981. //保存探伤实绩
  2982. //StraighteningSave();
  2983. //}
  2984. //else
  2985. //{
  2986. this.straighteningResult1.IsCellSelect = false;
  2987. foreach (UltraGridRow ugr in this.ultraGridPlan.Rows)
  2988. {
  2989. if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO)
  2990. {
  2991. this.ultraGridPlan.ActiveRow = ugr;
  2992. }
  2993. }
  2994. return;
  2995. //}
  2996. }
  2997. if (this.frmStraighteningResult11.IsCellSelect == true)
  2998. {
  2999. NativeMethodNew na = new NativeMethodNew(this.ob);
  3000. if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 7))
  3001. {
  3002. this.frmStraighteningResult11.IsCellSelect = false;
  3003. return;
  3004. }
  3005. //if (MessageBox.Show("提示:穿孔实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  3006. //{
  3007. this.frmStraighteningResult11.IsCellSelect = false;
  3008. //保存探伤实绩
  3009. //StraighteningSave();
  3010. //}
  3011. //else
  3012. //{
  3013. this.frmStraighteningResult11.IsCellSelect = false;
  3014. foreach (UltraGridRow ugr in this.ultraGridPlan.Rows)
  3015. {
  3016. if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO)
  3017. {
  3018. this.ultraGridPlan.ActiveRow = ugr;
  3019. }
  3020. }
  3021. return;
  3022. //}
  3023. }
  3024. if (this.frmStraighteningResult21.IsCellSelect == true)
  3025. {
  3026. NativeMethodNew na = new NativeMethodNew(this.ob);
  3027. if (!na.isBegineNode(ActiveJUDGE_STOVE_NO, 7))
  3028. {
  3029. this.frmStraighteningResult21.IsCellSelect = false;
  3030. return;
  3031. }
  3032. //if (MessageBox.Show("提示:穿孔实绩可能已修改,是否保存", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  3033. //{
  3034. this.frmStraighteningResult21.IsCellSelect = false;
  3035. //保存探伤实绩
  3036. //StraighteningSave();
  3037. //}
  3038. //else
  3039. //{
  3040. this.frmStraighteningResult21.IsCellSelect = false;
  3041. foreach (UltraGridRow ugr in this.ultraGridPlan.Rows)
  3042. {
  3043. if (ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() == ActiveJUDGE_STOVE_NO)
  3044. {
  3045. this.ultraGridPlan.ActiveRow = ugr;
  3046. }
  3047. }
  3048. return;
  3049. //}
  3050. }
  3051. }
  3052. /// <summary>
  3053. /// 查询结炉实绩
  3054. /// </summary>
  3055. public void NodeQuery()
  3056. {
  3057. string Shift = UserInfo.GetUserOrder();
  3058. string Group = UserInfo.GetUserGroup();
  3059. string PliceCode = PlineCode;
  3060. string StartTime = DateTime.Now.ToString("yyyy-MM-dd");
  3061. string EndTime = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
  3062. string Date = StartTime;
  3063. StartTime = StartTime + " 00:00:00";
  3064. EndTime = EndTime + " 00:00:00";
  3065. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetStraightResultNodeQuery", new object[] { PliceCode, Shift, Group, StartTime, EndTime }, this.ob);
  3066. FrmNodeResultQuery frm = new FrmNodeResultQuery(dt, 10, Date, Shift, Group, this.ob);
  3067. frm.ShowDialog();
  3068. }
  3069. /// <summary>
  3070. /// 矫直离线
  3071. /// </summary>
  3072. public void Offline()
  3073. {
  3074. DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  3075. if (dtFlag.Rows.Count > 0)
  3076. {
  3077. if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
  3078. {
  3079. MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未开始分切,不允许下线", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3080. return;
  3081. }
  3082. if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
  3083. {
  3084. MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未完成分切,不允许下线 ", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3085. return;
  3086. }
  3087. }
  3088. //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
  3089. string Node = "JZ";
  3090. beforeQualifiedNum = this.rollingCard1.Value.SawQualifiedNum;
  3091. qualifiedNum = string.IsNullOrEmpty(this.rollingCard1.Value.StraightQualifiedNum) ? "0" : this.rollingCard1.Value.StraightQualifiedNum;
  3092. scrapNum = string.IsNullOrEmpty(this.rollingCard1.Value.StraightScrapNum) ? "0" : this.rollingCard1.Value.StraightScrapNum;
  3093. offineHas = string.IsNullOrEmpty(this.rollingCard1.Value.OfflineStraight) ? "0" : this.rollingCard1.Value.OfflineStraight;
  3094. offineHead = string.IsNullOrEmpty(this.rollingCard1.Value.BacklineStraight) ? "0" : this.rollingCard1.Value.BacklineStraight;
  3095. string numb = (int.Parse(beforeQualifiedNum.ToString3()) - int.Parse(qualifiedNum.ToString3()) - int.Parse(scrapNum.ToString3()) - int.Parse(offineHas.ToString3()) + int.Parse(offineHead.ToString3())).ToString();
  3096. FrmStraighteningOffLine frm = new FrmStraighteningOffLine(Node, this.ob, PlineCode, stoveno, lotno, numb, proPlanId, gxPlanNo);
  3097. frm.ShowDialog();
  3098. PlanQuery();
  3099. }
  3100. public void Offline2()
  3101. {
  3102. DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  3103. if (dtFlag.Rows.Count > 0)
  3104. {
  3105. if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
  3106. {
  3107. MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未开始分切,不允许下线", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3108. return;
  3109. }
  3110. if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
  3111. {
  3112. MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未完成分切,不允许下线 ", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3113. return;
  3114. }
  3115. }
  3116. //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
  3117. string Node = "02";
  3118. //FrmOffLineOperation frm = new FrmOffLineOperation(Node, this.ob, PlineCode, stoveno, lotno);
  3119. //if (frm.ShowDialog() == DialogResult.OK)
  3120. //{
  3121. // ultraGridTC();
  3122. //}
  3123. }
  3124. public void Offline3()
  3125. {
  3126. if (!PlineCode.Equals("C010"))
  3127. {
  3128. MessageBox.Show("本产线不是168产线,没有3#矫直台,不允许执行3#台下线操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3129. return;
  3130. }
  3131. DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  3132. if (dtFlag.Rows.Count > 0)
  3133. {
  3134. if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
  3135. {
  3136. MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未开始分切,不允许下线", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3137. return;
  3138. }
  3139. if (dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString() != "1")
  3140. {
  3141. MessageBox.Show("炉号【" + ActiveJUDGE_STOVE_NO + "】未完成分切,不允许下线 ", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3142. return;
  3143. }
  3144. }
  3145. //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
  3146. string Node = "03";
  3147. //FrmOffLineOperation frm = new FrmOffLineOperation(Node, this.ob, PlineCode, stoveno, lotno);
  3148. //if (frm.ShowDialog() == DialogResult.OK)
  3149. //{
  3150. // ultraGridTC();
  3151. //}
  3152. }
  3153. public void BackLine1()
  3154. {
  3155. //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
  3156. string Node = "01";
  3157. BackLineOperate frm = new BackLineOperate(Node, this.ob, PlineCode, stoveno, lotno);
  3158. if (frm.ShowDialog() == DialogResult.OK)
  3159. {
  3160. ultraGridTC();
  3161. }
  3162. }
  3163. public void BackLine2()
  3164. {
  3165. //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
  3166. string Node = "02";
  3167. BackLineOperate frm = new BackLineOperate(Node, this.ob, PlineCode, stoveno, lotno);
  3168. if (frm.ShowDialog() == DialogResult.OK)
  3169. {
  3170. ultraGridTC();
  3171. }
  3172. }
  3173. public void BackLine3()
  3174. {
  3175. if (!PlineCode.Equals("C010"))
  3176. {
  3177. MessageBox.Show("本产线不是168产线,没有3#矫直台,不允许执行3#台下线操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3178. return;
  3179. }
  3180. //工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
  3181. string Node = "03";
  3182. BackLineOperate frm = new BackLineOperate(Node, this.ob, PlineCode, stoveno, lotno);
  3183. if (frm.ShowDialog() == DialogResult.OK)
  3184. {
  3185. ultraGridTC();
  3186. }
  3187. }
  3188. private void ChangeShiftBack()
  3189. {
  3190. if (string.IsNullOrEmpty(this.ActiveJUDGE_STOVE_NO))
  3191. {
  3192. MessageBox.Show("您未选择任何计划,不允许进行交班回退操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3193. return;
  3194. }
  3195. UltraGridRow ugr_plan = this.ultraGridPlan.ActiveRow;
  3196. string Status = ugr_plan.Cells["IS_START"].Value.ToString();
  3197. if (Status == "已完成矫直")
  3198. {
  3199. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】已完成矫直操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3200. return;
  3201. }
  3202. if (Status == "未开始矫直")
  3203. {
  3204. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】未开始矫直操作,不允许进行交班取消!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3205. return;
  3206. }
  3207. string Shift = UserInfo.GetUserOrder();
  3208. string Group = UserInfo.GetUserGroup();
  3209. NativeMethodNew na = new NativeMethodNew(this.ob);
  3210. if (na.ChangeShiftBackCheck(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "1") || na.ChangeShiftBackCheck(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "2") || na.ChangeShiftBackCheck(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "3") || na.ChangeShiftBackCheckelse(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "1", proPlanId, gxPlanNo) || na.ChangeShiftBackCheckelse(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "2", proPlanId, gxPlanNo) || na.ChangeShiftBackCheckelse(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "3", proPlanId, gxPlanNo))
  3211. {
  3212. int count = na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "1", proPlanId, gxPlanNo);
  3213. na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "2", proPlanId, gxPlanNo);
  3214. if (this.PlineCode.Equals("C010"))
  3215. {
  3216. na.ChangeShiftBack(this.ActiveJUDGE_STOVE_NO, this.ActiveResultNo, this.PlineCode, Shift, Group, 7, "3", proPlanId, gxPlanNo);
  3217. }
  3218. if (count < 1)
  3219. {
  3220. //MessageBox.Show("交班回退失败, 请确认后重新操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3221. }
  3222. }
  3223. else
  3224. {
  3225. switch (Shift)
  3226. {
  3227. case "1":
  3228. Shift = "早班";
  3229. break;
  3230. case "2":
  3231. Shift = "中班";
  3232. break;
  3233. case "3":
  3234. Shift = "夜班";
  3235. break;
  3236. }
  3237. switch (Group)
  3238. {
  3239. case "1":
  3240. Group = "甲班";
  3241. break;
  3242. case "2":
  3243. Group = "乙班";
  3244. break;
  3245. case "3":
  3246. Group = "丙班";
  3247. break;
  3248. case "4":
  3249. Group = "丁班";
  3250. break;
  3251. }
  3252. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActiveJUDGE_STOVE_NO) + "】未在" + Group + "," + Shift + "进行交班操作,不允许进行交班取消操作");
  3253. return;
  3254. }
  3255. GetStraightResult(ActiveJUDGE_STOVE_NO, PlineCode);//更新实绩
  3256. ultraGridTC();
  3257. ChangeGridColor();
  3258. }
  3259. private void PrintResult()
  3260. {
  3261. DateTime SeverTime = NativeMethod.GetSeverTime(this.ob);
  3262. string Time = SeverTime.ToLongTimeString();
  3263. string StartTime = "";
  3264. string EndTime = "";
  3265. string strurl = "";
  3266. switch (PlineCode)
  3267. {
  3268. case "C008": //250
  3269. //晚班
  3270. Time = Time.Replace(":", "");
  3271. if (int.Parse(Time) < 070000)
  3272. {
  3273. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  3274. EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  3275. string Date2 = SeverTime.ToString("yyyy-MM-dd");
  3276. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  3277. }
  3278. else
  3279. {
  3280. StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  3281. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  3282. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult250.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  3283. }
  3284. break;
  3285. case "C009": //258
  3286. //晚班
  3287. Time = Time.Replace(":", "");
  3288. if (int.Parse(Time) < 070000)
  3289. {
  3290. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  3291. EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  3292. string Date2 = SeverTime.ToString("yyyy-MM-dd");
  3293. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult258.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  3294. }
  3295. else
  3296. {
  3297. StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  3298. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  3299. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult258.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  3300. }
  3301. break;
  3302. case "C010": //168
  3303. //晚班
  3304. Time = Time.Replace(":", "");
  3305. if (int.Parse(Time) < 070000)
  3306. {
  3307. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  3308. EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  3309. string Date2 = SeverTime.ToString("yyyy-MM-dd");
  3310. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  3311. }
  3312. else
  3313. {
  3314. StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  3315. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  3316. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult168.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  3317. }
  3318. break;
  3319. case "C012": //Arssel
  3320. break;
  3321. case "C017": //460
  3322. //晚班
  3323. Time = Time.Replace(":", "");
  3324. if (int.Parse(Time) < 070000)
  3325. {
  3326. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  3327. EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  3328. string Date2 = SeverTime.ToString("yyyy-MM-dd");
  3329. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult460.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  3330. }
  3331. else
  3332. {
  3333. StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  3334. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  3335. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult460.cpt&format=pdf&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  3336. }
  3337. break;
  3338. case "C072": //508
  3339. //晚班
  3340. Time = Time.Replace(":", "");
  3341. if (int.Parse(Time) < 070000)
  3342. {
  3343. StartTime = SeverTime.AddDays(-1).ToShortDateString() + " 07:00:00";
  3344. EndTime = SeverTime.ToShortDateString() + " 07:00:00";
  3345. string Date2 = SeverTime.ToString("yyyy-MM-dd");
  3346. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult508.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  3347. }
  3348. else
  3349. {
  3350. StartTime = SeverTime.ToShortDateString() + " 07:00:00";
  3351. EndTime = SeverTime.AddDays(1).ToShortDateString() + " 07:00:00";
  3352. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilStraighteningResult508.cpt&SHIFT=" + Shift + "&GROUP=" + Group + "&DATE=" + StartTime + "&PLINECODE=" + PlineCode + "&DATE2=" + EndTime + "&USERID=" + _UserID;
  3353. }
  3354. break;
  3355. }
  3356. FrmExcel fre = new FrmExcel(this.ob, strurl);
  3357. //FrmRepExcel fre = new FrmRepExcel(ob, strurl);
  3358. fre.AutoSize = true;
  3359. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  3360. fre.WindowState = FormWindowState.Maximized;
  3361. fre.Show();
  3362. }
  3363. public void colchang()
  3364. {
  3365. if (string.IsNullOrEmpty(ActiveJUDGE_STOVE_NO))
  3366. {
  3367. MessageBox.Show("您未选择任何住计划,不允许执行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3368. return;
  3369. }
  3370. DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getSingePlanFlag", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  3371. if (!ds.Rows[0]["BACK_PLAN_FLAG"].ToString().Equals("7"))
  3372. {
  3373. DataTable dtResult = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.getPerResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  3374. DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { ActiveJUDGE_STOVE_NO, proPlanId, gxPlanNo }, this.ob);
  3375. if (dtFlag.Rows.Count == 0)
  3376. {
  3377. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】尚开始分切,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3378. return;
  3379. }
  3380. if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
  3381. {
  3382. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】尚开始分切,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3383. return;
  3384. }
  3385. if (!dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString().Equals("1"))
  3386. {
  3387. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】分切工序尚未结炉,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3388. return;
  3389. }
  3390. if (dtResult.Rows.Count == 0)
  3391. {
  3392. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】尚开始矫直,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3393. return;
  3394. }
  3395. if (string.IsNullOrEmpty(dtResult.Rows[0]["NODE_FUR_FLAG"].ToString()))
  3396. {
  3397. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】尚开始矫直,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3398. return;
  3399. }
  3400. if (dtResult.Rows[0]["NODE_FUR_FLAG"].ToString().Equals("1"))
  3401. {
  3402. MessageBox.Show("炉号:【" + ActiveJUDGE_STOVE_NO + "】已完成矫直,不允许进行子管换台操作", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  3403. return;
  3404. }
  3405. }
  3406. ColNoChanges col = new ColNoChanges(this.ob, "00", ActiveJUDGE_STOVE_NO, PlineCode, proPlanId, gxPlanNo);
  3407. col.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  3408. if (col.ShowDialog() == DialogResult.OK)
  3409. {
  3410. PlanQuery();
  3411. GetStraightResult(ActiveJUDGE_STOVE_NO, PlineCode);//更新实绩
  3412. GetRollingCard();//更新流通卡
  3413. ChangeGridColor();
  3414. //this.ultraGridTC();
  3415. //ChangeGridColor();
  3416. }
  3417. }
  3418. #endregion
  3419. }
  3420. }