FrmOutdecLabMecDataCJAuditNew.cs 254 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Format;
  3. using Core.Mes.Client.Comm.Server;
  4. using Core.Mes.Client.Comm.Tool;
  5. using CoreFS.CA06;
  6. using Infragistics.Win;
  7. using Infragistics.Win.UltraWinGrid;
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.IO;
  15. using System.Linq;
  16. using System.Net;
  17. using System.Text;
  18. using System.Windows.Forms;
  19. namespace Core.StlMes.Client.Lims.Data.PipeAndOutdec
  20. {
  21. public partial class FrmOutdecLabMecDataCJAuditNew : FrmBase
  22. {
  23. public FrmOutdecLabMecDataCJAuditNew()
  24. {
  25. InitializeComponent();
  26. }
  27. private string[] arrId;//数据权限
  28. private void FrmOutdecLabMecDataCJAuditNew_Load(object sender, EventArgs e)
  29. {
  30. arrId = new string[] { "002001007009" };//力学项目
  31. EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  32. EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid2.DisplayLayout.Bands[0]);
  33. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid3.DisplayLayout.Bands[0]);
  34. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid4.DisplayLayout.Bands[0]);
  35. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid5.DisplayLayout.Bands[0]);
  36. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid6.DisplayLayout.Bands[0]);
  37. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid7.DisplayLayout.Bands[0]);
  38. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid8.DisplayLayout.Bands[0]);
  39. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid9.DisplayLayout.Bands[0]);
  40. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid10.DisplayLayout.Bands[0]);
  41. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid11.DisplayLayout.Bands[0]);
  42. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid12.DisplayLayout.Bands[0]);
  43. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid13.DisplayLayout.Bands[0]);
  44. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid53.DisplayLayout.Bands[0]);
  45. EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid14.DisplayLayout.Bands[0]);
  46. EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid15.DisplayLayout.Bands[0]);
  47. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid16.DisplayLayout.Bands[0]);
  48. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid17.DisplayLayout.Bands[0]);
  49. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid18.DisplayLayout.Bands[0]);
  50. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid19.DisplayLayout.Bands[0]);
  51. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid20.DisplayLayout.Bands[0]);
  52. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid21.DisplayLayout.Bands[0]);
  53. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid22.DisplayLayout.Bands[0]);
  54. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid23.DisplayLayout.Bands[0]);
  55. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid24.DisplayLayout.Bands[0]);
  56. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid25.DisplayLayout.Bands[0]);
  57. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid26.DisplayLayout.Bands[0]);
  58. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid55.DisplayLayout.Bands[0]);
  59. EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid27.DisplayLayout.Bands[0]);
  60. //EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid27.DisplayLayout.Bands[1]);
  61. EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid28.DisplayLayout.Bands[0]);
  62. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid29.DisplayLayout.Bands[0]);
  63. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid30.DisplayLayout.Bands[0]);
  64. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid31.DisplayLayout.Bands[0]);
  65. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid32.DisplayLayout.Bands[0]);
  66. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid33.DisplayLayout.Bands[0]);
  67. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid34.DisplayLayout.Bands[0]);
  68. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid35.DisplayLayout.Bands[0]);
  69. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid36.DisplayLayout.Bands[0]);
  70. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid37.DisplayLayout.Bands[0]);
  71. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid38.DisplayLayout.Bands[0]);
  72. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid39.DisplayLayout.Bands[0]);
  73. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid56.DisplayLayout.Bands[0]);
  74. EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid40.DisplayLayout.Bands[0]);
  75. //EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid40.DisplayLayout.Bands[1]);
  76. EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid41.DisplayLayout.Bands[0]);
  77. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid42.DisplayLayout.Bands[0]);
  78. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid43.DisplayLayout.Bands[0]);
  79. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid44.DisplayLayout.Bands[0]);
  80. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid45.DisplayLayout.Bands[0]);
  81. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid46.DisplayLayout.Bands[0]);
  82. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid47.DisplayLayout.Bands[0]);
  83. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid48.DisplayLayout.Bands[0]);
  84. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid49.DisplayLayout.Bands[0]);
  85. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid50.DisplayLayout.Bands[0]);
  86. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid51.DisplayLayout.Bands[0]);
  87. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid52.DisplayLayout.Bands[0]);
  88. EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(ultraGrid54.DisplayLayout.Bands[0]);
  89. EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(ultraGrid57.DisplayLayout.Bands[0]);
  90. DateTime now = DateTime.Now;
  91. DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
  92. DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
  93. this.RegStartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
  94. this.RegEndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
  95. //initCheckEqiupment();
  96. }
  97. /// <summary>
  98. /// 重写基类方法
  99. /// </summary>
  100. /// <param name="sender"></param>
  101. /// <param name="ToolbarKey"></param>
  102. public override void ToolBar_Click(object sender, string ToolbarKey)
  103. {
  104. //查询、确认、退出
  105. switch (ToolbarKey)
  106. {
  107. case "Query":
  108. if (ultraTabControl1.SelectedTab.Index == 0)
  109. {
  110. QueryCheckConsignBaseDetail("2");
  111. }
  112. else if (ultraTabControl1.SelectedTab.Index == 1)
  113. {
  114. QueryCheckConsignBaseDetail("3");
  115. }
  116. else if (ultraTabControl1.SelectedTab.Index == 2)
  117. {
  118. QueryCheckConsignBaseDetailNoFrim("3");
  119. }
  120. else if (ultraTabControl1.SelectedTab.Index == 3)
  121. {
  122. QueryCheckConsignBaseDetailYesFrim("4");
  123. }
  124. break;
  125. case "Add":
  126. AddPhyData();
  127. break;
  128. case "Update":
  129. UpdateCheckConsignProcessResult();
  130. break;
  131. case "Delete":
  132. DeleteCheckConsignProcessResult();
  133. break;
  134. case "Audit":
  135. auditCheckConsignDetail();
  136. break;
  137. case "CancelAudit":
  138. cancelAuditCheckConsignDetail();
  139. break;
  140. case "PrintMechanics":
  141. printMechanics();
  142. break;
  143. case"PrintPicture":
  144. printPicture();
  145. break;
  146. case "UpFile":
  147. UpFile();
  148. break;
  149. case"UpPicture":
  150. upPicture();
  151. break;
  152. case "Close":
  153. this.Close();
  154. break;
  155. }
  156. }
  157. private string fileName = "";//路径
  158. /// <summary>
  159. /// 上传图片
  160. /// </summary>
  161. private void upPicture()
  162. {
  163. this.ultraGrid40.UpdateData();
  164. UltraGridRow row = ultraGrid40.ActiveRow;
  165. string checkNo = row.Cells["CheckNo"].Value.ToString();
  166. string filePath = "Lims/pipe/caili2/" + checkNo + "/";
  167. if (checkNo.Equals(""))
  168. {
  169. MessageUtil.ShowTips("没有用户不允许上传!");
  170. return;
  171. }
  172. FormFileDown down = new FormFileDown(this.ob, filePath);
  173. down.CtrlFileDown1.FilePath = filePath;
  174. List<FileBean> list = new List<FileBean>();
  175. FileBean bean = new FileBean();
  176. OpenFileDialog file = new OpenFileDialog();
  177. file.Multiselect = false;
  178. DialogResult drStat;
  179. drStat = file.ShowDialog();
  180. if (drStat == DialogResult.OK)
  181. {
  182. fileName = file.FileName;
  183. FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
  184. string filena = System.IO.Path.GetFileName(fileName);
  185. bean = new FileBean();
  186. bean.setFileName(filena);
  187. bean.setPathName(filePath);
  188. bean.setFile(FileHelper.FileToArray(fileName));
  189. list.Add(bean);
  190. bool isSuccess = Core.Mes.Client.Comm.Server.FileHelper.Upload(list);
  191. if (isSuccess)
  192. {
  193. CoreClientParam ccp = new CoreClientParam();
  194. ccp.ServerName = "com.steering.lims.data.pipe.FrmLabDateParm";
  195. ccp.MethodName = "updatePipeReport";
  196. ccp.ServerParams = new object[] { checkNo, "", "", "CAILI_PATH_FUJIAN", filePath };
  197. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  198. if (ccp.ReturnCode != -1)
  199. {
  200. if (ccp.ReturnInfo.Equals("上传成功!"))
  201. {
  202. MessageUtil.ShowTips(ccp.ReturnInfo);
  203. SelectFile(filePath);
  204. }
  205. else
  206. {
  207. MessageUtil.ShowTips(ccp.ReturnInfo);
  208. }
  209. }
  210. }
  211. else
  212. {
  213. MessageBox.Show("上传失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
  214. }
  215. //ultraGrid1.ActiveCell.Value = filena;
  216. //ultraGrid1.ActiveRow.Cells["SignaturePath"].Value = filePath + filena;
  217. }
  218. }
  219. //打印
  220. private void printMechanics()
  221. {
  222. this.ultraGrid40.UpdateData();
  223. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid40.Rows.AsQueryable().Where(" CHK = 'True'");
  224. string version = "";
  225. if (this.chkPrintK.Checked)
  226. {
  227. if (this.cmbPrintK.Text == "")
  228. {
  229. MessageUtil.ShowTips("请选择报告类型!");
  230. return;
  231. }
  232. else
  233. {
  234. version = this.cmbPrintK.Value.ToString();
  235. }
  236. }
  237. else
  238. {
  239. version = "MPA";
  240. }
  241. string checkNo = this.ultraGrid40.ActiveRow.Cells["CheckNo"].Text;
  242. DataTable ds = PublicServer.GetData("com.steering.lims.data.outdec.FrmOutdecDataCJBase.doQueryIsAudit", new object[] { checkNo,arrId }, ob);
  243. if(int.Parse(ds.Rows[0][0].ToString()) > 0)
  244. {
  245. MessageUtil.ShowTips("还有未审核试样组,不允许打印报告!");
  246. return;
  247. }
  248. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeLX.cpt&bypagesize=false" + "&CHECK_NO=" + checkNo + "&version=" + version;
  249. //if (this.cmbPrint.Value.ToString2().Equals("0"))
  250. //{
  251. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeMetallographicPG.cpt&bypagesize=false" + "&CHECK_NO=" + checkNo;
  252. //}
  253. //else if (this.cmbPrint.Value.ToString2().Equals("1"))
  254. //{
  255. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeMetallographicZYG.cpt&bypagesize=false" + "&CHECK_NO=" + checkNo;
  256. //}
  257. //else if (this.cmbPrint.Value.ToString2().Equals("2"))
  258. //{
  259. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeHardness.cpt&bypagesize=false" + "&CHECK_NO=" + checkNo;
  260. //}
  261. FrmRepExcel fre = new FrmRepExcel(this.ob, strurl);
  262. fre.AutoSize = true;
  263. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  264. fre.WindowState = FormWindowState.Maximized;
  265. fre.Show();
  266. }
  267. /// <summary>
  268. /// 打印附件
  269. /// </summary>
  270. private void printPicture()
  271. {
  272. this.ultraGrid40.UpdateData();
  273. string checkNo = this.ultraGrid40.ActiveRow.Cells["CheckNo"].Text;
  274. string filePath = "Lims/pipe/caili2/" + checkNo + "/";
  275. DataTable ds = PublicServer.GetData("com.steering.lims.data.outdec.FrmOutdecDataCJBase.doQueryIsAudit", new object[] { checkNo, arrId }, ob);
  276. if (int.Parse(ds.Rows[0][0].ToString()) > 0)
  277. {
  278. MessageUtil.ShowTips("还有未审核试样组,不允许打印报告!");
  279. return;
  280. }
  281. string strurl = filePath;
  282. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
  283. down.ShowDialog();
  284. }
  285. //查询上传的PDF文件
  286. /// <summary>
  287. /// 查询上传的PDF文件
  288. /// </summary>
  289. private void SelectFile(string filePathNew)
  290. {
  291. dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePathNew);
  292. down.DeleteButton.Visible = false;
  293. down.ShowDialog();
  294. }
  295. //上传
  296. /// <summary>
  297. /// 上传
  298. /// </summary>
  299. private void UpFile()
  300. {
  301. this.ultraGrid40.UpdateData();
  302. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid40.Rows.AsQueryable().Where(" CHK = 'True'");
  303. WebClient webClient = new WebClient();
  304. List<FileBean> listPdf = new List<FileBean>();
  305. string date = DateTime.Now.ToString("yyyyMMdd");
  306. string url = "";
  307. string filePathNew = ""; //报告目录
  308. string reportNo = ""; //报告编号
  309. string version = "";
  310. if (this.chkPrintK.Checked)
  311. {
  312. if (this.cmbPrintK.Text == "")
  313. {
  314. MessageUtil.ShowTips("请选择报告类型!");
  315. return;
  316. }
  317. else
  318. {
  319. version = this.cmbPrintK.Value.ToString();
  320. }
  321. }
  322. else
  323. {
  324. version = "MPA";
  325. }
  326. string checkNo = this.ultraGrid40.ActiveRow.Cells["CheckNo"].Text;
  327. DataTable ds = PublicServer.GetData("com.steering.lims.data.outdec.FrmOutdecDataCJBase.doQueryIsAudit", new object[] { checkNo, arrId }, ob);
  328. if (int.Parse(ds.Rows[0][0].ToString()) > 0)
  329. {
  330. MessageUtil.ShowTips("还有未审核试样组,不允许上传报告!");
  331. return;
  332. }
  333. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeLX.cpt&format=pdf" + "&CHECK_NO=" + checkNo + "&version=" + version;
  334. reportNo = checkNo;
  335. //if (this.cmbPrint.Value.ToString2().Equals("0"))
  336. //{
  337. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeMetallographicPG.cpt&format=pdf" + "&CHECK_NO=" + checkNo;
  338. // reportNo = checkNo + "PG";
  339. //}
  340. //else if (this.cmbPrint.Value.ToString2().Equals("1"))
  341. //{
  342. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeMetallographicZYG.cpt&format=pdf" + "&CHECK_NO=" + checkNo;
  343. // reportNo = checkNo + "ZYG";
  344. //}
  345. //else if (this.cmbPrint.Value.ToString2().Equals("2"))
  346. //{
  347. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeHardness.cpt&format=pdf" + "&CHECK_NO=" + checkNo;
  348. // reportNo = checkNo + "Hardness";
  349. //}
  350. if (strurl == "")
  351. {
  352. MessageUtil.ShowTips("请先选择上传报告的模版!");
  353. return;
  354. }
  355. filePathNew = "Lims/pipe/caili/" + checkNo + "/";
  356. byte[] pdf = webClient.DownloadData(strurl);
  357. FileBean fileBean = new FileBean();
  358. fileBean.setFile(pdf);
  359. fileBean.setFileName(reportNo + ".pdf");
  360. fileBean.setPathName(filePathNew);
  361. listPdf.Add(fileBean);
  362. webClient.Dispose();
  363. bool a = FileHelper.Upload(listPdf);
  364. if (a)
  365. {
  366. CoreClientParam ccp = new CoreClientParam();
  367. ccp.ServerName = "com.steering.lims.data.pipe.FrmLabDateParm";
  368. ccp.MethodName = "updatePipeReport";
  369. ccp.ServerParams = new object[] { checkNo, "", "", "CAILI_PATH", filePathNew };
  370. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  371. if (ccp.ReturnCode != -1)
  372. {
  373. if (ccp.ReturnInfo.Equals("上传成功!"))
  374. {
  375. MessageUtil.ShowTips(ccp.ReturnInfo);
  376. SelectFile(filePathNew);
  377. }
  378. else
  379. {
  380. MessageUtil.ShowTips(ccp.ReturnInfo);
  381. }
  382. }
  383. }
  384. else
  385. {
  386. MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
  387. return;
  388. }
  389. }
  390. //上传
  391. /// <summary>
  392. /// 上传
  393. /// </summary>
  394. private bool UpFile(string checkNo)
  395. {
  396. WebClient webClient = new WebClient();
  397. List<FileBean> listPdf = new List<FileBean>();
  398. string date = DateTime.Now.ToString("yyyyMMdd");
  399. string filePathNew = ""; //报告目录
  400. string reportNo = ""; //报告编号
  401. string strurl = "";
  402. //DataTable ds = PublicServer.GetData("com.steering.lims.data.outdec.FrmOutdecDataCJBase.doQueryIsAudit", new object[] { checkNo, arrId }, ob);
  403. //if(int.Parse(ds.Rows[0][0].ToString()) >0)
  404. //{
  405. // return false;
  406. //}
  407. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLimsPipeLX.cpt&format=pdf" + "&CHECK_NO=" + checkNo + "&version=" + "MPA";
  408. reportNo = checkNo;
  409. filePathNew = "Lims/pipe/caili/" + checkNo + "/";
  410. byte[] pdf = webClient.DownloadData(strurl);
  411. FileBean fileBean = new FileBean();
  412. fileBean.setFile(pdf);
  413. fileBean.setFileName(reportNo + ".pdf");
  414. fileBean.setPathName(filePathNew);
  415. listPdf.Add(fileBean);
  416. webClient.Dispose();
  417. bool a = FileHelper.Upload(listPdf);
  418. if (a)
  419. {
  420. CoreClientParam ccp = new CoreClientParam();
  421. ccp.ServerName = "com.steering.lims.data.pipe.FrmLabDateParm";
  422. ccp.MethodName = "updatePipeReport";
  423. ccp.ServerParams = new object[] { checkNo, "", "", "CAILI_PATH", filePathNew };
  424. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  425. if (ccp.ReturnCode != -1)
  426. {
  427. if (ccp.ReturnInfo.Equals("上传成功!"))
  428. {
  429. return true;
  430. }
  431. else
  432. {
  433. MessageUtil.ShowTips(ccp.ReturnInfo);
  434. return false;
  435. }
  436. }
  437. return true;
  438. }
  439. else
  440. {
  441. MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
  442. return false;
  443. }
  444. }
  445. /// <summary>
  446. /// 审核
  447. /// </summary>
  448. private void auditCheckConsignDetail()
  449. {
  450. this.ultraGrid27.UpdateData();
  451. this.ultraGrid28.UpdateData();
  452. UltraGridRow uRow = this.ultraGrid27.ActiveRow;
  453. if (uRow == null) return;
  454. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid28.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True");
  455. if (checkMagRows.Count() == 0)
  456. {
  457. return;
  458. }
  459. //if (cmbPrint.Text == "")
  460. //{
  461. // MessageUtil.ShowTips("请先选择上传报告的模版!");
  462. // return;
  463. //}
  464. ArrayList parmList = new ArrayList();
  465. foreach (UltraGridRow row in checkMagRows)
  466. {
  467. PipeCheckconsignDetailEntity pipeCheckDetialTity = (PipeCheckconsignDetailEntity)row.ListObject;
  468. pipeCheckDetialTity.AuditName = UserInfo.GetUserName();
  469. pipeCheckDetialTity.Flag = "4";
  470. string pipeDetailEntity = JSONFormat.Format(pipeCheckDetialTity);
  471. parmList.Add(pipeDetailEntity);
  472. }
  473. if (MessageUtil.ShowYesNoAndQuestion("是否确认审核?") == DialogResult.No)
  474. {
  475. return;
  476. }
  477. //if (!UpFile(uRow.Cells["CheckNo"].Text))
  478. //{
  479. // return;
  480. //}
  481. CoreClientParam ccp = new CoreClientParam();
  482. ccp.ServerName = "com.steering.lims.data.outdec.FrmOutdecDataCJBase";
  483. ccp.MethodName = "auditPhyDetial";
  484. ccp.ServerParams = new object[] { parmList,UserInfo.GetUserName() };
  485. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  486. if (ccp.ReturnCode != -1)
  487. {
  488. if (ccp.ReturnInfo.Equals("审核成功!"))
  489. {
  490. if (!UpFile(uRow.Cells["CheckNo"].Text))
  491. {
  492. MessageUtil.ShowTips("自动上传失败,请手动上传!");
  493. }
  494. QueryCheckConsignBaseDetailNoFrim("3");
  495. MessageUtil.ShowTips(ccp.ReturnInfo);
  496. }
  497. else
  498. {
  499. MessageUtil.ShowTips(ccp.ReturnInfo);
  500. }
  501. }
  502. }
  503. /// <summary>
  504. /// 取消审核
  505. /// </summary>
  506. private void cancelAuditCheckConsignDetail()
  507. {
  508. this.ultraGrid41.UpdateData();
  509. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid41.Rows.AsQueryable().Where(" CHK = 'True'");
  510. if (checkMagRows.Count() == 0)
  511. {
  512. return;
  513. }
  514. ArrayList parmList = new ArrayList();
  515. foreach (UltraGridRow row in checkMagRows)
  516. {
  517. PipeCheckconsignDetailEntity pipeCheckDetialTity = (PipeCheckconsignDetailEntity)row.ListObject;
  518. string pipeDetailEntity = JSONFormat.Format(pipeCheckDetialTity);
  519. parmList.Add(pipeDetailEntity);
  520. }
  521. if (MessageUtil.ShowYesNoAndQuestion("是否取消审核?") == DialogResult.No)
  522. {
  523. return;
  524. }
  525. CoreClientParam ccp = new CoreClientParam();
  526. ccp.ServerName = "com.steering.lims.data.outdec.FrmOutdecDataCJBase";
  527. ccp.MethodName = "cancelAuditPhyDetial";
  528. ccp.ServerParams = new object[] { parmList };
  529. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  530. if (ccp.ReturnCode != -1)
  531. {
  532. if (ccp.ReturnInfo.Equals("取消审核成功!"))
  533. {
  534. QueryCheckConsignBaseDetailYesFrim("4");
  535. MessageUtil.ShowTips(ccp.ReturnInfo);
  536. }
  537. else
  538. {
  539. MessageUtil.ShowTips(ccp.ReturnInfo);
  540. }
  541. }
  542. }
  543. /// <summary>
  544. /// 删除检验结果
  545. /// </summary>
  546. private void DeleteCheckConsignProcessResult()
  547. {
  548. ultraGrid16.UpdateData();
  549. ultraGrid17.UpdateData();
  550. ultraGrid18.UpdateData();
  551. ultraGrid19.UpdateData();
  552. ultraGrid20.UpdateData();
  553. ultraGrid21.UpdateData();
  554. ultraGrid22.UpdateData();
  555. ultraGrid23.UpdateData();
  556. ultraGrid55.UpdateData();
  557. UltraGridRow uRow = this.ultraGrid15.ActiveRow;
  558. RowsCollection uRow1 = null;
  559. if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))
  560. {
  561. uRow1 = this.ultraGrid16.Rows;
  562. }
  563. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))
  564. {
  565. uRow1 = this.ultraGrid17.Rows;
  566. }
  567. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))
  568. {
  569. uRow1 = this.ultraGrid20.Rows;
  570. }
  571. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))
  572. {
  573. uRow1 = this.ultraGrid18.Rows;
  574. }
  575. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))
  576. {
  577. uRow1 = this.ultraGrid19.Rows;
  578. }
  579. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))
  580. {
  581. uRow1 = this.ultraGrid21.Rows;
  582. }
  583. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))
  584. {
  585. uRow1 = this.ultraGrid22.Rows;
  586. }
  587. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0016"))
  588. {
  589. uRow1 = this.ultraGrid23.Rows;
  590. }
  591. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009"))
  592. {
  593. uRow1 = this.ultraGrid24.Rows;
  594. }
  595. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098"))
  596. {
  597. uRow1 = this.ultraGrid25.Rows;
  598. }
  599. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041"))
  600. {
  601. uRow1 = this.ultraGrid26.Rows;
  602. }
  603. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0050"))
  604. {
  605. uRow1 = this.ultraGrid55.Rows;
  606. }
  607. ArrayList parmList = new ArrayList();
  608. foreach (UltraGridRow row in uRow1)
  609. {
  610. PipeCheckconsignPhydetailEntity pipeCheckTity = (PipeCheckconsignPhydetailEntity)row.ListObject;
  611. pipeCheckTity.CheckNo = uRow.Cells["CheckNo"].Text;
  612. pipeCheckTity.SampleNo = uRow.Cells["SampleNo"].Text;
  613. pipeCheckTity.PhyCodeMin = uRow.Cells["PhyCodeMin"].Text;//试样组
  614. pipeCheckTity.PhyNameMin = uRow.Cells["PhyNameMin"].Text;
  615. string phyEntity = JSONFormat.Format(pipeCheckTity);
  616. parmList.Add(phyEntity);
  617. }
  618. PipeCheckconsignDetailEntity pipeDetailTity = (PipeCheckconsignDetailEntity)uRow.ListObject;
  619. string pipeDetailEntity = JSONFormat.Format(pipeDetailTity);
  620. CoreClientParam ccp = new CoreClientParam();
  621. ccp.ServerName = "com.steering.lims.data.outdec.FrmOutdecDataCJBase";
  622. ccp.MethodName = "deletePhyDetial";
  623. ccp.ServerParams = new object[] { pipeDetailEntity, parmList };
  624. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  625. if (ccp.ReturnCode != -1)
  626. {
  627. if (ccp.ReturnInfo.Equals("删除成功!"))
  628. {
  629. QueryCheckConsignBaseDetail("3");
  630. MessageUtil.ShowTips(ccp.ReturnInfo);
  631. }
  632. else
  633. {
  634. MessageUtil.ShowTips(ccp.ReturnInfo);
  635. }
  636. }
  637. }
  638. /// <summary>
  639. /// 修改检验结果
  640. /// </summary>
  641. private void UpdateCheckConsignProcessResult()
  642. {
  643. ultraGrid16.UpdateData();
  644. ultraGrid17.UpdateData();
  645. ultraGrid18.UpdateData();
  646. ultraGrid19.UpdateData();
  647. ultraGrid20.UpdateData();
  648. ultraGrid21.UpdateData();
  649. ultraGrid22.UpdateData();
  650. ultraGrid23.UpdateData();
  651. ultraGrid55.UpdateData();
  652. UltraGridRow uRow = this.ultraGrid15.ActiveRow;
  653. RowsCollection uRow1 = null;
  654. if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))
  655. {
  656. uRow1 = this.ultraGrid16.Rows;
  657. }
  658. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))
  659. {
  660. uRow1 = this.ultraGrid17.Rows;
  661. }
  662. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))
  663. {
  664. uRow1 = this.ultraGrid20.Rows;
  665. }
  666. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))
  667. {
  668. uRow1 = this.ultraGrid18.Rows;
  669. }
  670. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))
  671. {
  672. uRow1 = this.ultraGrid19.Rows;
  673. }
  674. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))
  675. {
  676. uRow1 = this.ultraGrid21.Rows;
  677. }
  678. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))
  679. {
  680. uRow1 = this.ultraGrid22.Rows;
  681. }
  682. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0016"))
  683. {
  684. uRow1 = this.ultraGrid23.Rows;
  685. }
  686. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009"))
  687. {
  688. uRow1 = this.ultraGrid24.Rows;
  689. }
  690. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098"))
  691. {
  692. uRow1 = this.ultraGrid25.Rows;
  693. }
  694. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041"))
  695. {
  696. uRow1 = this.ultraGrid26.Rows;
  697. }
  698. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0050"))
  699. {
  700. uRow1 = this.ultraGrid55.Rows;
  701. }
  702. PipeCheckconsignDetailEntity pipeDetailTity = new PipeCheckconsignDetailEntity();
  703. ArrayList parmList = new ArrayList();
  704. foreach (UltraGridRow row in uRow1)
  705. {
  706. PipeCheckconsignPhydetailEntity pipeCheckTity = (PipeCheckconsignPhydetailEntity)row.ListObject;
  707. pipeCheckTity.Value1.Replace('<', '-');
  708. pipeCheckTity.Value2.Replace('<', '-');
  709. pipeCheckTity.Value3.Replace('<', '-');
  710. pipeCheckTity.Value4.Replace('<', '-');
  711. pipeCheckTity.AverageValue.Replace('<', '-');
  712. pipeCheckTity.CheckNo = uRow.Cells["CheckNo"].Text;
  713. pipeCheckTity.SampleNo = uRow.Cells["SampleNo"].Text;
  714. pipeCheckTity.PhyCodeMin = uRow.Cells["PhyCodeMin"].Text;//试样组
  715. pipeCheckTity.PhyNameMin = uRow.Cells["PhyNameMin"].Text;
  716. if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009"))//压扁试验
  717. {
  718. pipeCheckTity.Value8 = this.ultraTxtYbSpac.Text.Trim();
  719. pipeCheckTity.IsGood = this.ultraTxtYbQualfiled.Value.ToString2();
  720. pipeCheckTity.IsDefect = this.ultraTxtYbDefect.Value.ToString2();
  721. pipeCheckTity.Remark = this.ultraTxtYbMemo.Text.Trim();
  722. }
  723. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098"))//弯曲试验
  724. {
  725. pipeCheckTity.Value9 = this.ultraTxtWqDiameter.Text.Trim();
  726. pipeCheckTity.Value10 = this.ultraTxtWqAngle.Text.Trim();
  727. pipeCheckTity.IsGood = this.ultraTxtWqQualfiled.Value.ToString2();
  728. pipeCheckTity.Remark = this.ultraTxtWqMemo.Text.Trim();
  729. }
  730. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041"))//扩口试验
  731. {
  732. pipeCheckTity.Value11 = this.ultraTxtKkTop.Text.Trim();
  733. pipeCheckTity.Value12 = this.ultraTxtKkFlarRate.Text.Trim();
  734. pipeCheckTity.IsGood = this.ultraTxtKkGood.Value.ToString2();
  735. pipeCheckTity.Remark = this.ultraTxtKkMemo.Text.Trim();
  736. }
  737. string phyEntity = JSONFormat.Format(pipeCheckTity);
  738. parmList.Add(phyEntity);
  739. }
  740. pipeDetailTity.CheckNo = uRow.Cells["CheckNo"].Text;
  741. pipeDetailTity.SampleNo = uRow.Cells["SampleNo"].Text;
  742. pipeDetailTity.PhyCodeMin = uRow.Cells["PhyCodeMin"].Text;//检验大项
  743. pipeDetailTity.PhyCodeMax = uRow.Cells["PhyCodeMax"].Text;//试样组
  744. pipeDetailTity.CheckTemp = this.txtCHECK_TEMP1.Text.Trim();
  745. pipeDetailTity.DeviceNo = this.ultraDEVICE_NAME1.Value.ToString2();
  746. pipeDetailTity.DeviceName = this.ultraDEVICE_NAME1.Text.Trim();
  747. pipeDetailTity.FormualNo = this.ultraComMethod1.Value.ToString2();
  748. pipeDetailTity.FormualName = this.ultraComMethod1.Text.Trim();
  749. pipeDetailTity.CheckName = this.UserInfo.GetUserName();
  750. pipeDetailTity.CheckShift = this.UserInfo.GetUserOrder();
  751. pipeDetailTity.CheckClass = this.UserInfo.GetUserGroup();
  752. pipeDetailTity.Remark = this.txtREMARK1.Text;
  753. pipeDetailTity.HardnessType = this.ultraComFormual1.Text;
  754. pipeDetailTity.StdSteelNo = this.txtStdSteelNo1.Text.Trim();
  755. pipeDetailTity.StdSteelType = this.cmbStdSteelType1.Text;
  756. pipeDetailTity.StdSteelValue = txtStdSteelValue1.Text.Trim();
  757. pipeDetailTity.ActualValue = txtActualValue1.Text.Trim();
  758. string pipeDetailEntity = JSONFormat.Format(pipeDetailTity);
  759. CoreClientParam ccp = new CoreClientParam();
  760. ccp.ServerName = "com.steering.lims.data.outdec.FrmOutdecDataCJBase";
  761. ccp.MethodName = "updatePhyDetial";
  762. ccp.ServerParams = new object[] { pipeDetailEntity,parmList,UserInfo.GetUserName() };
  763. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  764. if (ccp.ReturnCode != -1)
  765. {
  766. if (ccp.ReturnInfo.Equals("修改成功!"))
  767. {
  768. QueryCheckConsignBaseDetail("3");
  769. MessageUtil.ShowTips(ccp.ReturnInfo);
  770. }
  771. else
  772. {
  773. MessageUtil.ShowTips(ccp.ReturnInfo);
  774. }
  775. }
  776. }
  777. /// <summary>
  778. ///保存理化录入值
  779. /// </summary>
  780. private void AddPhyData()
  781. {
  782. this.ultraGrid3.UpdateData();
  783. this.ultraGrid4.UpdateData();
  784. this.ultraGrid5.UpdateData();
  785. this.ultraGrid6.UpdateData();
  786. this.ultraGrid7.UpdateData();
  787. this.ultraGrid8.UpdateData();
  788. this.ultraGrid9.UpdateData();
  789. this.ultraGrid10.UpdateData();
  790. this.ultraGrid53.UpdateData();
  791. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  792. RowsCollection uRow1 = null;
  793. if(uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))
  794. {
  795. uRow1 = this.ultraGrid3.Rows;
  796. }
  797. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))
  798. {
  799. uRow1 = this.ultraGrid4.Rows;
  800. }
  801. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))
  802. {
  803. uRow1 = this.ultraGrid6.Rows;
  804. }
  805. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))
  806. {
  807. uRow1 = this.ultraGrid5.Rows;
  808. }
  809. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))
  810. {
  811. uRow1 = this.ultraGrid7.Rows;
  812. }
  813. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))
  814. {
  815. uRow1 = this.ultraGrid8.Rows;
  816. }
  817. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))
  818. {
  819. uRow1 = this.ultraGrid10.Rows;
  820. }
  821. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0016"))
  822. {
  823. uRow1 = this.ultraGrid9.Rows;
  824. }
  825. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009"))
  826. {
  827. uRow1 = this.ultraGrid13.Rows;
  828. }
  829. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098"))
  830. {
  831. uRow1 = this.ultraGrid11.Rows;
  832. }
  833. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041"))
  834. {
  835. uRow1 = this.ultraGrid12.Rows;
  836. }
  837. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0050"))
  838. {
  839. uRow1 = this.ultraGrid53.Rows;
  840. }
  841. if (!checkData())
  842. {
  843. return;
  844. }
  845. ArrayList parmList = new ArrayList();
  846. PipeCheckconsignDetailEntity pipeDetailTity = new PipeCheckconsignDetailEntity();
  847. //ArrayList tempList = new ArrayList();
  848. foreach (UltraGridRow row in uRow1)
  849. {
  850. PipeCheckconsignPhydetailEntity pipeCheckTity = (PipeCheckconsignPhydetailEntity)row.ListObject;
  851. pipeCheckTity.CheckNo = uRow.Cells["CheckNo"].Text;
  852. pipeCheckTity.SampleNo = uRow.Cells["SampleNo"].Text;
  853. pipeCheckTity.PhyCodeMin = uRow.Cells["PhyCodeMax"].Text;//试样组
  854. pipeCheckTity.PhyNameMin = uRow.Cells["PhyNameMax"].Text;
  855. if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009"))//压扁试验
  856. {
  857. pipeCheckTity.Value8 = this.TxtYbSpac.Text.Trim();
  858. pipeCheckTity.Value7 = this.TxtYbC.Text.Trim();
  859. pipeCheckTity.IsGood = this.TxtYbQualfiled.Value.ToString2();
  860. pipeCheckTity.IsDefect = this.TxtYbDefect.Value.ToString2();
  861. pipeCheckTity.CalculationFormula = this.TxtYbEuestion.Text;
  862. pipeCheckTity.Remark = this.TxtYbMemo.Text.Trim();
  863. }
  864. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098"))//弯曲试验
  865. {
  866. pipeCheckTity.Value9 = this.TxtWqDiameter.Text.Trim();
  867. pipeCheckTity.Value10 = this.TxtWqAngle.Text.Trim();
  868. pipeCheckTity.IsGood = this.TxtWqQualfiled.Value.ToString2();
  869. pipeCheckTity.Remark = this.TxtWqMemo.Text.Trim();
  870. }
  871. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041"))//扩口试验
  872. {
  873. pipeCheckTity.Value11 = this.TxtKkTop.Text.Trim();
  874. pipeCheckTity.Value12 = this.TxtKkFlarRate.Text.Trim();
  875. pipeCheckTity.IsGood = this.TxtKkGood.Value.ToString2();
  876. pipeCheckTity.Remark = this.TxtKkMemo.Text.Trim();
  877. }
  878. string phyEntity = JSONFormat.Format(pipeCheckTity);
  879. parmList.Add(phyEntity);
  880. }
  881. pipeDetailTity.CheckNo = uRow.Cells["CheckNo"].Text;
  882. pipeDetailTity.SampleNo = uRow.Cells["SampleNo"].Text;
  883. pipeDetailTity.PhyCodeMin = uRow.Cells["PhyCodeMin"].Text;//检验大项
  884. pipeDetailTity.PhyCodeMax = uRow.Cells["PhyCodeMax"].Text;//试样组
  885. pipeDetailTity.CheckTemp = this.txtCHECK_TEMP.Text.Trim();
  886. pipeDetailTity.DeviceNo = this.ultraDEVICE_NAME.Value.ToString2();
  887. pipeDetailTity.DeviceName = this.ultraDEVICE_NAME.Text.Trim();
  888. pipeDetailTity.FormualNo = this.ultraComMethod.Value.ToString2();
  889. pipeDetailTity.FormualName = this.ultraComMethod.Text.Trim();
  890. pipeDetailTity.CheckName = this.txtChemUser.Text.Trim();
  891. pipeDetailTity.CheckShift = this.cmbChemOrder.Value.ToString2();
  892. pipeDetailTity.CheckClass = this.cmbChemGroup.Value.ToString2();
  893. pipeDetailTity.StdSteelNo = this.txtStdSteelNo.Text.Trim();
  894. pipeDetailTity.StdSteelType = this.cmbStdSteelType.Text.Trim();
  895. pipeDetailTity.StdSteelValue = this.txtStdSteelValue.Text.Trim();
  896. pipeDetailTity.ActualValue = this.txtActualValue.Text.Trim();
  897. pipeDetailTity.HardnessType = this.ultraComFormual.Text.Trim();
  898. pipeDetailTity.Flag = "3";//录入状态
  899. string pipeDetailEntity = JSONFormat.Format(pipeDetailTity);
  900. CoreClientParam ccp = new CoreClientParam();
  901. ccp.ServerName = "com.steering.lims.data.outdec.FrmOutdecDataCJBase";
  902. ccp.MethodName = "addPhyDataNew";
  903. ccp.ServerParams = new object[] { pipeDetailEntity, parmList };
  904. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  905. if (ccp.ReturnCode != -1)
  906. {
  907. if (ccp.ReturnInfo.Equals("保存成功!"))
  908. {
  909. this.txtStdSteelNo.Text = "";
  910. this.cmbStdSteelType.Text = "";
  911. this.txtStdSteelValue.Text = "";
  912. this.txtActualValue.Text = "";
  913. QueryCheckConsignBaseDetail("2");
  914. MessageUtil.ShowTips(ccp.ReturnInfo);
  915. }
  916. else
  917. {
  918. MessageUtil.ShowTips(ccp.ReturnInfo);
  919. }
  920. }
  921. }
  922. /// <summary>
  923. /// 数据验证
  924. /// </summary>
  925. /// <returns></returns>
  926. private bool checkData()
  927. {
  928. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  929. if (this.txtCHECK_TEMP.Text.Trim() == "")
  930. {
  931. MessageUtil.ShowTips("试验温度不允许为空!");
  932. return false;
  933. }
  934. if (this.ultraDEVICE_NAME.Text.Trim() == "")
  935. {
  936. MessageUtil.ShowTips("试验设备不允许为空!");
  937. return false;
  938. }
  939. if (this.ultraComMethod.Text.Trim() == "")
  940. {
  941. MessageUtil.ShowTips("试验方法不允许为空!");
  942. return false;
  943. }
  944. if (this.cmbChemOrder.Text == "" || this.cmbChemGroup.Text == "")
  945. {
  946. MessageUtil.ShowTips("班次班组不允许为空!");
  947. return false;
  948. }
  949. if (txtChemUser.Text.Trim() == "")
  950. {
  951. MessageUtil.ShowTips("试验人不允许为空!");
  952. return false;
  953. }
  954. if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))//拉伸试验
  955. {
  956. foreach(UltraGridRow row in this.ultraGrid3.Rows)
  957. {
  958. if(row.Cells["Value1"].Text.ToString() == "")
  959. {
  960. MessageUtil.ShowTips("黄色区域有数据未录入,请核实!");
  961. return false;
  962. }
  963. }
  964. }
  965. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))//夏比冲击试验
  966. {
  967. foreach (UltraGridRow row in this.ultraGrid4.Rows)
  968. {
  969. if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString() == "" || row.Cells["Value3"].Text.ToString() == "")
  970. {
  971. MessageUtil.ShowTips("黄色区域有数据未录入,请核实!");
  972. return false;
  973. }
  974. }
  975. }
  976. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0004"))//洛氏硬度
  977. {
  978. //if (ultraComFormual.Text == "")
  979. //{
  980. // MessageUtil.ShowTips("硬度类型不能为空!");
  981. // return false;
  982. //}
  983. if (txtStdSteelNo.Text.Trim() == "")
  984. {
  985. MessageUtil.ShowTips("标钢编号不能为空!");
  986. return false;
  987. }
  988. if (cmbStdSteelType.Text.Trim() == "")
  989. {
  990. MessageUtil.ShowTips("标钢类型不能为空!");
  991. return false;
  992. }
  993. if (txtStdSteelValue.Text.Trim() == "")
  994. {
  995. MessageUtil.ShowTips("标钢标准值不能为空!");
  996. return false;
  997. }
  998. if (txtActualValue.Text.Trim() == "")
  999. {
  1000. MessageUtil.ShowTips("标钢实测值不能为空!");
  1001. return false;
  1002. }
  1003. foreach (UltraGridRow row in this.ultraGrid5.Rows)
  1004. {
  1005. if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString() == "" || row.Cells["Value3"].Text.ToString() == "")
  1006. {
  1007. MessageUtil.ShowTips("黄色区域有数据未录入,请核实!");
  1008. return false;
  1009. }
  1010. }
  1011. }
  1012. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))//维氏硬度
  1013. {
  1014. if (ultraComFormual.Text == "")
  1015. {
  1016. MessageUtil.ShowTips("硬度类型不能为空!");
  1017. return false;
  1018. }
  1019. if (txtStdSteelNo.Text.Trim() == "")
  1020. {
  1021. MessageUtil.ShowTips("标钢编号不能为空!");
  1022. return false;
  1023. }
  1024. if (cmbStdSteelType.Text.Trim() == "")
  1025. {
  1026. MessageUtil.ShowTips("标钢类型不能为空!");
  1027. return false;
  1028. }
  1029. if (txtStdSteelValue.Text.Trim() == "")
  1030. {
  1031. MessageUtil.ShowTips("标钢标准值不能为空!");
  1032. return false;
  1033. }
  1034. if (txtActualValue.Text.Trim() == "")
  1035. {
  1036. MessageUtil.ShowTips("标钢实测值不能为空!");
  1037. return false;
  1038. }
  1039. foreach (UltraGridRow row in this.ultraGrid7.Rows)
  1040. {
  1041. if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString() == "" || row.Cells["Value3"].Text.ToString() == ""||row.Cells["Value4"].Text.ToString()== "")
  1042. {
  1043. MessageUtil.ShowTips("黄色区域有数据未录入,请核实!");
  1044. return false;
  1045. }
  1046. }
  1047. }
  1048. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))//布氏硬度
  1049. {
  1050. if (ultraComFormual.Text == "")
  1051. {
  1052. MessageUtil.ShowTips("硬度类型不能为空!");
  1053. return false;
  1054. }
  1055. if (txtStdSteelNo.Text.Trim() == "")
  1056. {
  1057. MessageUtil.ShowTips("标钢编号不能为空!");
  1058. return false;
  1059. }
  1060. if (cmbStdSteelType.Text.Trim() == "")
  1061. {
  1062. MessageUtil.ShowTips("标钢类型不能为空!");
  1063. return false;
  1064. }
  1065. if (txtStdSteelValue.Text.Trim() == "")
  1066. {
  1067. MessageUtil.ShowTips("标钢标准值不能为空!");
  1068. return false;
  1069. }
  1070. if (txtActualValue.Text.Trim() == "")
  1071. {
  1072. MessageUtil.ShowTips("标钢实测值不能为空!");
  1073. return false;
  1074. }
  1075. foreach (UltraGridRow row in this.ultraGrid6.Rows)
  1076. {
  1077. if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString() == "" || row.Cells["Value3"].Text.ToString() == "")
  1078. {
  1079. MessageUtil.ShowTips("黄色区域有数据未录入,请核实!");
  1080. return false;
  1081. }
  1082. }
  1083. }
  1084. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))//夹杂物
  1085. {
  1086. foreach (UltraGridRow row in this.ultraGrid8.Rows)
  1087. {
  1088. if (uRow.Cells["PhyCodeMax"].Value.ToString().Equals("C0011"))
  1089. {
  1090. if (row.Cells["Value1"].Text.ToString() == "")
  1091. {
  1092. MessageUtil.ShowTips("黄色区域有数据未录入,请核实!");
  1093. return false;
  1094. }
  1095. }
  1096. else if (uRow.Cells["PhyCodeMax"].Value.ToString().Equals("C0115"))
  1097. {
  1098. if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString()== "" || row.Cells["Value3"].Text.ToString() == "" ||row.Cells["Value4"].Text.ToString() == "")
  1099. {
  1100. MessageUtil.ShowTips("黄色区域有数据未录入,请核实!");
  1101. return false;
  1102. }
  1103. }
  1104. }
  1105. }
  1106. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))//晶粒度
  1107. {
  1108. foreach (UltraGridRow row in this.ultraGrid10.Rows)
  1109. {
  1110. if (row.Cells["Value1"].Text.ToString() == "")
  1111. {
  1112. MessageUtil.ShowTips("黄色区域有数据未录入,请核实!");
  1113. return false;
  1114. }
  1115. }
  1116. }
  1117. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0014"))//组织
  1118. {
  1119. foreach (UltraGridRow row in this.ultraGrid9.Rows)
  1120. {
  1121. if (row.Cells["Value1"].Text.ToString() == "")
  1122. {
  1123. MessageUtil.ShowTips("黄色区域有数据未录入,请核实!");
  1124. return false;
  1125. }
  1126. }
  1127. }
  1128. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0009"))
  1129. {
  1130. ultraGrid13.UpdateData();
  1131. if (this.ultraGrid13.ActiveRow.Cells["PhyCode"].Text.Equals("P0330"))
  1132. {
  1133. if (this.TxtYbSpac.Text.Trim() == "" || this.TxtYbQualfiled.Value.ToString2() == "" || this.TxtYbDefect.Value.ToString2() == "")
  1134. {
  1135. MessageUtil.ShowTips("压扁试验时压扁间距以及是否完好、是否缺陷不能为空!");
  1136. return false;
  1137. }
  1138. }
  1139. else
  1140. {
  1141. if (this.TxtYbSpac.Text.Trim() == "" || this.TxtYbQualfiled.Value.ToString2() == "")
  1142. {
  1143. MessageUtil.ShowTips("压扁试验时压扁间距以及是否完好、是否缺陷不能为空!");
  1144. return false;
  1145. }
  1146. }
  1147. }
  1148. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0027") || uRow.Cells["PhyCodeMax"].Value.Equals("C0038") || uRow.Cells["PhyCodeMax"].Value.Equals("C0082") || uRow.Cells["PhyCodeMax"].Value.Equals("C0083") || uRow.Cells["PhyCodeMax"].Value.Equals("C0098"))
  1149. {
  1150. if (this.TxtWqDiameter.Text.Trim() == "" || this.TxtWqAngle.Value.ToString2() == "" || this.TxtWqQualfiled.Value.ToString2() == "")
  1151. {
  1152. MessageUtil.ShowTips("弯曲试验时弯曲直径、弯曲角度、是否完好不能为空!");
  1153. return false;
  1154. }
  1155. }
  1156. else if (uRow.Cells["PhyCodeMax"].Value.Equals("C0026") || uRow.Cells["PhyCodeMax"].Value.Equals("C0039") || uRow.Cells["PhyCodeMax"].Value.Equals("C0040") || uRow.Cells["PhyCodeMax"].Value.Equals("C0041"))
  1157. {
  1158. if (this.TxtKkTop.Text.Trim() == "" || this.TxtKkFlarRate.Text.Trim() == "" || this.TxtKkGood.Value.ToString2() == "")
  1159. {
  1160. MessageUtil.ShowTips("扩口试验时顶芯角度、扩口率、是否完好不能为空!");
  1161. return false;
  1162. }
  1163. }
  1164. else if (uRow.Cells["PhyCodeMin"].Value.ToString().Equals("R0050"))
  1165. {
  1166. foreach (UltraGridRow row in this.ultraGrid53.Rows)
  1167. {
  1168. if (row.Cells["Value1"].Text.ToString() == "" || row.Cells["Value2"].Text.ToString() == "" || row.Cells["Value3"].Text.ToString() == "")
  1169. {
  1170. MessageUtil.ShowTips("黄色区域有数据未录入,请核实!");
  1171. return false;
  1172. }
  1173. }
  1174. }
  1175. return true;
  1176. }
  1177. //查询
  1178. private void QueryCheckConsignBaseDetail(string flag)
  1179. {
  1180. string startTim = "";
  1181. string endTim = "";
  1182. string checkNo = "";
  1183. string judgeNo = "";
  1184. string sampleNo = "";
  1185. string steelName = "";
  1186. string specName = "";
  1187. string orderNo = "";
  1188. string checkPhy = "";
  1189. string txtGroup = "";
  1190. string ispodutor = "";
  1191. var status = new List<string> { };
  1192. if (chkType.Checked)
  1193. {
  1194. status = cmbType.CheckedItems.Select(p => p.DataValue.ToString()).ToList();
  1195. if (!status.Any()) status = new List<string> { "0", "1", "2", "3", "4", "5" };
  1196. }
  1197. ArrayList parmList = new ArrayList();
  1198. if(chkRegTime.Checked)
  1199. {
  1200. startTim = this.RegStartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1201. endTim = this.RegEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1202. }
  1203. if(chkCheckNo.Checked && this.txtCheckNo.Text.Trim() != "")
  1204. {
  1205. checkNo = this.txtCheckNo.Text.Trim();
  1206. }
  1207. if(chkJudgeNo.Checked && this.txtJudgeNo.Text != "")
  1208. {
  1209. judgeNo = this.txtJudgeNo.Text.Trim();
  1210. }
  1211. if(chkSampleNo.Checked && this.txtSampleNo.Text.Trim() != "")
  1212. {
  1213. sampleNo = txtSampleNo.Text.Trim();
  1214. }
  1215. if(chkOrderNo.Checked && this.txtOrderNo.Text != "")
  1216. {
  1217. orderNo = txtOrderNo.Text.Trim();
  1218. }
  1219. if(chkSteel.Checked && this.txtSteel.Text.Trim() != "")
  1220. {
  1221. steelName = this.txtSteel.Text.Trim();
  1222. }
  1223. if(chkSpec.Checked && this.txtSpec.Text.Trim() != "")
  1224. {
  1225. specName = this.txtSpec.Text.Trim();
  1226. }
  1227. if(chkGroup.Checked && this.cmbGroup.Text != "")
  1228. {
  1229. txtGroup = this.cmbGroup.Value.ToString2();
  1230. }
  1231. if (chkIsProuctor.Checked && this.cmbIsProductor.Text != "")
  1232. {
  1233. ispodutor = this.cmbIsProductor.Value.ToString2();
  1234. }
  1235. checkPhy = ultraOptionSet1.CheckedItem.DataValue.ToString();
  1236. parmList.Add(startTim);
  1237. parmList.Add(endTim);
  1238. parmList.Add(checkNo);
  1239. parmList.Add(judgeNo);
  1240. parmList.Add(sampleNo);
  1241. parmList.Add(orderNo);
  1242. parmList.Add(steelName);
  1243. parmList.Add(specName);
  1244. parmList.Add(txtGroup);
  1245. parmList.Add(ispodutor);
  1246. parmList.Add(checkPhy);
  1247. if (flag.Equals("2"))
  1248. {
  1249. PipeCheckconsignDetailEntitybindingSource1.Clear();
  1250. List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
  1251. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetail", new object[] { parmList, arrId, "2", status.ToArray() }, this.ob);
  1252. PipeCheckconsignDetailEntitybindingSource.DataSource = listSource;
  1253. }
  1254. else if (flag.Equals("3"))
  1255. {
  1256. PipeCheckconsignDetailEntitybindingSource4.Clear();
  1257. List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
  1258. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetail", new object[] { parmList, arrId, "3", status.ToArray() }, this.ob);
  1259. RecordedSource.DataSource = listSource;
  1260. }
  1261. }
  1262. /// <summary>
  1263. /// 查询未审核数据
  1264. /// </summary>
  1265. /// <param name="p"></param>
  1266. private void QueryCheckConsignBaseDetailNoFrim(string flag)
  1267. {
  1268. string startTim = "";
  1269. string endTim = "";
  1270. string checkNo = "";
  1271. string judgeNo = "";
  1272. string sampleNo = "";
  1273. string steelName = "";
  1274. string specName = "";
  1275. string orderNo = "";
  1276. string txtGroup = "";
  1277. string ispodutor = "";
  1278. string checkPhy = "";
  1279. ArrayList parmList = new ArrayList();
  1280. var status = new List<string> { };
  1281. if (chkType.Checked)
  1282. {
  1283. status = cmbType.CheckedItems.Select(p => p.DataValue.ToString()).ToList();
  1284. if (!status.Any()) status = new List<string> { "0", "1", "2", "3", "4", "5" };
  1285. }
  1286. if (chkRegTime.Checked)
  1287. {
  1288. startTim = this.RegStartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1289. endTim = this.RegEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1290. }
  1291. if (chkCheckNo.Checked && this.txtCheckNo.Text.Trim() != "")
  1292. {
  1293. checkNo = this.txtCheckNo.Text.Trim();
  1294. }
  1295. if (chkJudgeNo.Checked && this.txtJudgeNo.Text != "")
  1296. {
  1297. judgeNo = this.txtJudgeNo.Text.Trim();
  1298. }
  1299. if (chkSampleNo.Checked && this.txtSampleNo.Text.Trim() != "")
  1300. {
  1301. sampleNo = txtSampleNo.Text.Trim();
  1302. }
  1303. if (chkOrderNo.Checked && this.txtOrderNo.Text != "")
  1304. {
  1305. orderNo = txtOrderNo.Text.Trim();
  1306. }
  1307. if (chkSteel.Checked && this.txtSteel.Text.Trim() != "")
  1308. {
  1309. steelName = this.txtSteel.Text.Trim();
  1310. }
  1311. if (chkSpec.Checked && this.txtSpec.Text.Trim() != "")
  1312. {
  1313. specName = this.txtSpec.Text.Trim();
  1314. }
  1315. if (chkGroup.Checked && this.cmbGroup.Text != "")
  1316. {
  1317. txtGroup = this.cmbGroup.Value.ToString2();
  1318. }
  1319. if (chkIsProuctor.Checked && this.cmbIsProductor.Text != "")
  1320. {
  1321. ispodutor = this.cmbIsProductor.Value.ToString2();
  1322. }
  1323. checkPhy = ultraOptionSet1.CheckedItem.DataValue.ToString();
  1324. parmList.Add(startTim);
  1325. parmList.Add(endTim);
  1326. parmList.Add(checkNo);
  1327. parmList.Add(judgeNo);
  1328. parmList.Add(sampleNo);
  1329. parmList.Add(orderNo);
  1330. parmList.Add(steelName);
  1331. parmList.Add(specName);
  1332. parmList.Add(txtGroup);
  1333. parmList.Add(ispodutor);
  1334. parmList.Add(checkPhy);
  1335. PipeCheckconsignDetailEntitybindingSource2.Clear();
  1336. List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
  1337. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailNoFrim", new object[] { parmList, arrId, status.ToArray() }, this.ob);
  1338. pipeCheckconsignDetailEntityBindingSource5.DataSource = listSource;
  1339. }
  1340. /// <summary>
  1341. /// 查询已审核数据
  1342. /// </summary>
  1343. /// <param name="p"></param>
  1344. private void QueryCheckConsignBaseDetailYesFrim(string flag)
  1345. {
  1346. string startTim = "";
  1347. string endTim = "";
  1348. string checkNo = "";
  1349. string judgeNo = "";
  1350. string sampleNo = "";
  1351. string steelName = "";
  1352. string specName = "";
  1353. string orderNo = "";
  1354. string txtGroup = "";
  1355. string ispodutor = "";
  1356. string checkPhy = "";
  1357. ArrayList parmList = new ArrayList();
  1358. var status = new List<string> { };
  1359. if (chkType.Checked)
  1360. {
  1361. status = cmbType.CheckedItems.Select(p => p.DataValue.ToString()).ToList();
  1362. if (!status.Any()) status = new List<string> { "0", "1", "2", "3", "4", "5" };
  1363. }
  1364. if (chkRegTime.Checked)
  1365. {
  1366. startTim = this.RegStartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1367. endTim = this.RegEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  1368. }
  1369. if (chkCheckNo.Checked && this.txtCheckNo.Text.Trim() != "")
  1370. {
  1371. checkNo = this.txtCheckNo.Text.Trim();
  1372. }
  1373. if (chkJudgeNo.Checked && this.txtJudgeNo.Text != "")
  1374. {
  1375. judgeNo = this.txtJudgeNo.Text.Trim();
  1376. }
  1377. if (chkSampleNo.Checked && this.txtSampleNo.Text.Trim() != "")
  1378. {
  1379. sampleNo = txtSampleNo.Text.Trim();
  1380. }
  1381. if (chkOrderNo.Checked && this.txtOrderNo.Text != "")
  1382. {
  1383. orderNo = txtOrderNo.Text.Trim();
  1384. }
  1385. if (chkSteel.Checked && this.txtSteel.Text.Trim() != "")
  1386. {
  1387. steelName = this.txtSteel.Text.Trim();
  1388. }
  1389. if (chkSpec.Checked && this.txtSpec.Text.Trim() != "")
  1390. {
  1391. specName = this.txtSpec.Text.Trim();
  1392. }
  1393. if (chkGroup.Checked && this.cmbGroup.Text != "")
  1394. {
  1395. txtGroup = this.cmbGroup.Value.ToString2();
  1396. }
  1397. if (chkIsProuctor.Checked && this.cmbIsProductor.Text != "")
  1398. {
  1399. ispodutor = this.cmbIsProductor.Value.ToString2();
  1400. }
  1401. checkPhy = ultraOptionSet1.CheckedItem.DataValue.ToString();
  1402. parmList.Add(startTim);
  1403. parmList.Add(endTim);
  1404. parmList.Add(checkNo);
  1405. parmList.Add(judgeNo);
  1406. parmList.Add(sampleNo);
  1407. parmList.Add(orderNo);
  1408. parmList.Add(steelName);
  1409. parmList.Add(specName);
  1410. parmList.Add(txtGroup);
  1411. parmList.Add(ispodutor);
  1412. parmList.Add(checkPhy);
  1413. PipeCheckconsignDetailEntitybindingSource3.Clear();
  1414. List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
  1415. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailFrim", new object[] { parmList, arrId, status.ToArray() }, this.ob);
  1416. pipeCheckconsignDetailEntityBindingSource6.DataSource = listSource;
  1417. foreach (UltraGridRow row in ultraGrid40.Rows)
  1418. {
  1419. if (int.Parse(row.Cells["Remark"].Text.ToString3()) > 0)
  1420. {
  1421. row.RowSelectorAppearance.BackColor = Color.GreenYellow; ;
  1422. }
  1423. }
  1424. }
  1425. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  1426. {
  1427. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  1428. List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
  1429. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPHY", new object[] { uRow.Cells["CheckNo"].Value.ToString(), uRow.Cells["SampleNo"].Value.ToString(), "2", arrId, ultraOptionSet1.CheckedItem.DataValue.ToString2()}, this.ob);
  1430. PipeCheckconsignDetailEntitybindingSource1.DataSource = listSource;
  1431. }
  1432. /// <summary>
  1433. /// 加载试验设备
  1434. /// </summary>
  1435. /// <param name="phyCode"></param>
  1436. private void initCheckEqiupment(string phyCodeMax)
  1437. {
  1438. DataTable dt = PublicServer.GetData("com.steering.lims.data.pipe.FrmDataCJBase.initCheckEquipment", new object[] { arrId, phyCodeMax }, ob);
  1439. if (dt != null && dt.Rows.Count > 0)
  1440. {
  1441. if (ultraTabControl1.SelectedTab.Key == "0")
  1442. {
  1443. ultraDEVICE_NAME.DataSource = dt;
  1444. ultraDEVICE_NAME.ValueMember = "DEVICE_NO";
  1445. }
  1446. else if (ultraTabControl1.SelectedTab.Key == "1")
  1447. {
  1448. ultraDEVICE_NAME1.DataSource = dt;
  1449. ultraDEVICE_NAME1.ValueMember = "DEVICE_NO";
  1450. }
  1451. }
  1452. this.cmbChemOrder.Value = UserInfo.GetUserOrder();
  1453. this.cmbChemGroup.Value = UserInfo.GetUserGroup();
  1454. this.txtChemUser.Text = UserInfo.GetUserName();
  1455. }
  1456. /// <summary>
  1457. /// 加载试验方法
  1458. /// </summary>
  1459. /// <param name="phyCode"></param>
  1460. private void initCheckMethod(string phyCode)
  1461. {
  1462. ultraComMethod.DataSource = null;
  1463. ultraComMethod1.DataSource = null;
  1464. DataTable dt = PublicServer.GetData("com.steering.lims.data.pipe.FrmDataCJBase.initCheckMethod", new object[] { phyCode }, ob);
  1465. if (dt != null && dt.Rows.Count > 0)
  1466. {
  1467. if (ultraTabControl1.SelectedTab.Key == "0")
  1468. {
  1469. ultraComMethod.DataSource = dt;
  1470. ultraComMethod.ValueMember = "CHECK_METHOD_NO";
  1471. }
  1472. else if (ultraTabControl1.SelectedTab.Key == "1")
  1473. {
  1474. ultraComMethod1.DataSource = dt;
  1475. ultraComMethod1.ValueMember = "CHECK_METHOD_NO";
  1476. }
  1477. }
  1478. }
  1479. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  1480. {
  1481. ultraTabControl2.Visible = true;
  1482. ultraTabControl3.Visible = false;
  1483. ultraTabControl4.Visible = false;
  1484. ultraTabControl5.Visible = false;
  1485. UltraGridRow row = this.ultraGrid2.ActiveRow;
  1486. initCheckMethod(row.Cells["PhyCodeMax"].Value.ToString());//根据试样组加载试验方法
  1487. initCheckEqiupment(row.Cells["PhyCodeMax"].Value.ToString());//根据试样组加载试验设备
  1488. List<PipeCheckconsignPhydetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignPhydetailEntity>(
  1489. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPhyItem", new object[] { row.Cells["CheckNo"].Value.ToString(), row.Cells["SampleNo"].Value.ToString(), row.Cells["PhyCodeMax"].Value.ToString() }, this.ob);
  1490. if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))//拉伸
  1491. {
  1492. PipeCheckconsignPhydetailEntitybindingSource.DataSource = listSource;
  1493. ultraTabControl2.Tabs["0"].Selected = true;
  1494. ultraTabControl2.Tabs["0"].Visible = true;
  1495. ultraTabControl2.Tabs["1"].Visible = false;
  1496. ultraTabControl2.Tabs["2"].Visible = false;
  1497. ultraTabControl2.Tabs["3"].Visible = false;
  1498. ultraTabControl2.Tabs["4"].Visible = false;
  1499. ultraTabControl2.Tabs["5"].Visible = false;
  1500. ultraTabControl2.Tabs["6"].Visible = false;
  1501. ultraTabControl2.Tabs["7"].Visible = false;
  1502. ultraTabControl2.Tabs["8"].Visible = false;
  1503. ultraTabControl2.Tabs["9"].Visible = false;
  1504. ultraTabControl2.Tabs["10"].Visible = false;
  1505. ultraTabControl2.Tabs["11"].Visible = false;
  1506. this.ultraLabel36.Visible = false;
  1507. this.ultraComFormual.Visible = false;
  1508. this.cmbStdSteelType.Visible = false;
  1509. this.txtStdSteelNo.Visible = false;
  1510. this.txtStdSteelValue.Visible = false;
  1511. this.txtActualValue.Visible = false;
  1512. ultraLabel46.Visible = false;
  1513. ultraLabel48.Visible = false;
  1514. ultraLabel47.Visible = false;
  1515. ultraLabel49.Visible = false;
  1516. }
  1517. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))//冲击
  1518. {
  1519. //if (listSource.Count<3)
  1520. //{
  1521. // listSource.Add(new PipeCheckconsignPhydetailEntity() { PhyName = "剪切面积百分比" });
  1522. // listSource.Add(new PipeCheckconsignPhydetailEntity() { PhyName = "ak" });
  1523. // listSource.Add(new PipeCheckconsignPhydetailEntity() { PhyName = "膨胀量" });
  1524. //}
  1525. PipeCheckconsignPhydetailEntityCjbindingSource.DataSource = listSource;
  1526. ultraTabControl2.Tabs["1"].Selected = true;
  1527. ultraTabControl2.Tabs["0"].Visible = false;
  1528. ultraTabControl2.Tabs["1"].Visible = true;
  1529. ultraTabControl2.Tabs["2"].Visible = false;
  1530. ultraTabControl2.Tabs["3"].Visible = false;
  1531. ultraTabControl2.Tabs["4"].Visible = false;
  1532. ultraTabControl2.Tabs["5"].Visible = false;
  1533. ultraTabControl2.Tabs["6"].Visible = false;
  1534. ultraTabControl2.Tabs["7"].Visible = false;
  1535. ultraTabControl2.Tabs["8"].Visible = false;
  1536. ultraTabControl2.Tabs["9"].Visible = false;
  1537. ultraTabControl2.Tabs["10"].Visible = false;
  1538. ultraTabControl2.Tabs["11"].Visible = false;
  1539. this.ultraLabel36.Visible = false;
  1540. this.ultraComFormual.Visible = false;
  1541. this.cmbStdSteelType.Visible = false;
  1542. this.txtStdSteelNo.Visible = false;
  1543. this.txtStdSteelValue.Visible = false;
  1544. this.txtActualValue.Visible = false;
  1545. ultraLabel46.Visible = false;
  1546. ultraLabel48.Visible = false;
  1547. ultraLabel47.Visible = false;
  1548. ultraLabel49.Visible = false;
  1549. }
  1550. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))//布氏
  1551. {
  1552. cmbStdSteelType.Items.Clear();
  1553. ultraComFormual.Items.Clear();
  1554. PipeCheckconsignPhydetailEntityBSbindingSource.DataSource = listSource;
  1555. MergedCell(ultraGrid6, new string[] { "PhyName" });
  1556. ultraTabControl2.Tabs["4"].Selected = true;
  1557. ultraTabControl2.Tabs["0"].Visible = false;
  1558. ultraTabControl2.Tabs["1"].Visible = false;
  1559. ultraTabControl2.Tabs["2"].Visible = false;
  1560. ultraTabControl2.Tabs["3"].Visible = false;
  1561. ultraTabControl2.Tabs["4"].Visible = true;
  1562. ultraTabControl2.Tabs["5"].Visible = false;
  1563. ultraTabControl2.Tabs["6"].Visible = false;
  1564. ultraTabControl2.Tabs["7"].Visible = false;
  1565. ultraTabControl2.Tabs["8"].Visible = false;
  1566. ultraTabControl2.Tabs["9"].Visible = false;
  1567. ultraTabControl2.Tabs["10"].Visible = false;
  1568. ultraTabControl2.Tabs["11"].Visible = false;
  1569. this.ultraLabel36.Visible = true;
  1570. this.ultraComFormual.Visible = true;
  1571. this.cmbStdSteelType.Visible = true;
  1572. this.txtStdSteelNo.Visible = true;
  1573. this.txtStdSteelValue.Visible = true;
  1574. this.txtActualValue.Visible = true;
  1575. ultraLabel46.Visible = true;
  1576. ultraLabel48.Visible = true;
  1577. ultraLabel47.Visible = true;
  1578. ultraLabel49.Visible = true;
  1579. ultraComFormual.Items.Add("HBW2.5");
  1580. ultraComFormual.Items.Add("HBW5");
  1581. ultraComFormual.Items.Add("HBW10");
  1582. cmbStdSteelType.Items.Add("HBW2.5/187.5");
  1583. cmbStdSteelType.Items.Add("HBW 5/750");
  1584. cmbStdSteelType.Items.Add("HBW 10/1000");
  1585. }
  1586. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))//洛氏
  1587. {
  1588. cmbStdSteelType.Items.Clear();
  1589. PipeCheckconsignPhydetailEntityLSbindingSource.DataSource = listSource;
  1590. MergedCell(ultraGrid5, new string[] { "PhyName" });
  1591. ultraTabControl2.Tabs["2"].Selected = true;
  1592. ultraTabControl2.Tabs["0"].Visible = false;
  1593. ultraTabControl2.Tabs["1"].Visible = false;
  1594. ultraTabControl2.Tabs["2"].Visible = true;
  1595. ultraTabControl2.Tabs["3"].Visible = false;
  1596. ultraTabControl2.Tabs["4"].Visible = false;
  1597. ultraTabControl2.Tabs["5"].Visible = false;
  1598. ultraTabControl2.Tabs["6"].Visible = false;
  1599. ultraTabControl2.Tabs["7"].Visible = false;
  1600. ultraTabControl2.Tabs["8"].Visible = false;
  1601. ultraTabControl2.Tabs["9"].Visible = false;
  1602. ultraTabControl2.Tabs["10"].Visible = false;
  1603. ultraTabControl2.Tabs["11"].Visible = false;
  1604. this.ultraLabel36.Visible = false;
  1605. this.ultraComFormual.Visible = false;
  1606. this.cmbStdSteelType.Visible = true;
  1607. this.txtStdSteelNo.Visible = true;
  1608. this.txtStdSteelValue.Visible = true;
  1609. this.txtActualValue.Visible = true;
  1610. ultraLabel46.Visible = true;
  1611. ultraLabel48.Visible = true;
  1612. ultraLabel47.Visible = true;
  1613. ultraLabel49.Visible = true;
  1614. cmbStdSteelType.Items.Add("HRA");
  1615. cmbStdSteelType.Items.Add("HRB");
  1616. cmbStdSteelType.Items.Add("HRC");
  1617. }
  1618. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))//维氏
  1619. {
  1620. ultraComFormual.Items.Clear();
  1621. cmbStdSteelType.Items.Clear();
  1622. PipeCheckconsignPhydetailEntityWSbindingSource.DataSource = listSource;
  1623. MergedCell(ultraGrid5, new string[] { "PhyName" });
  1624. ultraTabControl2.Tabs["3"].Selected = true;
  1625. ultraTabControl2.Tabs["0"].Visible = false;
  1626. ultraTabControl2.Tabs["1"].Visible = false;
  1627. ultraTabControl2.Tabs["2"].Visible = false;
  1628. ultraTabControl2.Tabs["3"].Visible = true;
  1629. ultraTabControl2.Tabs["4"].Visible = false;
  1630. ultraTabControl2.Tabs["5"].Visible = false;
  1631. ultraTabControl2.Tabs["6"].Visible = false;
  1632. ultraTabControl2.Tabs["7"].Visible = false;
  1633. ultraTabControl2.Tabs["8"].Visible = false;
  1634. ultraTabControl2.Tabs["9"].Visible = false;
  1635. ultraTabControl2.Tabs["10"].Visible = false;
  1636. ultraTabControl2.Tabs["11"].Visible = false;
  1637. this.ultraLabel36.Visible = true;
  1638. this.ultraComFormual.Visible = true;
  1639. this.cmbStdSteelType.Visible = true;
  1640. this.txtStdSteelNo.Visible = true;
  1641. this.txtStdSteelValue.Visible = true;
  1642. this.txtActualValue.Visible = true;
  1643. ultraLabel46.Visible = true;
  1644. ultraLabel48.Visible = true;
  1645. ultraLabel47.Visible = true;
  1646. ultraLabel49.Visible = true;
  1647. ultraComFormual.Items.Add("HV5");
  1648. ultraComFormual.Items.Add("HV10");
  1649. cmbStdSteelType.Items.Add("HV5");
  1650. cmbStdSteelType.Items.Add("HV10");
  1651. cmbStdSteelType.Items.Add("HV0.2");
  1652. }
  1653. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0016") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0031"))//组织
  1654. {
  1655. PipeCheckconsignPhydetailEntityZZbindingSource.DataSource = listSource;
  1656. ultraTabControl2.Tabs["7"].Selected = true;
  1657. ultraTabControl2.Tabs["0"].Visible = false;
  1658. ultraTabControl2.Tabs["1"].Visible = false;
  1659. ultraTabControl2.Tabs["2"].Visible = false;
  1660. ultraTabControl2.Tabs["3"].Visible = false;
  1661. ultraTabControl2.Tabs["4"].Visible = false;
  1662. ultraTabControl2.Tabs["5"].Visible = false;
  1663. ultraTabControl2.Tabs["6"].Visible = false;
  1664. ultraTabControl2.Tabs["7"].Visible = true;
  1665. ultraTabControl2.Tabs["8"].Visible = false;
  1666. ultraTabControl2.Tabs["9"].Visible = false;
  1667. ultraTabControl2.Tabs["10"].Visible = false;
  1668. ultraTabControl2.Tabs["11"].Visible = false;
  1669. this.ultraLabel36.Visible = false;
  1670. this.ultraComFormual.Visible = false;
  1671. this.cmbStdSteelType.Visible = false;
  1672. this.txtStdSteelNo.Visible = false;
  1673. this.txtStdSteelValue.Visible = false;
  1674. this.txtActualValue.Visible = false;
  1675. ultraLabel46.Visible = false;
  1676. ultraLabel48.Visible = false;
  1677. ultraLabel47.Visible = false;
  1678. ultraLabel49.Visible = false;
  1679. }
  1680. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))//晶粒度
  1681. {
  1682. PipeCheckconsignPhydetailEntityJLDbindingSource.DataSource = listSource;
  1683. ultraTabControl2.Tabs["6"].Selected = true;
  1684. ultraTabControl2.Tabs["0"].Visible = false;
  1685. ultraTabControl2.Tabs["1"].Visible = false;
  1686. ultraTabControl2.Tabs["2"].Visible = false;
  1687. ultraTabControl2.Tabs["3"].Visible = false;
  1688. ultraTabControl2.Tabs["4"].Visible = false;
  1689. ultraTabControl2.Tabs["5"].Visible = false;
  1690. ultraTabControl2.Tabs["6"].Visible = true;
  1691. ultraTabControl2.Tabs["7"].Visible = false;
  1692. ultraTabControl2.Tabs["8"].Visible = false;
  1693. ultraTabControl2.Tabs["9"].Visible = false;
  1694. ultraTabControl2.Tabs["10"].Visible = false;
  1695. ultraTabControl2.Tabs["11"].Visible = false;
  1696. this.ultraLabel36.Visible = false;
  1697. this.ultraComFormual.Visible = false;
  1698. this.cmbStdSteelType.Visible = false;
  1699. this.txtStdSteelNo.Visible = false;
  1700. this.txtStdSteelValue.Visible = false;
  1701. this.txtActualValue.Visible = false;
  1702. ultraLabel46.Visible = false;
  1703. ultraLabel48.Visible = false;
  1704. ultraLabel47.Visible = false;
  1705. ultraLabel49.Visible = false;
  1706. }
  1707. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))//夹杂
  1708. {
  1709. PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource = listSource;
  1710. ultraTabControl2.Tabs["5"].Selected = true;
  1711. ultraTabControl2.Tabs["0"].Visible = false;
  1712. ultraTabControl2.Tabs["1"].Visible = false;
  1713. ultraTabControl2.Tabs["2"].Visible = false;
  1714. ultraTabControl2.Tabs["3"].Visible = false;
  1715. ultraTabControl2.Tabs["4"].Visible = false;
  1716. ultraTabControl2.Tabs["5"].Visible = true;
  1717. ultraTabControl2.Tabs["6"].Visible = false;
  1718. ultraTabControl2.Tabs["7"].Visible = false;
  1719. ultraTabControl2.Tabs["8"].Visible = false;
  1720. ultraTabControl2.Tabs["9"].Visible = false;
  1721. ultraTabControl2.Tabs["10"].Visible = false;
  1722. ultraTabControl2.Tabs["11"].Visible = false;
  1723. this.ultraLabel36.Visible = false;
  1724. this.ultraComFormual.Visible = false;
  1725. this.cmbStdSteelType.Visible = false;
  1726. this.txtStdSteelNo.Visible = false;
  1727. this.txtStdSteelValue.Visible = false;
  1728. this.txtActualValue.Visible = false;
  1729. ultraLabel46.Visible = false;
  1730. ultraLabel48.Visible = false;
  1731. ultraLabel47.Visible = false;
  1732. ultraLabel49.Visible = false;
  1733. ultraGrid8.DisplayLayout.Bands[0].Columns["Value1"].Header.Caption = "一象限";
  1734. ultraGrid8.DisplayLayout.Bands[0].Columns["Value2"].Header.Caption = "二象限";
  1735. ultraGrid8.DisplayLayout.Bands[0].Columns["Value3"].Header.Caption = "三象限";
  1736. ultraGrid8.DisplayLayout.Bands[0].Columns["Value4"].Header.Caption = "四象限";
  1737. if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0115"))
  1738. {
  1739. ultraGrid8.DisplayLayout.Bands[0].Columns["Value2"].Hidden = false;
  1740. ultraGrid8.DisplayLayout.Bands[0].Columns["Value3"].Hidden = false;
  1741. ultraGrid8.DisplayLayout.Bands[0].Columns["Value4"].Hidden = false;
  1742. }
  1743. else
  1744. {
  1745. ultraGrid8.DisplayLayout.Bands[0].Columns["Value2"].Hidden = true;
  1746. ultraGrid8.DisplayLayout.Bands[0].Columns["Value3"].Hidden = true;
  1747. ultraGrid8.DisplayLayout.Bands[0].Columns["Value4"].Hidden = true;
  1748. }
  1749. }
  1750. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0010"))//工艺
  1751. {
  1752. if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0027") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0038") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0082") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0083") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0098"))//弯曲
  1753. {
  1754. PipeCheckconsignPhydetailEntityWQbindingSource.DataSource = listSource;
  1755. ultraTabControl2.Tabs["9"].Selected = true;
  1756. ultraTabControl2.Tabs["0"].Visible = false;
  1757. ultraTabControl2.Tabs["1"].Visible = false;
  1758. ultraTabControl2.Tabs["2"].Visible = false;
  1759. ultraTabControl2.Tabs["3"].Visible = false;
  1760. ultraTabControl2.Tabs["4"].Visible = false;
  1761. ultraTabControl2.Tabs["5"].Visible = false;
  1762. ultraTabControl2.Tabs["6"].Visible = false;
  1763. ultraTabControl2.Tabs["7"].Visible = false;
  1764. ultraTabControl2.Tabs["8"].Visible = false;
  1765. ultraTabControl2.Tabs["9"].Visible = true;
  1766. ultraTabControl2.Tabs["10"].Visible = false;
  1767. ultraTabControl2.Tabs["11"].Visible = false;
  1768. this.ultraLabel36.Visible = false;
  1769. this.ultraComFormual.Visible = false;
  1770. this.cmbStdSteelType.Visible = false;
  1771. this.txtStdSteelNo.Visible = false;
  1772. this.txtStdSteelValue.Visible = false;
  1773. this.txtActualValue.Visible = false;
  1774. ultraLabel46.Visible = false;
  1775. ultraLabel48.Visible = false;
  1776. ultraLabel47.Visible = false;
  1777. ultraLabel49.Visible = false;
  1778. }
  1779. else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0009"))//压扁
  1780. {
  1781. TxtYbEuestion.Text = "";
  1782. TxtYbD.Text = "";
  1783. TxtYbS.Text = "";
  1784. TxtYbC.Text = "";
  1785. TxtYbSpac.Text = "";
  1786. TxtYbQualfiled.Text = "";
  1787. TxtYbDefect.Text = "";
  1788. TxtYbMemo.Text = "";
  1789. PipeCheckconsignPhydetailEntityYBbindingSource.DataSource = listSource;
  1790. ultraTabControl2.Tabs["8"].Selected = true;
  1791. ultraTabControl2.Tabs["0"].Visible = false;
  1792. ultraTabControl2.Tabs["1"].Visible = false;
  1793. ultraTabControl2.Tabs["2"].Visible = false;
  1794. ultraTabControl2.Tabs["3"].Visible = false;
  1795. ultraTabControl2.Tabs["4"].Visible = false;
  1796. ultraTabControl2.Tabs["5"].Visible = false;
  1797. ultraTabControl2.Tabs["6"].Visible = false;
  1798. ultraTabControl2.Tabs["7"].Visible = false;
  1799. ultraTabControl2.Tabs["8"].Visible = true;
  1800. ultraTabControl2.Tabs["9"].Visible = false;
  1801. ultraTabControl2.Tabs["10"].Visible = false;
  1802. ultraTabControl2.Tabs["11"].Visible = false;
  1803. this.ultraLabel36.Visible = false;
  1804. this.ultraComFormual.Visible = false;
  1805. this.cmbStdSteelType.Visible = false;
  1806. this.txtStdSteelNo.Visible = false;
  1807. this.txtStdSteelValue.Visible = false;
  1808. this.txtActualValue.Visible = false;
  1809. ultraLabel46.Visible = false;
  1810. ultraLabel48.Visible = false;
  1811. ultraLabel47.Visible = false;
  1812. ultraLabel49.Visible = false;
  1813. int x = row.Cells["SpecName"].Text.IndexOf('x');
  1814. TxtYbD.Text = row.Cells["SpecName"].Text.Substring(0,x);
  1815. TxtYbS.Text = row.Cells["SpecName"].Text.Substring(x + 1);
  1816. ultraGrid13.DisplayLayout.Bands[0].Columns["IsGood"].Header.Caption = "试验结果(一次)";
  1817. ultraGrid13.DisplayLayout.Bands[0].Columns["IsDefect"].Header.Caption = "试验结果(二次)";
  1818. }
  1819. else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0026"))//扩口
  1820. {
  1821. PipeCheckconsignPhydetailEntityKKbindingSource.DataSource = listSource;
  1822. ultraTabControl2.Tabs["10"].Selected = true;
  1823. ultraTabControl2.Tabs["0"].Visible = false;
  1824. ultraTabControl2.Tabs["1"].Visible = false;
  1825. ultraTabControl2.Tabs["2"].Visible = false;
  1826. ultraTabControl2.Tabs["3"].Visible = false;
  1827. ultraTabControl2.Tabs["4"].Visible = false;
  1828. ultraTabControl2.Tabs["5"].Visible = false;
  1829. ultraTabControl2.Tabs["6"].Visible = false;
  1830. ultraTabControl2.Tabs["7"].Visible = false;
  1831. ultraTabControl2.Tabs["8"].Visible = false;
  1832. ultraTabControl2.Tabs["9"].Visible = false;
  1833. ultraTabControl2.Tabs["10"].Visible = true;
  1834. ultraTabControl2.Tabs["11"].Visible = false;
  1835. this.ultraLabel36.Visible = false;
  1836. this.ultraComFormual.Visible = false;
  1837. this.cmbStdSteelType.Visible = false;
  1838. this.txtStdSteelNo.Visible = false;
  1839. this.txtStdSteelValue.Visible = false;
  1840. this.txtActualValue.Visible = false;
  1841. ultraLabel46.Visible = false;
  1842. ultraLabel48.Visible = false;
  1843. ultraLabel47.Visible = false;
  1844. ultraLabel49.Visible = false;
  1845. }
  1846. }
  1847. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0050"))//断裂力学试验
  1848. {
  1849. pipeCheckconsignPhydetailEntityQTBindingSource.DataSource = listSource;
  1850. ultraTabControl2.Tabs["11"].Selected = true;
  1851. ultraTabControl2.Tabs["0"].Visible = false;
  1852. ultraTabControl2.Tabs["1"].Visible = false;
  1853. ultraTabControl2.Tabs["2"].Visible = false;
  1854. ultraTabControl2.Tabs["3"].Visible = false;
  1855. ultraTabControl2.Tabs["4"].Visible = false;
  1856. ultraTabControl2.Tabs["5"].Visible = false;
  1857. ultraTabControl2.Tabs["6"].Visible = false;
  1858. ultraTabControl2.Tabs["7"].Visible = false;
  1859. ultraTabControl2.Tabs["8"].Visible = false;
  1860. ultraTabControl2.Tabs["9"].Visible = false;
  1861. ultraTabControl2.Tabs["10"].Visible = false;
  1862. ultraTabControl2.Tabs["11"].Visible = true;
  1863. ultraGrid53.DisplayLayout.Bands[0].Columns["AverageValue"].Header.Caption = "最小值";
  1864. this.ultraLabel36.Visible = false;
  1865. this.ultraComFormual.Visible = false;
  1866. this.cmbStdSteelType.Visible = false;
  1867. this.txtStdSteelNo.Visible = false;
  1868. this.txtStdSteelValue.Visible = false;
  1869. this.txtActualValue.Visible = false;
  1870. ultraLabel46.Visible = false;
  1871. ultraLabel48.Visible = false;
  1872. ultraLabel47.Visible = false;
  1873. ultraLabel49.Visible = false;
  1874. }
  1875. }
  1876. /// <summary>
  1877. /// 合并单元格
  1878. /// </summary>
  1879. /// <param name="ug"></param>
  1880. /// <param name="columnKeys"></param>
  1881. private void MergedCell(UltraGrid ug, string[] columnKeys)
  1882. {
  1883. if (columnKeys.Length == 0)
  1884. {
  1885. return;
  1886. }
  1887. ug.DisplayLayout.Override.MergedCellStyle = MergedCellStyle.Never;
  1888. for (int i = 0; i < columnKeys.Length; i++)
  1889. {
  1890. ug.DisplayLayout.Bands[0].Columns[columnKeys[i]].MergedCellStyle = MergedCellStyle.Always;
  1891. }
  1892. }
  1893. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  1894. {
  1895. if (toolMenu == null) return;
  1896. if (ultraTabControl1.SelectedTab.Index == 0)
  1897. {
  1898. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  1899. {
  1900. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True;
  1901. }
  1902. if (toolMenu.Toolbars[0].Tools.Exists("Add"))
  1903. {
  1904. this.toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.True;
  1905. }
  1906. if (toolMenu.Toolbars[0].Tools.Exists("Update"))
  1907. {
  1908. toolMenu.Toolbars[0].Tools["Update"].InstanceProps.Visible = DefaultableBoolean.False;
  1909. }
  1910. if (toolMenu.Toolbars[0].Tools.Exists("Delete"))
  1911. {
  1912. toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.False;
  1913. }
  1914. if (toolMenu.Toolbars[0].Tools.Exists("Audit"))
  1915. {
  1916. toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.False;
  1917. }
  1918. if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit"))
  1919. {
  1920. toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  1921. }
  1922. if (toolMenu.Toolbars[0].Tools.Exists("SingleAudit"))
  1923. {
  1924. toolMenu.Toolbars[0].Tools["SingleAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  1925. }
  1926. if (toolMenu.Toolbars[0].Tools.Exists("CancelSingleAudit"))
  1927. {
  1928. toolMenu.Toolbars[0].Tools["CancelSingleAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  1929. }
  1930. if (toolMenu.Toolbars[0].Tools.Exists("PrintMechanics"))
  1931. {
  1932. toolMenu.Toolbars[0].Tools["PrintMechanics"].InstanceProps.Visible = DefaultableBoolean.False;
  1933. }
  1934. if (toolMenu.Toolbars[0].Tools.Exists("UpFile"))
  1935. {
  1936. toolMenu.Toolbars[0].Tools["UpFile"].InstanceProps.Visible = DefaultableBoolean.False;
  1937. }
  1938. if (toolMenu.Toolbars[0].Tools.Exists("UpPicture"))
  1939. {
  1940. toolMenu.Toolbars[0].Tools["UpPicture"].InstanceProps.Visible = DefaultableBoolean.False;
  1941. }
  1942. if (toolMenu.Toolbars[0].Tools.Exists("PrintPicture"))
  1943. {
  1944. toolMenu.Toolbars[0].Tools["PrintPicture"].InstanceProps.Visible = DefaultableBoolean.False;
  1945. }
  1946. ultraOptionSet1.Visible = true;
  1947. chkRegTime.Text = "收样日期";
  1948. this.chkPrintK.Visible = true;
  1949. this.cmbPrintK.Visible = true;
  1950. }
  1951. else if (ultraTabControl1.SelectedTab.Index == 1)
  1952. {
  1953. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  1954. {
  1955. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True;
  1956. }
  1957. if (toolMenu.Toolbars[0].Tools.Exists("Add"))
  1958. {
  1959. this.toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.False;
  1960. }
  1961. if (toolMenu.Toolbars[0].Tools.Exists("Update"))
  1962. {
  1963. toolMenu.Toolbars[0].Tools["Update"].InstanceProps.Visible = DefaultableBoolean.True;
  1964. }
  1965. if (toolMenu.Toolbars[0].Tools.Exists("Delete"))
  1966. {
  1967. toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.True;
  1968. }
  1969. if (toolMenu.Toolbars[0].Tools.Exists("Audit"))
  1970. {
  1971. toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.False;
  1972. }
  1973. if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit"))
  1974. {
  1975. toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  1976. }
  1977. if (toolMenu.Toolbars[0].Tools.Exists("SingleAudit"))
  1978. {
  1979. toolMenu.Toolbars[0].Tools["SingleAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  1980. }
  1981. if (toolMenu.Toolbars[0].Tools.Exists("CancelSingleAudit"))
  1982. {
  1983. toolMenu.Toolbars[0].Tools["CancelSingleAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  1984. }
  1985. if (toolMenu.Toolbars[0].Tools.Exists("PrintMechanics"))
  1986. {
  1987. toolMenu.Toolbars[0].Tools["PrintMechanics"].InstanceProps.Visible = DefaultableBoolean.False;
  1988. }
  1989. if (toolMenu.Toolbars[0].Tools.Exists("UpFile"))
  1990. {
  1991. toolMenu.Toolbars[0].Tools["UpFile"].InstanceProps.Visible = DefaultableBoolean.False;
  1992. }
  1993. if (toolMenu.Toolbars[0].Tools.Exists("UpPicture"))
  1994. {
  1995. toolMenu.Toolbars[0].Tools["UpPicture"].InstanceProps.Visible = DefaultableBoolean.False;
  1996. }
  1997. if (toolMenu.Toolbars[0].Tools.Exists("PrintPicture"))
  1998. {
  1999. toolMenu.Toolbars[0].Tools["PrintPicture"].InstanceProps.Visible = DefaultableBoolean.False;
  2000. }
  2001. ultraOptionSet1.Visible = true;
  2002. chkRegTime.Text = "收样日期";
  2003. this.chkPrintK.Visible = true;
  2004. this.cmbPrintK.Visible = true;
  2005. }
  2006. else if (ultraTabControl1.SelectedTab.Index == 2)
  2007. {
  2008. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  2009. {
  2010. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True;
  2011. }
  2012. if (toolMenu.Toolbars[0].Tools.Exists("Add"))
  2013. {
  2014. this.toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.False;
  2015. }
  2016. if (toolMenu.Toolbars[0].Tools.Exists("Update"))
  2017. {
  2018. toolMenu.Toolbars[0].Tools["Update"].InstanceProps.Visible = DefaultableBoolean.False;
  2019. }
  2020. if (toolMenu.Toolbars[0].Tools.Exists("Delete"))
  2021. {
  2022. toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.False;
  2023. }
  2024. if (toolMenu.Toolbars[0].Tools.Exists("Audit"))
  2025. {
  2026. toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.True;
  2027. }
  2028. if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit"))
  2029. {
  2030. toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  2031. }
  2032. if (toolMenu.Toolbars[0].Tools.Exists("SingleAudit"))
  2033. {
  2034. toolMenu.Toolbars[0].Tools["SingleAudit"].InstanceProps.Visible = DefaultableBoolean.True;
  2035. }
  2036. if (toolMenu.Toolbars[0].Tools.Exists("CancelSingleAudit"))
  2037. {
  2038. toolMenu.Toolbars[0].Tools["CancelSingleAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  2039. }
  2040. if (toolMenu.Toolbars[0].Tools.Exists("PrintMechanics"))
  2041. {
  2042. toolMenu.Toolbars[0].Tools["PrintMechanics"].InstanceProps.Visible = DefaultableBoolean.False;
  2043. }
  2044. if (toolMenu.Toolbars[0].Tools.Exists("UpFile"))
  2045. {
  2046. toolMenu.Toolbars[0].Tools["UpFile"].InstanceProps.Visible = DefaultableBoolean.False;
  2047. }
  2048. if (toolMenu.Toolbars[0].Tools.Exists("UpPicture"))
  2049. {
  2050. toolMenu.Toolbars[0].Tools["UpPicture"].InstanceProps.Visible = DefaultableBoolean.False;
  2051. }
  2052. if (toolMenu.Toolbars[0].Tools.Exists("PrintPicture"))
  2053. {
  2054. toolMenu.Toolbars[0].Tools["PrintPicture"].InstanceProps.Visible = DefaultableBoolean.False;
  2055. }
  2056. this.chkPrintK.Visible = false;
  2057. this.cmbPrintK.Visible = false;
  2058. //ultraOptionSet1.Visible = false;
  2059. chkRegTime.Text = "录入日期";
  2060. }
  2061. else if (ultraTabControl1.SelectedTab.Index == 3)
  2062. {
  2063. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  2064. {
  2065. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True;
  2066. }
  2067. if (toolMenu.Toolbars[0].Tools.Exists("Add"))
  2068. {
  2069. this.toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.False;
  2070. }
  2071. if (toolMenu.Toolbars[0].Tools.Exists("Update"))
  2072. {
  2073. toolMenu.Toolbars[0].Tools["Update"].InstanceProps.Visible = DefaultableBoolean.False;
  2074. }
  2075. if (toolMenu.Toolbars[0].Tools.Exists("Delete"))
  2076. {
  2077. toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.False;
  2078. }
  2079. if (toolMenu.Toolbars[0].Tools.Exists("Audit"))
  2080. {
  2081. toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.False;
  2082. }
  2083. if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit"))
  2084. {
  2085. toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.True;
  2086. }
  2087. if (toolMenu.Toolbars[0].Tools.Exists("SingleAudit"))
  2088. {
  2089. toolMenu.Toolbars[0].Tools["SingleAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  2090. }
  2091. if (toolMenu.Toolbars[0].Tools.Exists("CancelSingleAudit"))
  2092. {
  2093. toolMenu.Toolbars[0].Tools["CancelSingleAudit"].InstanceProps.Visible = DefaultableBoolean.True;
  2094. }
  2095. if (toolMenu.Toolbars[0].Tools.Exists("PrintMechanics"))
  2096. {
  2097. toolMenu.Toolbars[0].Tools["PrintMechanics"].InstanceProps.Visible = DefaultableBoolean.True;
  2098. }
  2099. if (toolMenu.Toolbars[0].Tools.Exists("UpFile"))
  2100. {
  2101. toolMenu.Toolbars[0].Tools["UpFile"].InstanceProps.Visible = DefaultableBoolean.True;
  2102. }
  2103. if (toolMenu.Toolbars[0].Tools.Exists("UpPicture"))
  2104. {
  2105. toolMenu.Toolbars[0].Tools["UpPicture"].InstanceProps.Visible = DefaultableBoolean.True;
  2106. }
  2107. if (toolMenu.Toolbars[0].Tools.Exists("PrintPicture"))
  2108. {
  2109. toolMenu.Toolbars[0].Tools["PrintPicture"].InstanceProps.Visible = DefaultableBoolean.True;
  2110. }
  2111. //ultraOptionSet1.Visible = false;
  2112. this.chkPrintK.Visible = true;
  2113. this.cmbPrintK.Visible = true;
  2114. chkRegTime.Text = "审核日期";
  2115. }
  2116. }
  2117. private void FrmLabMecDataCJAuditNew_Shown(object sender, EventArgs e)
  2118. {
  2119. if (toolMenu == null) return;
  2120. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  2121. {
  2122. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True;
  2123. }
  2124. if (toolMenu.Toolbars[0].Tools.Exists("Add"))
  2125. {
  2126. this.toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.True;
  2127. }
  2128. if (toolMenu.Toolbars[0].Tools.Exists("Update"))
  2129. {
  2130. toolMenu.Toolbars[0].Tools["Update"].InstanceProps.Visible = DefaultableBoolean.False;
  2131. }
  2132. if (toolMenu.Toolbars[0].Tools.Exists("Delete"))
  2133. {
  2134. toolMenu.Toolbars[0].Tools["Delete"].InstanceProps.Visible = DefaultableBoolean.False;
  2135. }
  2136. if (toolMenu.Toolbars[0].Tools.Exists("Audit"))
  2137. {
  2138. toolMenu.Toolbars[0].Tools["Audit"].InstanceProps.Visible = DefaultableBoolean.False;
  2139. }
  2140. if (toolMenu.Toolbars[0].Tools.Exists("CancelAudit"))
  2141. {
  2142. toolMenu.Toolbars[0].Tools["CancelAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  2143. }
  2144. if (toolMenu.Toolbars[0].Tools.Exists("SingleAudit"))
  2145. {
  2146. toolMenu.Toolbars[0].Tools["SingleAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  2147. }
  2148. if (toolMenu.Toolbars[0].Tools.Exists("CancelSingleAudit"))
  2149. {
  2150. toolMenu.Toolbars[0].Tools["CancelSingleAudit"].InstanceProps.Visible = DefaultableBoolean.False;
  2151. }
  2152. if (toolMenu.Toolbars[0].Tools.Exists("PrintMechanics"))
  2153. {
  2154. toolMenu.Toolbars[0].Tools["PrintMechanics"].InstanceProps.Visible = DefaultableBoolean.False;
  2155. }
  2156. if (toolMenu.Toolbars[0].Tools.Exists("UpFile"))
  2157. {
  2158. toolMenu.Toolbars[0].Tools["UpFile"].InstanceProps.Visible = DefaultableBoolean.False;
  2159. }
  2160. if (toolMenu.Toolbars[0].Tools.Exists("UpPicture"))
  2161. {
  2162. toolMenu.Toolbars[0].Tools["UpPicture"].InstanceProps.Visible = DefaultableBoolean.False;
  2163. }
  2164. if (toolMenu.Toolbars[0].Tools.Exists("PrintPicture"))
  2165. {
  2166. toolMenu.Toolbars[0].Tools["PrintPicture"].InstanceProps.Visible = DefaultableBoolean.False;
  2167. }
  2168. this.chkPrintK.Visible = true;
  2169. this.cmbPrintK.Visible = true;
  2170. }
  2171. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  2172. {
  2173. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  2174. if (uRow.Cells["CraftFileNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "")
  2175. {
  2176. return;
  2177. }
  2178. PublicPipeAndOutdec.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim());
  2179. }
  2180. private void ultraTextEditor3_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  2181. {
  2182. UltraGridRow uRow = this.ultraGrid15.ActiveRow;
  2183. if (uRow.Cells["CraftFileNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "")
  2184. {
  2185. return;
  2186. }
  2187. PublicPipeAndOutdec.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim());
  2188. }
  2189. private void ultraTextEditor4_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  2190. {
  2191. UltraGridRow uRow = this.ultraGrid28.ActiveRow;
  2192. if (uRow.Cells["CraftFileNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "")
  2193. {
  2194. return;
  2195. }
  2196. PublicPipeAndOutdec.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim());
  2197. }
  2198. private void ultraTextEditor5_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  2199. {
  2200. UltraGridRow uRow = this.ultraGrid41.ActiveRow;
  2201. if (uRow.Cells["CraftFileNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "")
  2202. {
  2203. return;
  2204. }
  2205. PublicPipeAndOutdec.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim());
  2206. }
  2207. private void ultraGrid4_CellChange(object sender, CellEventArgs e)
  2208. {
  2209. this.ultraGrid4.UpdateData();
  2210. UltraGridRow ur = this.ultraGrid4.ActiveRow;
  2211. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  2212. string specName = uRow.Cells["ItemNameS"].Text.Trim();//试验尺寸
  2213. int x = specName.IndexOf("×");//x位置
  2214. string width = specName.Substring(0, x).Replace("m","");
  2215. string height = specName.Substring(x + 1).Replace("m","");
  2216. int m = 0;
  2217. string ak1 = "";//真实值
  2218. string ak2 = "";
  2219. string ak3 = "";
  2220. int akNum = 0;
  2221. foreach(UltraGridRow row in this.ultraGrid4.Rows)
  2222. {
  2223. if (row.Cells["PhyName"].Text.Contains("ak"))
  2224. {
  2225. akNum = akNum + 1;
  2226. }
  2227. }
  2228. if (akNum > 0 && ur.Cells["PhyName"].Text.Contains("冲击功"))
  2229. {
  2230. if (e.Cell.Column.Key == "Value1")
  2231. {
  2232. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3())) return;
  2233. ak1 = (Math.Round(100 * double.Parse(ur.Cells["Value1"].Text.Trim().ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString();
  2234. foreach (UltraGridRow akRow in this.ultraGrid4.Rows)
  2235. {
  2236. if (akRow.Cells["PhyName"].Text.Contains("ak"))
  2237. {
  2238. akRow.Cells["Value1"].Value = ak1;
  2239. if (akRow.Cells["Value2"].Text != "")
  2240. {
  2241. m = m + 1;
  2242. }
  2243. if (akRow.Cells["Value3"].Text != "")
  2244. {
  2245. m = m + 1;
  2246. }
  2247. m = m + 1;
  2248. akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().ToString3()) + double.Parse(akRow.Cells["Value2"].Text.ToString3()) + double.Parse(akRow.Cells["Value3"].Text.ToString3())) / m)).ToString();
  2249. }
  2250. }
  2251. }
  2252. if (e.Cell.Column.Key == "Value2")
  2253. {
  2254. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3())) return;
  2255. ak2 = (Math.Round(100 * double.Parse(ur.Cells["Value2"].Text.Trim().ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString();
  2256. foreach (UltraGridRow akRow in this.ultraGrid4.Rows)
  2257. {
  2258. if (akRow.Cells["PhyName"].Text.Contains("ak"))
  2259. {
  2260. akRow.Cells["Value2"].Value = ak2;
  2261. if (ur.Cells["Value1"].Text != "")
  2262. {
  2263. m = m + 1;
  2264. }
  2265. if (ur.Cells["Value3"].Text != "")
  2266. {
  2267. m = m + 1;
  2268. }
  2269. m = m + 1;
  2270. akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().ToString3()) + double.Parse(akRow.Cells["Value2"].Text.ToString3()) + double.Parse(akRow.Cells["Value3"].Text.ToString3())) / m)).ToString();
  2271. }
  2272. }
  2273. }
  2274. if (e.Cell.Column.Key == "Value3")
  2275. {
  2276. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3())) return;
  2277. ak3 = (Math.Round(100 * double.Parse(ur.Cells["Value3"].Text.Trim().ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString();
  2278. foreach (UltraGridRow akRow in this.ultraGrid4.Rows)
  2279. {
  2280. if (akRow.Cells["PhyName"].Text.Contains("ak"))
  2281. {
  2282. akRow.Cells["Value3"].Value = ak3;
  2283. if (akRow.Cells["Value1"].Text != "")
  2284. {
  2285. m = m + 1;
  2286. }
  2287. if (akRow.Cells["Value2"].Text != "")
  2288. {
  2289. m = m + 1;
  2290. }
  2291. m = m + 1;
  2292. akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().ToString3()) + double.Parse(akRow.Cells["Value2"].Text.ToString3()) + double.Parse(akRow.Cells["Value3"].Text.ToString3())) / m)).ToString();
  2293. }
  2294. }
  2295. }
  2296. }
  2297. else
  2298. {
  2299. if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3")
  2300. {
  2301. if (ur.Cells["Value1"].Text != "")
  2302. {
  2303. m = m + 1;
  2304. }
  2305. if (ur.Cells["Value2"].Text != "")
  2306. {
  2307. m = m + 1;
  2308. }
  2309. if (ur.Cells["Value3"].Text != "")
  2310. {
  2311. m = m + 1;
  2312. }
  2313. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Trim().ToString3()) + double.Parse(ur.Cells["Value2"].Text.Trim().ToString3()) + double.Parse(ur.Cells["Value3"].Text.Trim().ToString3())) / m),2).ToString();
  2314. }
  2315. }
  2316. }
  2317. private void ultraGrid5_CellChange(object sender, CellEventArgs e)
  2318. {
  2319. this.ultraGrid5.UpdateData();
  2320. UltraGridRow ur = this.ultraGrid5.ActiveRow;
  2321. int m = 0;
  2322. if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3" || e.Cell.Column.Key == "Value4")
  2323. {
  2324. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value4"].Value.ToString3()))
  2325. {
  2326. return;
  2327. }
  2328. if (ur.Cells["Value1"].Text != "")
  2329. {
  2330. m = m + 1;
  2331. }
  2332. if (ur.Cells["Value2"].Text != "")
  2333. {
  2334. m = m + 1;
  2335. }
  2336. if (ur.Cells["Value3"].Text != "")
  2337. {
  2338. m = m + 1;
  2339. }
  2340. if (ur.Cells["Value4"].Text != "")
  2341. {
  2342. m = m + 1;
  2343. }
  2344. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 1).ToString();
  2345. }
  2346. }
  2347. private void ultraGrid7_CellChange(object sender, CellEventArgs e)
  2348. {
  2349. this.ultraGrid7.UpdateData();
  2350. UltraGridRow ur = this.ultraGrid7.ActiveRow;
  2351. int m = 0;
  2352. string comFormual = this.ultraComFormual.Text.Trim();
  2353. if (e.Cell.Column.Key == "Value1D1" || e.Cell.Column.Key == "Value1D2")
  2354. {
  2355. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value1D2"].Value.ToString3()))
  2356. {
  2357. return;
  2358. }
  2359. if (comFormual.Equals("HV5"))
  2360. {
  2361. ur.Cells["Value1"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()))/2,2),0);
  2362. }
  2363. else if (comFormual.Equals("HV10"))
  2364. {
  2365. ur.Cells["Value1"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3())) / 2, 2), 0);
  2366. }
  2367. else
  2368. {
  2369. MessageUtil.ShowTips("公式选择错误!");
  2370. return;
  2371. }
  2372. if (ur.Cells["Value1"].Text != "")
  2373. {
  2374. m = m + 1;
  2375. }
  2376. if (ur.Cells["Value2"].Text != "")
  2377. {
  2378. m = m + 1;
  2379. }
  2380. if (ur.Cells["Value3"].Text != "")
  2381. {
  2382. m = m + 1;
  2383. }
  2384. if (ur.Cells["Value4"].Text != "")
  2385. {
  2386. m = m + 1;
  2387. }
  2388. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString();
  2389. }
  2390. if (e.Cell.Column.Key == "Value2D1" || e.Cell.Column.Key == "Value2D2")
  2391. {
  2392. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value2D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2D2"].Value.ToString3()))
  2393. {
  2394. return;
  2395. }
  2396. if (comFormual.Equals("HV5"))
  2397. {
  2398. ur.Cells["Value2"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3())) / 2, 2), 0);
  2399. }
  2400. else if (comFormual.Equals("HV10"))
  2401. {
  2402. ur.Cells["Value2"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3())) / 2, 2), 0);
  2403. }
  2404. else
  2405. {
  2406. MessageUtil.ShowTips("公式选择错误!");
  2407. return;
  2408. }
  2409. if (ur.Cells["Value1"].Text != "")
  2410. {
  2411. m = m + 1;
  2412. }
  2413. if (ur.Cells["Value2"].Text != "")
  2414. {
  2415. m = m + 1;
  2416. }
  2417. if (ur.Cells["Value3"].Text != "")
  2418. {
  2419. m = m + 1;
  2420. }
  2421. if (ur.Cells["Value4"].Text != "")
  2422. {
  2423. m = m + 1;
  2424. }
  2425. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString();
  2426. }
  2427. if (e.Cell.Column.Key == "Value3D1" || e.Cell.Column.Key == "Value3D2")
  2428. {
  2429. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value3D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3D2"].Value.ToString3()))
  2430. {
  2431. return;
  2432. }
  2433. if (comFormual.Equals("HV5"))
  2434. {
  2435. ur.Cells["Value3"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0);
  2436. }
  2437. else if (comFormual.Equals("HV10"))
  2438. {
  2439. ur.Cells["Value3"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0);
  2440. }
  2441. else
  2442. {
  2443. MessageUtil.ShowTips("公式选择错误!");
  2444. return;
  2445. }
  2446. if (ur.Cells["Value1"].Text != "")
  2447. {
  2448. m = m + 1;
  2449. }
  2450. if (ur.Cells["Value2"].Text != "")
  2451. {
  2452. m = m + 1;
  2453. }
  2454. if (ur.Cells["Value3"].Text != "")
  2455. {
  2456. m = m + 1;
  2457. }
  2458. if (ur.Cells["Value4"].Text != "")
  2459. {
  2460. m = m + 1;
  2461. }
  2462. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString();
  2463. }
  2464. if (e.Cell.Column.Key == "Value4D1" || e.Cell.Column.Key == "Value4D2")
  2465. {
  2466. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value4D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value4D2"].Value.ToString3()))
  2467. {
  2468. return;
  2469. }
  2470. if (comFormual.Equals("HV5"))
  2471. {
  2472. ur.Cells["Value4"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0);
  2473. }
  2474. else if (comFormual.Equals("HV10"))
  2475. {
  2476. ur.Cells["Value4"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0);
  2477. }
  2478. else
  2479. {
  2480. MessageUtil.ShowTips("公式选择错误!");
  2481. return;
  2482. }
  2483. if (ur.Cells["Value1"].Text != "")
  2484. {
  2485. m = m + 1;
  2486. }
  2487. if (ur.Cells["Value2"].Text != "")
  2488. {
  2489. m = m + 1;
  2490. }
  2491. if (ur.Cells["Value3"].Text != "")
  2492. {
  2493. m = m + 1;
  2494. }
  2495. if (ur.Cells["Value4"].Text != "")
  2496. {
  2497. m = m + 1;
  2498. }
  2499. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString();
  2500. }
  2501. if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3" || e.Cell.Column.Key == "Value4")
  2502. {
  2503. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value4"].Value.ToString3()))
  2504. {
  2505. return;
  2506. }
  2507. if (ur.Cells["Value1"].Text != "")
  2508. {
  2509. m = m + 1;
  2510. }
  2511. if (ur.Cells["Value2"].Text != "")
  2512. {
  2513. m = m + 1;
  2514. }
  2515. if (ur.Cells["Value3"].Text != "")
  2516. {
  2517. m = m + 1;
  2518. }
  2519. if (ur.Cells["Value4"].Text != "")
  2520. {
  2521. m = m + 1;
  2522. }
  2523. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString();
  2524. }
  2525. }
  2526. private void ultraGrid6_CellChange(object sender, CellEventArgs e)
  2527. {
  2528. this.ultraGrid6.UpdateData();
  2529. UltraGridRow ur = this.ultraGrid6.ActiveRow;
  2530. int m = 0;
  2531. string comFormual = this.ultraComFormual.Text.Trim();
  2532. if (e.Cell.Column.Key == "Value1D1" || e.Cell.Column.Key == "Value1D2")
  2533. {
  2534. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value1D2"].Value.ToString3()))
  2535. {
  2536. return;
  2537. }
  2538. if (comFormual.Equals("HBW2.5"))
  2539. {
  2540. ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2541. }
  2542. else if (comFormual.Equals("HBW5"))
  2543. {
  2544. ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2545. }
  2546. else if (comFormual.Equals("HBW10"))
  2547. {
  2548. ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2549. }
  2550. else
  2551. {
  2552. MessageUtil.ShowTips("公式选择错误!");
  2553. return;
  2554. }
  2555. if (ur.Cells["Value1"].Text != "")
  2556. {
  2557. m = m + 1;
  2558. }
  2559. if (ur.Cells["Value2"].Text != "")
  2560. {
  2561. m = m + 1;
  2562. }
  2563. if (ur.Cells["Value3"].Text != "")
  2564. {
  2565. m = m + 1;
  2566. }
  2567. if (ur.Cells["Value4"].Text != "")
  2568. {
  2569. m = m + 1;
  2570. }
  2571. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString();
  2572. }
  2573. if (e.Cell.Column.Key == "Value2D1" || e.Cell.Column.Key == "Value2D2")
  2574. {
  2575. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value2D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2D2"].Value.ToString3()))
  2576. {
  2577. return;
  2578. }
  2579. if (comFormual.Equals("HBW2.5"))
  2580. {
  2581. ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2582. }
  2583. else if (comFormual.Equals("HBW5"))
  2584. {
  2585. ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2586. }
  2587. else if (comFormual.Equals("HBW10"))
  2588. {
  2589. ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2590. }
  2591. else
  2592. {
  2593. MessageUtil.ShowTips("公式选择错误!");
  2594. return;
  2595. }
  2596. if (ur.Cells["Value1"].Text != "")
  2597. {
  2598. m = m + 1;
  2599. }
  2600. if (ur.Cells["Value2"].Text != "")
  2601. {
  2602. m = m + 1;
  2603. }
  2604. if (ur.Cells["Value3"].Text != "")
  2605. {
  2606. m = m + 1;
  2607. }
  2608. if (ur.Cells["Value4"].Text != "")
  2609. {
  2610. m = m + 1;
  2611. }
  2612. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString();
  2613. }
  2614. if (e.Cell.Column.Key == "Value3D1" || e.Cell.Column.Key == "Value3D2")
  2615. {
  2616. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value3D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3D2"].Value.ToString3()))
  2617. {
  2618. return;
  2619. }
  2620. if (comFormual.Equals("HBW2.5"))
  2621. {
  2622. ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2623. }
  2624. else if (comFormual.Equals("HBW5"))
  2625. {
  2626. ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2627. }
  2628. else if (comFormual.Equals("HBW10"))
  2629. {
  2630. ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2631. }
  2632. else
  2633. {
  2634. MessageUtil.ShowTips("公式选择错误!");
  2635. return;
  2636. }
  2637. if (ur.Cells["Value1"].Text != "")
  2638. {
  2639. m = m + 1;
  2640. }
  2641. if (ur.Cells["Value2"].Text != "")
  2642. {
  2643. m = m + 1;
  2644. }
  2645. if (ur.Cells["Value3"].Text != "")
  2646. {
  2647. m = m + 1;
  2648. }
  2649. if(ur.Cells["Value4"].Text != "")
  2650. {
  2651. m = m + 1;
  2652. }
  2653. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString();
  2654. }
  2655. if (e.Cell.Column.Key == "Value4D1" || e.Cell.Column.Key == "Value4D2")
  2656. {
  2657. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value4D1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value4D2"].Value.ToString3()))
  2658. {
  2659. return;
  2660. }
  2661. if (comFormual.Equals("HBW2.5"))
  2662. {
  2663. ur.Cells["Value4"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value4D1"].Text.ToString3()) + double.Parse(ur.Cells["Value4D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2664. }
  2665. else if (comFormual.Equals("HBW5"))
  2666. {
  2667. ur.Cells["Value4"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value4D1"].Text.ToString3()) + double.Parse(ur.Cells["Value4D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2668. }
  2669. else if (comFormual.Equals("HBW10"))
  2670. {
  2671. ur.Cells["Value4"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value4D1"].Text.ToString3()) + double.Parse(ur.Cells["Value4D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  2672. }
  2673. else
  2674. {
  2675. MessageUtil.ShowTips("公式选择错误!");
  2676. return;
  2677. }
  2678. if (ur.Cells["Value1"].Text != "")
  2679. {
  2680. m = m + 1;
  2681. }
  2682. if (ur.Cells["Value2"].Text != "")
  2683. {
  2684. m = m + 1;
  2685. }
  2686. if (ur.Cells["Value3"].Text != "")
  2687. {
  2688. m = m + 1;
  2689. }
  2690. if (ur.Cells["Value4"].Text != "")
  2691. {
  2692. m = m + 1;
  2693. }
  2694. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString();
  2695. }
  2696. if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3" || e.Cell.Column.Key == "Value4")
  2697. {
  2698. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value4"].Value.ToString3()))
  2699. {
  2700. return;
  2701. }
  2702. if (ur.Cells["Value1"].Text != "")
  2703. {
  2704. m = m + 1;
  2705. }
  2706. if (ur.Cells["Value2"].Text != "")
  2707. {
  2708. m = m + 1;
  2709. }
  2710. if (ur.Cells["Value3"].Text != "")
  2711. {
  2712. m = m + 1;
  2713. }
  2714. if (ur.Cells["Value4"].Text != "")
  2715. {
  2716. m = m + 1;
  2717. }
  2718. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.ToString3()) + double.Parse(ur.Cells["Value2"].Text.ToString3()) + double.Parse(ur.Cells["Value3"].Text.ToString3()) + double.Parse(ur.Cells["Value4"].Text.ToString3())) / m), 0).ToString();
  2719. }
  2720. }
  2721. private void ultraButton1_Click(object sender, EventArgs e)
  2722. {
  2723. if (this.TxtYbEuestion.Text.Trim() == "")
  2724. {
  2725. MessageUtil.ShowTips("请选择计算公式!");
  2726. return;
  2727. }
  2728. double d = 0.0;
  2729. double c = 0.0;
  2730. double t = 0.0;
  2731. if(this.TxtYbEuestion.Text.Trim() == "0.65*D" || this.TxtYbEuestion.Text.Trim() == "7*D/8" ||this.TxtYbEuestion.Text.Trim() == "2*D/3")
  2732. {
  2733. if(this.TxtYbD.Text.Trim() == "")
  2734. {
  2735. MessageUtil.ShowTips("请输入管子公称外径!");
  2736. return;
  2737. }
  2738. }else if(this.TxtYbEuestion.Text.Trim() == "(1+C)*T/(C+T/D)")
  2739. {
  2740. if(this.TxtYbD.Text.Trim() == "" || this.TxtYbC.Text.Trim() == "" || this.TxtYbS.Text.Trim() == "")
  2741. {
  2742. MessageUtil.ShowTips("请输入管子的公称外径壁厚以及压扁系数!");
  2743. return;
  2744. }
  2745. }
  2746. d = double.Parse(this.TxtYbD.Text.Trim().ToString3());
  2747. t = double.Parse(this.TxtYbS.Text.Trim().ToString3());
  2748. c = double.Parse(this.TxtYbC.Text.Trim().ToString3());
  2749. if (this.TxtYbEuestion.Text.Trim() == "0.65*D")
  2750. {
  2751. this.TxtYbSpac.Text = Math.Ceiling((0.65 * d)).ToString();
  2752. }
  2753. else if (this.TxtYbEuestion.Text.Trim() == "7*D/8")
  2754. {
  2755. this.TxtYbSpac.Text = Math.Ceiling(((7 * d) / 8)).ToString();
  2756. }
  2757. else if (this.TxtYbEuestion.Text.Trim() == "2*D/3")
  2758. {
  2759. this.TxtYbSpac.Text = Math.Ceiling(((2 * d) / 3)).ToString();
  2760. }
  2761. else if (this.TxtYbEuestion.Text.Trim() == "(1+C)*T/(C+T/D)")
  2762. {
  2763. this.TxtYbSpac.Text = Math.Floor((((1 + c) * t) / (c + t / d))).ToString();
  2764. }
  2765. }
  2766. /**
  2767. * 验证字符串 如:1<2
  2768. *
  2769. * @param strA
  2770. * 数字字符串
  2771. * @param sign
  2772. * 符号
  2773. * @param strB
  2774. * 数字字符串
  2775. * @return true Or false
  2776. */
  2777. private bool checkStr(string strA, string sign, string strB)
  2778. {
  2779. if (strA.Length == 0 || strB.Length == 0)
  2780. {
  2781. return true;
  2782. }
  2783. if (!StringUtil.IsDouble(strB) || !StringUtil.IsDouble(strA))
  2784. {
  2785. return true;
  2786. }
  2787. double a = double.Parse(strA);
  2788. double b = double.Parse(strB);
  2789. if (sign.Equals("="))
  2790. {
  2791. if (a == b)
  2792. {
  2793. return true;
  2794. }
  2795. else
  2796. {
  2797. return false;
  2798. }
  2799. }
  2800. if (sign.Equals(">"))
  2801. {
  2802. if (a > b)
  2803. {
  2804. return true;
  2805. }
  2806. else
  2807. {
  2808. return false;
  2809. }
  2810. }
  2811. if (sign.Equals(">="))
  2812. {
  2813. if (a >= b)
  2814. {
  2815. return true;
  2816. }
  2817. else
  2818. {
  2819. return false;
  2820. }
  2821. }
  2822. if (sign.Equals("<"))
  2823. {
  2824. if (a < b)
  2825. {
  2826. return true;
  2827. }
  2828. else
  2829. {
  2830. return false;
  2831. }
  2832. }
  2833. if (sign.Equals("<="))
  2834. {
  2835. if (a <= b)
  2836. {
  2837. return true;
  2838. }
  2839. else
  2840. {
  2841. return false;
  2842. }
  2843. }
  2844. return false;
  2845. }
  2846. private void ultraGrid15_AfterRowActivate(object sender, EventArgs e)
  2847. {
  2848. ultraTabControl3.Visible = true;
  2849. ultraTabControl4.Visible = false;
  2850. ultraTabControl5.Visible = false;
  2851. ultraTabControl2.Visible = false;
  2852. UltraGridRow row = this.ultraGrid15.ActiveRow;
  2853. if (row == null) return;
  2854. initCheckMethod(row.Cells["PhyCodeMax"].Value.ToString());//根据试样组加载试验方法
  2855. initCheckEqiupment(row.Cells["PhyCodeMax"].Value.ToString());//根据试样组加载试验设备
  2856. List<PipeCheckconsignPhydetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignPhydetailEntity>(
  2857. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPhyItem", new object[] { row.Cells["CheckNo"].Value.ToString(), row.Cells["SampleNo"].Value.ToString(), row.Cells["PhyCodeMax"].Value.ToString() }, this.ob);
  2858. if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))//拉伸
  2859. {
  2860. PipeCheckconsignPhydetailEntitybindingSource.DataSource = listSource;
  2861. foreach (UltraGridRow forRow in ultraGrid16.Rows)
  2862. {
  2863. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  2864. {
  2865. forRow.RowSelectorAppearance.BackColor = Color.Red;
  2866. }
  2867. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  2868. {
  2869. forRow.RowSelectorAppearance.BackColor = Color.Red;
  2870. }
  2871. }
  2872. ultraTabControl3.Tabs["0"].Selected = true;
  2873. ultraTabControl3.Tabs["0"].Visible = true;
  2874. ultraTabControl3.Tabs["1"].Visible = false;
  2875. ultraTabControl3.Tabs["2"].Visible = false;
  2876. ultraTabControl3.Tabs["3"].Visible = false;
  2877. ultraTabControl3.Tabs["4"].Visible = false;
  2878. ultraTabControl3.Tabs["5"].Visible = false;
  2879. ultraTabControl3.Tabs["6"].Visible = false;
  2880. ultraTabControl3.Tabs["7"].Visible = false;
  2881. ultraTabControl3.Tabs["8"].Visible = false;
  2882. ultraTabControl3.Tabs["9"].Visible = false;
  2883. ultraTabControl3.Tabs["10"].Visible = false;
  2884. ultraTabControl3.Tabs["11"].Visible = false;
  2885. this.ultraComFormual1.Visible = false;
  2886. this.cmbStdSteelType1.Visible = false;
  2887. this.txtStdSteelNo1.Visible = false;
  2888. this.txtStdSteelValue1.Visible = false;
  2889. this.txtActualValue1.Visible = false;
  2890. ultraLabel59.Visible = false;
  2891. ultraLabel53.Visible = false;
  2892. ultraLabel52.Visible = false;
  2893. ultraLabel51.Visible = false;
  2894. ultraLabel50.Visible = false;
  2895. }
  2896. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))//冲击
  2897. {
  2898. PipeCheckconsignPhydetailEntityCjbindingSource.DataSource = listSource;
  2899. foreach (UltraGridRow forRow in ultraGrid17.Rows)
  2900. {
  2901. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  2902. {
  2903. forRow.RowSelectorAppearance.BackColor = Color.Red;
  2904. }
  2905. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  2906. {
  2907. forRow.RowSelectorAppearance.BackColor = Color.Red;
  2908. }
  2909. }
  2910. ultraTabControl3.Tabs["1"].Selected = true;
  2911. ultraTabControl3.Tabs["0"].Visible = false;
  2912. ultraTabControl3.Tabs["1"].Visible = true;
  2913. ultraTabControl3.Tabs["2"].Visible = false;
  2914. ultraTabControl3.Tabs["3"].Visible = false;
  2915. ultraTabControl3.Tabs["4"].Visible = false;
  2916. ultraTabControl3.Tabs["5"].Visible = false;
  2917. ultraTabControl3.Tabs["6"].Visible = false;
  2918. ultraTabControl3.Tabs["7"].Visible = false;
  2919. ultraTabControl3.Tabs["8"].Visible = false;
  2920. ultraTabControl3.Tabs["9"].Visible = false;
  2921. ultraTabControl3.Tabs["10"].Visible = false;
  2922. ultraTabControl3.Tabs["11"].Visible = false;
  2923. this.ultraComFormual1.Visible = false;
  2924. this.cmbStdSteelType1.Visible = false;
  2925. this.txtStdSteelNo1.Visible = false;
  2926. this.txtStdSteelValue1.Visible = false;
  2927. this.txtActualValue1.Visible = false;
  2928. ultraLabel59.Visible = false;
  2929. ultraLabel53.Visible = false;
  2930. ultraLabel52.Visible = false;
  2931. ultraLabel51.Visible = false;
  2932. ultraLabel50.Visible = false;
  2933. }
  2934. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))//布氏
  2935. {
  2936. ultraComFormual1.Items.Clear();
  2937. cmbStdSteelType1.Items.Clear();
  2938. PipeCheckconsignPhydetailEntityBSbindingSource.DataSource = listSource;
  2939. MergedCell(ultraGrid6, new string[] { "PhyName" });
  2940. foreach (UltraGridRow forRow in ultraGrid20.Rows)
  2941. {
  2942. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  2943. {
  2944. forRow.RowSelectorAppearance.BackColor = Color.Red;
  2945. }
  2946. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  2947. {
  2948. forRow.RowSelectorAppearance.BackColor = Color.Red;
  2949. }
  2950. }
  2951. ultraTabControl3.Tabs["4"].Selected = true;
  2952. ultraTabControl3.Tabs["0"].Visible = false;
  2953. ultraTabControl3.Tabs["1"].Visible = false;
  2954. ultraTabControl3.Tabs["2"].Visible = false;
  2955. ultraTabControl3.Tabs["3"].Visible = false;
  2956. ultraTabControl3.Tabs["4"].Visible = true;
  2957. ultraTabControl3.Tabs["5"].Visible = false;
  2958. ultraTabControl3.Tabs["6"].Visible = false;
  2959. ultraTabControl3.Tabs["7"].Visible = false;
  2960. ultraTabControl3.Tabs["8"].Visible = false;
  2961. ultraTabControl3.Tabs["9"].Visible = false;
  2962. ultraTabControl3.Tabs["10"].Visible = false;
  2963. ultraTabControl3.Tabs["11"].Visible = false;
  2964. this.ultraComFormual1.Visible = true;
  2965. this.cmbStdSteelType1.Visible = true;
  2966. this.txtStdSteelNo1.Visible = true;
  2967. this.txtStdSteelValue1.Visible = true;
  2968. this.txtActualValue1.Visible = true;
  2969. ultraLabel59.Visible = true;
  2970. ultraLabel53.Visible = true;
  2971. ultraLabel52.Visible = true;
  2972. ultraLabel51.Visible = true;
  2973. ultraLabel50.Visible = true;
  2974. ultraComFormual1.Items.Add("HBW2.5");
  2975. ultraComFormual1.Items.Add("HBW5");
  2976. ultraComFormual1.Items.Add("HBW10");
  2977. cmbStdSteelType1.Items.Add("HBW2.5/187.5");
  2978. cmbStdSteelType1.Items.Add("HBW 5/750");
  2979. cmbStdSteelType1.Items.Add("HBW 10/1000");
  2980. }
  2981. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))//洛氏
  2982. {
  2983. cmbStdSteelType1.Items.Clear();
  2984. PipeCheckconsignPhydetailEntityLSbindingSource.DataSource = listSource;
  2985. MergedCell(ultraGrid5, new string[] { "PhyName" });
  2986. foreach (UltraGridRow forRow in ultraGrid18.Rows)
  2987. {
  2988. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  2989. {
  2990. forRow.RowSelectorAppearance.BackColor = Color.Red;
  2991. }
  2992. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  2993. {
  2994. forRow.RowSelectorAppearance.BackColor = Color.Red;
  2995. }
  2996. }
  2997. ultraTabControl3.Tabs["2"].Selected = true;
  2998. ultraTabControl3.Tabs["0"].Visible = false;
  2999. ultraTabControl3.Tabs["1"].Visible = false;
  3000. ultraTabControl3.Tabs["2"].Visible = true;
  3001. ultraTabControl3.Tabs["3"].Visible = false;
  3002. ultraTabControl3.Tabs["4"].Visible = false;
  3003. ultraTabControl3.Tabs["5"].Visible = false;
  3004. ultraTabControl3.Tabs["6"].Visible = false;
  3005. ultraTabControl3.Tabs["7"].Visible = false;
  3006. ultraTabControl3.Tabs["8"].Visible = false;
  3007. ultraTabControl3.Tabs["9"].Visible = false;
  3008. ultraTabControl3.Tabs["10"].Visible = false;
  3009. ultraTabControl3.Tabs["11"].Visible = false;
  3010. this.ultraComFormual1.Visible = false;
  3011. this.cmbStdSteelType1.Visible = true;
  3012. this.txtStdSteelNo1.Visible = true;
  3013. this.txtStdSteelValue1.Visible = true;
  3014. this.txtActualValue1.Visible = true;
  3015. ultraLabel59.Visible = false;
  3016. ultraLabel53.Visible = true;
  3017. ultraLabel52.Visible = true;
  3018. ultraLabel51.Visible = true;
  3019. ultraLabel50.Visible = true;
  3020. cmbStdSteelType1.Items.Add("HRA");
  3021. cmbStdSteelType1.Items.Add("HRB");
  3022. cmbStdSteelType1.Items.Add("HRC");
  3023. }
  3024. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))//维氏
  3025. {
  3026. ultraComFormual1.Items.Clear();
  3027. cmbStdSteelType1.Items.Clear();
  3028. PipeCheckconsignPhydetailEntityWSbindingSource.DataSource = listSource;
  3029. MergedCell(ultraGrid5, new string[] { "PhyName" });
  3030. foreach (UltraGridRow forRow in ultraGrid19.Rows)
  3031. {
  3032. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3033. {
  3034. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3035. }
  3036. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3037. {
  3038. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3039. }
  3040. }
  3041. ultraTabControl3.Tabs["3"].Selected = true;
  3042. ultraTabControl3.Tabs["0"].Visible = false;
  3043. ultraTabControl3.Tabs["1"].Visible = false;
  3044. ultraTabControl3.Tabs["2"].Visible = false;
  3045. ultraTabControl3.Tabs["3"].Visible = true;
  3046. ultraTabControl3.Tabs["4"].Visible = false;
  3047. ultraTabControl3.Tabs["5"].Visible = false;
  3048. ultraTabControl3.Tabs["6"].Visible = false;
  3049. ultraTabControl3.Tabs["7"].Visible = false;
  3050. ultraTabControl3.Tabs["8"].Visible = false;
  3051. ultraTabControl3.Tabs["9"].Visible = false;
  3052. ultraTabControl3.Tabs["10"].Visible = false;
  3053. ultraTabControl3.Tabs["11"].Visible = false;
  3054. this.ultraComFormual1.Visible = true;
  3055. this.cmbStdSteelType1.Visible = true;
  3056. this.txtStdSteelNo1.Visible = true;
  3057. this.txtStdSteelValue1.Visible = true;
  3058. this.txtActualValue1.Visible = true;
  3059. ultraLabel59.Visible = true;
  3060. ultraLabel53.Visible = true;
  3061. ultraLabel52.Visible = true;
  3062. ultraLabel51.Visible = true;
  3063. ultraLabel50.Visible = true;
  3064. ultraComFormual1.Items.Add("HV5");
  3065. ultraComFormual1.Items.Add("HV10");
  3066. cmbStdSteelType1.Items.Add("HV5");
  3067. cmbStdSteelType1.Items.Add("HV10");
  3068. cmbStdSteelType1.Items.Add("HV0.2");
  3069. }
  3070. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0016") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0031"))//组织
  3071. {
  3072. PipeCheckconsignPhydetailEntityZZbindingSource.DataSource = listSource;
  3073. foreach (UltraGridRow forRow in ultraGrid23.Rows)
  3074. {
  3075. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3076. {
  3077. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3078. }
  3079. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3080. {
  3081. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3082. }
  3083. }
  3084. ultraTabControl3.Tabs["7"].Selected = true;
  3085. ultraTabControl3.Tabs["0"].Visible = false;
  3086. ultraTabControl3.Tabs["1"].Visible = false;
  3087. ultraTabControl3.Tabs["2"].Visible = false;
  3088. ultraTabControl3.Tabs["3"].Visible = false;
  3089. ultraTabControl3.Tabs["4"].Visible = false;
  3090. ultraTabControl3.Tabs["5"].Visible = false;
  3091. ultraTabControl3.Tabs["6"].Visible = false;
  3092. ultraTabControl3.Tabs["7"].Visible = true;
  3093. ultraTabControl3.Tabs["8"].Visible = false;
  3094. ultraTabControl3.Tabs["9"].Visible = false;
  3095. ultraTabControl3.Tabs["10"].Visible = false;
  3096. ultraTabControl3.Tabs["11"].Visible = false;
  3097. this.ultraComFormual1.Visible = false;
  3098. this.cmbStdSteelType1.Visible = false;
  3099. this.txtStdSteelNo1.Visible = false;
  3100. this.txtStdSteelValue1.Visible = false;
  3101. this.txtActualValue1.Visible = false;
  3102. ultraLabel59.Visible = false;
  3103. ultraLabel53.Visible = false;
  3104. ultraLabel52.Visible = false;
  3105. ultraLabel51.Visible = false;
  3106. ultraLabel50.Visible = false;
  3107. }
  3108. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))//晶粒度
  3109. {
  3110. PipeCheckconsignPhydetailEntityJLDbindingSource.DataSource = listSource;
  3111. foreach (UltraGridRow forRow in ultraGrid22.Rows)
  3112. {
  3113. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3114. {
  3115. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3116. }
  3117. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3118. {
  3119. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3120. }
  3121. }
  3122. ultraTabControl3.Tabs["6"].Selected = true;
  3123. ultraTabControl3.Tabs["0"].Visible = false;
  3124. ultraTabControl3.Tabs["1"].Visible = false;
  3125. ultraTabControl3.Tabs["2"].Visible = false;
  3126. ultraTabControl3.Tabs["3"].Visible = false;
  3127. ultraTabControl3.Tabs["4"].Visible = false;
  3128. ultraTabControl3.Tabs["5"].Visible = false;
  3129. ultraTabControl3.Tabs["6"].Visible = true;
  3130. ultraTabControl3.Tabs["7"].Visible = false;
  3131. ultraTabControl3.Tabs["8"].Visible = false;
  3132. ultraTabControl3.Tabs["9"].Visible = false;
  3133. ultraTabControl3.Tabs["10"].Visible = false;
  3134. ultraTabControl3.Tabs["11"].Visible = false;
  3135. this.ultraComFormual1.Visible = false;
  3136. this.cmbStdSteelType1.Visible = true;
  3137. this.txtStdSteelNo1.Visible = true;
  3138. this.txtStdSteelValue1.Visible = true;
  3139. this.txtActualValue1.Visible = true;
  3140. ultraLabel59.Visible = false;
  3141. ultraLabel53.Visible = false;
  3142. ultraLabel52.Visible = false;
  3143. ultraLabel51.Visible = false;
  3144. ultraLabel50.Visible = false;
  3145. }
  3146. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))//夹杂
  3147. {
  3148. PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource = listSource;
  3149. foreach (UltraGridRow forRow in ultraGrid21.Rows)
  3150. {
  3151. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3152. {
  3153. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3154. }
  3155. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3156. {
  3157. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3158. }
  3159. }
  3160. ultraTabControl3.Tabs["5"].Selected = true;
  3161. ultraTabControl3.Tabs["0"].Visible = false;
  3162. ultraTabControl3.Tabs["1"].Visible = false;
  3163. ultraTabControl3.Tabs["2"].Visible = false;
  3164. ultraTabControl3.Tabs["3"].Visible = false;
  3165. ultraTabControl3.Tabs["4"].Visible = false;
  3166. ultraTabControl3.Tabs["5"].Visible = true;
  3167. ultraTabControl3.Tabs["6"].Visible = false;
  3168. ultraTabControl3.Tabs["7"].Visible = false;
  3169. ultraTabControl3.Tabs["8"].Visible = false;
  3170. ultraTabControl3.Tabs["9"].Visible = false;
  3171. ultraTabControl3.Tabs["10"].Visible = false;
  3172. ultraTabControl3.Tabs["11"].Visible = false;
  3173. this.ultraComFormual1.Visible = false;
  3174. this.cmbStdSteelType1.Visible = false;
  3175. this.txtStdSteelNo1.Visible = false;
  3176. this.txtStdSteelValue1.Visible = false;
  3177. this.txtActualValue1.Visible = false;
  3178. ultraLabel59.Visible = false;
  3179. ultraLabel53.Visible = false;
  3180. ultraLabel52.Visible = false;
  3181. ultraLabel51.Visible = false;
  3182. ultraLabel50.Visible = false;
  3183. ultraGrid21.DisplayLayout.Bands[0].Columns["Value1"].Header.Caption = "一象限";
  3184. ultraGrid21.DisplayLayout.Bands[0].Columns["Value2"].Header.Caption = "二象限";
  3185. ultraGrid21.DisplayLayout.Bands[0].Columns["Value3"].Header.Caption = "三象限";
  3186. ultraGrid21.DisplayLayout.Bands[0].Columns["Value4"].Header.Caption = "四象限";
  3187. if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0115"))
  3188. {
  3189. ultraGrid21.DisplayLayout.Bands[0].Columns["Value2"].Hidden = false;
  3190. ultraGrid21.DisplayLayout.Bands[0].Columns["Value3"].Hidden = false;
  3191. ultraGrid21.DisplayLayout.Bands[0].Columns["Value4"].Hidden = false;
  3192. }
  3193. else
  3194. {
  3195. ultraGrid21.DisplayLayout.Bands[0].Columns["Value2"].Hidden = true;
  3196. ultraGrid21.DisplayLayout.Bands[0].Columns["Value3"].Hidden = true;
  3197. ultraGrid21.DisplayLayout.Bands[0].Columns["Value4"].Hidden = true;
  3198. }
  3199. }
  3200. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0010"))//工艺
  3201. {
  3202. if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0027") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0038") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0082") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0083") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0098"))//弯曲
  3203. {
  3204. PipeCheckconsignPhydetailEntityWQbindingSource.DataSource = listSource;
  3205. ultraTabControl3.Tabs["9"].Selected = true;
  3206. ultraTabControl3.Tabs["0"].Visible = false;
  3207. ultraTabControl3.Tabs["1"].Visible = false;
  3208. ultraTabControl3.Tabs["2"].Visible = false;
  3209. ultraTabControl3.Tabs["3"].Visible = false;
  3210. ultraTabControl3.Tabs["4"].Visible = false;
  3211. ultraTabControl3.Tabs["5"].Visible = false;
  3212. ultraTabControl3.Tabs["6"].Visible = false;
  3213. ultraTabControl3.Tabs["7"].Visible = false;
  3214. ultraTabControl3.Tabs["8"].Visible = false;
  3215. ultraTabControl3.Tabs["9"].Visible = true;
  3216. ultraTabControl3.Tabs["10"].Visible = false;
  3217. ultraTabControl3.Tabs["11"].Visible = false;
  3218. this.ultraComFormual1.Visible = false;
  3219. this.cmbStdSteelType1.Visible = false;
  3220. this.txtStdSteelNo1.Visible = false;
  3221. this.txtStdSteelValue1.Visible = false;
  3222. this.txtActualValue1.Visible = false;
  3223. }
  3224. else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0009"))//压扁
  3225. {
  3226. ultraTxtYbEuestion.Text = "";
  3227. ultraTxtYbD.Text = "";
  3228. ultraTxtYbS.Text = "";
  3229. ultraTxtYbC.Text = "";
  3230. ultraTxtYbSpac.Text = "";
  3231. ultraTxtYbQualfiled.Text = "";
  3232. ultraTxtYbDefect.Text = "";
  3233. ultraTxtYbMemo.Text = "";
  3234. PipeCheckconsignPhydetailEntityYBbindingSource.DataSource = listSource;
  3235. ultraTabControl3.Tabs["8"].Selected = true;
  3236. ultraTabControl3.Tabs["0"].Visible = false;
  3237. ultraTabControl3.Tabs["1"].Visible = false;
  3238. ultraTabControl3.Tabs["2"].Visible = false;
  3239. ultraTabControl3.Tabs["3"].Visible = false;
  3240. ultraTabControl3.Tabs["4"].Visible = false;
  3241. ultraTabControl3.Tabs["5"].Visible = false;
  3242. ultraTabControl3.Tabs["6"].Visible = false;
  3243. ultraTabControl3.Tabs["7"].Visible = false;
  3244. ultraTabControl3.Tabs["8"].Visible = true;
  3245. ultraTabControl3.Tabs["9"].Visible = false;
  3246. ultraTabControl3.Tabs["10"].Visible = false;
  3247. ultraTabControl3.Tabs["11"].Visible = false;
  3248. this.ultraComFormual1.Visible = false;
  3249. this.cmbStdSteelType1.Visible = false;
  3250. this.txtStdSteelNo1.Visible = false;
  3251. this.txtStdSteelValue1.Visible = false;
  3252. this.txtActualValue1.Visible = false;
  3253. ultraLabel59.Visible = false;
  3254. ultraLabel53.Visible = false;
  3255. ultraLabel52.Visible = false;
  3256. ultraLabel51.Visible = false;
  3257. ultraLabel50.Visible = false;
  3258. int x = row.Cells["SpecName"].Text.IndexOf('x');
  3259. ultraTxtYbD.Text = row.Cells["SpecName"].Text.Substring(0, x);
  3260. ultraTxtYbS.Text = row.Cells["SpecName"].Text.Substring(x + 1);
  3261. ultraGrid24.DisplayLayout.Bands[0].Columns["IsGood"].Header.Caption = "试验结果(一次)";
  3262. ultraGrid24.DisplayLayout.Bands[0].Columns["IsDefect"].Header.Caption = "试验结果(二次)";
  3263. }
  3264. else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0026"))//扩口
  3265. {
  3266. PipeCheckconsignPhydetailEntityKKbindingSource.DataSource = listSource;
  3267. ultraTabControl3.Tabs["10"].Selected = true;
  3268. ultraTabControl3.Tabs["0"].Visible = false;
  3269. ultraTabControl3.Tabs["1"].Visible = false;
  3270. ultraTabControl3.Tabs["2"].Visible = false;
  3271. ultraTabControl3.Tabs["3"].Visible = false;
  3272. ultraTabControl3.Tabs["4"].Visible = false;
  3273. ultraTabControl3.Tabs["5"].Visible = false;
  3274. ultraTabControl3.Tabs["6"].Visible = false;
  3275. ultraTabControl3.Tabs["7"].Visible = false;
  3276. ultraTabControl3.Tabs["8"].Visible = false;
  3277. ultraTabControl3.Tabs["9"].Visible = false;
  3278. ultraTabControl3.Tabs["10"].Visible = true;
  3279. ultraTabControl3.Tabs["11"].Visible = false;
  3280. this.ultraComFormual1.Visible = false;
  3281. this.cmbStdSteelType1.Visible = false;
  3282. this.txtStdSteelNo1.Visible = false;
  3283. this.txtStdSteelValue1.Visible = false;
  3284. this.txtActualValue1.Visible = false;
  3285. ultraLabel59.Visible = false;
  3286. ultraLabel53.Visible = false;
  3287. ultraLabel52.Visible = false;
  3288. ultraLabel51.Visible = false;
  3289. ultraLabel50.Visible = false;
  3290. }
  3291. }
  3292. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0050"))
  3293. {
  3294. pipeCheckconsignPhydetailEntityQTBindingSource.DataSource = listSource;
  3295. ultraTabControl3.Tabs["11"].Selected = true;
  3296. ultraTabControl3.Tabs["0"].Visible = false;
  3297. ultraTabControl3.Tabs["1"].Visible = false;
  3298. ultraTabControl3.Tabs["2"].Visible = false;
  3299. ultraTabControl3.Tabs["3"].Visible = false;
  3300. ultraTabControl3.Tabs["4"].Visible = false;
  3301. ultraTabControl3.Tabs["5"].Visible = false;
  3302. ultraTabControl3.Tabs["6"].Visible = false;
  3303. ultraTabControl3.Tabs["7"].Visible = false;
  3304. ultraTabControl3.Tabs["8"].Visible = false;
  3305. ultraTabControl3.Tabs["9"].Visible = false;
  3306. ultraTabControl3.Tabs["10"].Visible = false;
  3307. ultraTabControl3.Tabs["11"].Visible = true;
  3308. ultraGrid55.DisplayLayout.Bands[0].Columns["AverageValue"].Header.Caption = "最小值";
  3309. this.ultraComFormual1.Visible = false;
  3310. this.cmbStdSteelType1.Visible = false;
  3311. this.txtStdSteelNo1.Visible = false;
  3312. this.txtStdSteelValue1.Visible = false;
  3313. this.txtActualValue1.Visible = false;
  3314. ultraLabel59.Visible = false;
  3315. ultraLabel53.Visible = false;
  3316. ultraLabel52.Visible = false;
  3317. ultraLabel51.Visible = false;
  3318. ultraLabel50.Visible = false;
  3319. }
  3320. initCheckData(row);//加载编辑区信息
  3321. }
  3322. private void initCheckData(UltraGridRow row)
  3323. {
  3324. this.txtCHECK_TEMP1.Text = row.Cells["CheckTemp"].Text;
  3325. this.ultraDEVICE_NAME1.Value = row.Cells["DeviceNo"].Text;
  3326. this.ultraComMethod1.Value = row.Cells["FormualNo"].Text;
  3327. this.cmbChemOrder1.Value = row.Cells["CheckShift"].Text;
  3328. this.cmbChemGroup1.Value = row.Cells["CheckClass"].Text;
  3329. this.txtChemUser1.Text = row.Cells["CheckName"].Text;
  3330. this.ultraComFormual1.Text = row.Cells["HardnessType"].Text;
  3331. cmbStdSteelType1.Text = row.Cells["StdSteelType"].Text;
  3332. this.txtStdSteelNo1.Text = row.Cells["StdSteelNo"].Text;
  3333. this.txtStdSteelValue1.Text = row.Cells["StdSteelValue"].Text;
  3334. this.txtActualValue1.Text = row.Cells["ActualValue"].Text;
  3335. this.ultraComFormual1.Text = row.Cells["HardnessType"].Text;
  3336. }
  3337. private void ultraGrid28_AfterRowActivate(object sender, EventArgs e)
  3338. {
  3339. ultraTabControl3.Visible = false;
  3340. ultraTabControl4.Visible = true;
  3341. ultraTabControl5.Visible = false;
  3342. ultraTabControl2.Visible = false;
  3343. UltraGridRow row = this.ultraGrid28.ActiveRow;
  3344. List<PipeCheckconsignPhydetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignPhydetailEntity>(
  3345. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPhyItem", new object[] { row.Cells["CheckNo"].Value.ToString(), row.Cells["SampleNo"].Value.ToString(), row.Cells["PhyCodeMax"].Value.ToString() }, this.ob);
  3346. if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))//拉伸
  3347. {
  3348. PipeCheckconsignPhydetailEntitybindingSource.DataSource = listSource;
  3349. ultraTabControl4.Tabs["0"].Selected = true;
  3350. ultraTabControl4.Tabs["0"].Visible = true;
  3351. ultraTabControl4.Tabs["1"].Visible = false;
  3352. ultraTabControl4.Tabs["2"].Visible = false;
  3353. ultraTabControl4.Tabs["3"].Visible = false;
  3354. ultraTabControl4.Tabs["4"].Visible = false;
  3355. ultraTabControl4.Tabs["5"].Visible = false;
  3356. ultraTabControl4.Tabs["6"].Visible = false;
  3357. ultraTabControl4.Tabs["7"].Visible = false;
  3358. ultraTabControl4.Tabs["8"].Visible = false;
  3359. ultraTabControl4.Tabs["9"].Visible = false;
  3360. ultraTabControl4.Tabs["10"].Visible = false;
  3361. ultraTabControl4.Tabs["11"].Visible = false;
  3362. foreach (UltraGridRow forRow in ultraGrid29.Rows)
  3363. {
  3364. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3365. {
  3366. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3367. }
  3368. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3369. {
  3370. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3371. }
  3372. }
  3373. }
  3374. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))//冲击
  3375. {
  3376. PipeCheckconsignPhydetailEntityCjbindingSource.DataSource = listSource;
  3377. ultraTabControl4.Tabs["1"].Selected = true;
  3378. ultraTabControl4.Tabs["0"].Visible = false;
  3379. ultraTabControl4.Tabs["1"].Visible = true;
  3380. ultraTabControl4.Tabs["2"].Visible = false;
  3381. ultraTabControl4.Tabs["3"].Visible = false;
  3382. ultraTabControl4.Tabs["4"].Visible = false;
  3383. ultraTabControl4.Tabs["5"].Visible = false;
  3384. ultraTabControl4.Tabs["6"].Visible = false;
  3385. ultraTabControl4.Tabs["7"].Visible = false;
  3386. ultraTabControl4.Tabs["8"].Visible = false;
  3387. ultraTabControl4.Tabs["9"].Visible = false;
  3388. ultraTabControl4.Tabs["10"].Visible = false;
  3389. ultraTabControl4.Tabs["11"].Visible = false;
  3390. foreach (UltraGridRow forRow in ultraGrid30.Rows)
  3391. {
  3392. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3393. {
  3394. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3395. }
  3396. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3397. {
  3398. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3399. }
  3400. }
  3401. }
  3402. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))//布氏
  3403. {
  3404. PipeCheckconsignPhydetailEntityBSbindingSource.DataSource = listSource;
  3405. MergedCell(ultraGrid6, new string[] { "PhyName" });
  3406. ultraTabControl4.Tabs["4"].Selected = true;
  3407. ultraTabControl4.Tabs["0"].Visible = false;
  3408. ultraTabControl4.Tabs["1"].Visible = false;
  3409. ultraTabControl4.Tabs["2"].Visible = false;
  3410. ultraTabControl4.Tabs["3"].Visible = false;
  3411. ultraTabControl4.Tabs["4"].Visible = true;
  3412. ultraTabControl4.Tabs["5"].Visible = false;
  3413. ultraTabControl4.Tabs["6"].Visible = false;
  3414. ultraTabControl4.Tabs["7"].Visible = false;
  3415. ultraTabControl4.Tabs["8"].Visible = false;
  3416. ultraTabControl4.Tabs["9"].Visible = false;
  3417. ultraTabControl4.Tabs["10"].Visible = false;
  3418. ultraTabControl4.Tabs["11"].Visible = false;
  3419. foreach (UltraGridRow forRow in ultraGrid33.Rows)
  3420. {
  3421. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3422. {
  3423. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3424. }
  3425. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3426. {
  3427. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3428. }
  3429. }
  3430. }
  3431. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))//洛氏
  3432. {
  3433. PipeCheckconsignPhydetailEntityLSbindingSource.DataSource = listSource;
  3434. MergedCell(ultraGrid5, new string[] { "PhyName" });
  3435. ultraTabControl4.Tabs["2"].Selected = true;
  3436. ultraTabControl4.Tabs["0"].Visible = false;
  3437. ultraTabControl4.Tabs["1"].Visible = false;
  3438. ultraTabControl4.Tabs["2"].Visible = true;
  3439. ultraTabControl4.Tabs["3"].Visible = false;
  3440. ultraTabControl4.Tabs["4"].Visible = false;
  3441. ultraTabControl4.Tabs["5"].Visible = false;
  3442. ultraTabControl4.Tabs["6"].Visible = false;
  3443. ultraTabControl4.Tabs["7"].Visible = false;
  3444. ultraTabControl4.Tabs["8"].Visible = false;
  3445. ultraTabControl4.Tabs["9"].Visible = false;
  3446. ultraTabControl4.Tabs["10"].Visible = false;
  3447. ultraTabControl4.Tabs["11"].Visible = false;
  3448. foreach (UltraGridRow forRow in ultraGrid31.Rows)
  3449. {
  3450. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3451. {
  3452. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3453. }
  3454. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3455. {
  3456. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3457. }
  3458. }
  3459. }
  3460. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))//维氏
  3461. {
  3462. PipeCheckconsignPhydetailEntityWSbindingSource.DataSource = listSource;
  3463. MergedCell(ultraGrid5, new string[] { "PhyName" });
  3464. ultraTabControl4.Tabs["3"].Selected = true;
  3465. ultraTabControl4.Tabs["0"].Visible = false;
  3466. ultraTabControl4.Tabs["1"].Visible = false;
  3467. ultraTabControl4.Tabs["2"].Visible = false;
  3468. ultraTabControl4.Tabs["3"].Visible = true;
  3469. ultraTabControl4.Tabs["4"].Visible = false;
  3470. ultraTabControl4.Tabs["5"].Visible = false;
  3471. ultraTabControl4.Tabs["6"].Visible = false;
  3472. ultraTabControl4.Tabs["7"].Visible = false;
  3473. ultraTabControl4.Tabs["8"].Visible = false;
  3474. ultraTabControl4.Tabs["9"].Visible = false;
  3475. ultraTabControl4.Tabs["10"].Visible = false;
  3476. ultraTabControl4.Tabs["11"].Visible = false;
  3477. foreach (UltraGridRow forRow in ultraGrid32.Rows)
  3478. {
  3479. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3480. {
  3481. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3482. }
  3483. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3484. {
  3485. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3486. }
  3487. }
  3488. }
  3489. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0016") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0031"))//组织
  3490. {
  3491. PipeCheckconsignPhydetailEntityZZbindingSource.DataSource = listSource;
  3492. ultraTabControl4.Tabs["7"].Selected = true;
  3493. ultraTabControl4.Tabs["0"].Visible = false;
  3494. ultraTabControl4.Tabs["1"].Visible = false;
  3495. ultraTabControl4.Tabs["2"].Visible = false;
  3496. ultraTabControl4.Tabs["3"].Visible = false;
  3497. ultraTabControl4.Tabs["4"].Visible = false;
  3498. ultraTabControl4.Tabs["5"].Visible = false;
  3499. ultraTabControl4.Tabs["6"].Visible = false;
  3500. ultraTabControl4.Tabs["7"].Visible = true;
  3501. ultraTabControl4.Tabs["8"].Visible = false;
  3502. ultraTabControl4.Tabs["9"].Visible = false;
  3503. ultraTabControl4.Tabs["10"].Visible = false;
  3504. ultraTabControl4.Tabs["11"].Visible = false;
  3505. foreach (UltraGridRow forRow in ultraGrid36.Rows)
  3506. {
  3507. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3508. {
  3509. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3510. }
  3511. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3512. {
  3513. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3514. }
  3515. }
  3516. }
  3517. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))//晶粒度
  3518. {
  3519. PipeCheckconsignPhydetailEntityJLDbindingSource.DataSource = listSource;
  3520. ultraTabControl4.Tabs["6"].Selected = true;
  3521. ultraTabControl4.Tabs["0"].Visible = false;
  3522. ultraTabControl4.Tabs["1"].Visible = false;
  3523. ultraTabControl4.Tabs["2"].Visible = false;
  3524. ultraTabControl4.Tabs["3"].Visible = false;
  3525. ultraTabControl4.Tabs["4"].Visible = false;
  3526. ultraTabControl4.Tabs["5"].Visible = false;
  3527. ultraTabControl4.Tabs["6"].Visible = true;
  3528. ultraTabControl4.Tabs["7"].Visible = false;
  3529. ultraTabControl4.Tabs["8"].Visible = false;
  3530. ultraTabControl4.Tabs["9"].Visible = false;
  3531. ultraTabControl4.Tabs["10"].Visible = false;
  3532. ultraTabControl4.Tabs["11"].Visible = false;
  3533. foreach (UltraGridRow forRow in ultraGrid35.Rows)
  3534. {
  3535. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3536. {
  3537. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3538. }
  3539. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3540. {
  3541. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3542. }
  3543. }
  3544. }
  3545. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))//夹杂
  3546. {
  3547. PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource = listSource;
  3548. ultraTabControl4.Tabs["5"].Selected = true;
  3549. ultraTabControl4.Tabs["0"].Visible = false;
  3550. ultraTabControl4.Tabs["1"].Visible = false;
  3551. ultraTabControl4.Tabs["2"].Visible = false;
  3552. ultraTabControl4.Tabs["3"].Visible = false;
  3553. ultraTabControl4.Tabs["4"].Visible = false;
  3554. ultraTabControl4.Tabs["5"].Visible = true;
  3555. ultraTabControl4.Tabs["6"].Visible = false;
  3556. ultraTabControl4.Tabs["7"].Visible = false;
  3557. ultraTabControl4.Tabs["8"].Visible = false;
  3558. ultraTabControl4.Tabs["9"].Visible = false;
  3559. ultraTabControl4.Tabs["10"].Visible = false;
  3560. ultraTabControl4.Tabs["11"].Visible = false;
  3561. foreach (UltraGridRow forRow in ultraGrid34.Rows)
  3562. {
  3563. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3564. {
  3565. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3566. }
  3567. if (!checkStr(forRow.Cells["Value1"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3568. {
  3569. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3570. }
  3571. }
  3572. ultraGrid34.DisplayLayout.Bands[0].Columns["Value1"].Header.Caption = "一象限";
  3573. ultraGrid34.DisplayLayout.Bands[0].Columns["Value2"].Header.Caption = "二象限";
  3574. ultraGrid34.DisplayLayout.Bands[0].Columns["Value3"].Header.Caption = "三象限";
  3575. ultraGrid34.DisplayLayout.Bands[0].Columns["Value4"].Header.Caption = "四象限";
  3576. if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0115"))
  3577. {
  3578. ultraGrid34.DisplayLayout.Bands[0].Columns["Value2"].Hidden = false;
  3579. ultraGrid34.DisplayLayout.Bands[0].Columns["Value3"].Hidden = false;
  3580. ultraGrid34.DisplayLayout.Bands[0].Columns["Value4"].Hidden = false;
  3581. }
  3582. else
  3583. {
  3584. ultraGrid34.DisplayLayout.Bands[0].Columns["Value2"].Hidden = true;
  3585. ultraGrid34.DisplayLayout.Bands[0].Columns["Value3"].Hidden = true;
  3586. ultraGrid34.DisplayLayout.Bands[0].Columns["Value4"].Hidden = true;
  3587. }
  3588. }
  3589. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0010"))//工艺
  3590. {
  3591. if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0027") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0038") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0082") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0083") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0098"))//弯曲
  3592. {
  3593. PipeCheckconsignPhydetailEntityWQbindingSource.DataSource = listSource;
  3594. ultraTabControl4.Tabs["9"].Selected = true;
  3595. ultraTabControl4.Tabs["0"].Visible = false;
  3596. ultraTabControl4.Tabs["1"].Visible = false;
  3597. ultraTabControl4.Tabs["2"].Visible = false;
  3598. ultraTabControl4.Tabs["3"].Visible = false;
  3599. ultraTabControl4.Tabs["4"].Visible = false;
  3600. ultraTabControl4.Tabs["5"].Visible = false;
  3601. ultraTabControl4.Tabs["6"].Visible = false;
  3602. ultraTabControl4.Tabs["7"].Visible = false;
  3603. ultraTabControl4.Tabs["8"].Visible = false;
  3604. ultraTabControl4.Tabs["9"].Visible = true;
  3605. ultraTabControl4.Tabs["10"].Visible = false;
  3606. ultraTabControl4.Tabs["11"].Visible = false;
  3607. }
  3608. else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0009"))//压扁
  3609. {
  3610. PipeCheckconsignPhydetailEntityYBbindingSource.DataSource = listSource;
  3611. ultraTabControl4.Tabs["8"].Selected = true;
  3612. ultraTabControl4.Tabs["0"].Visible = false;
  3613. ultraTabControl4.Tabs["1"].Visible = false;
  3614. ultraTabControl4.Tabs["2"].Visible = false;
  3615. ultraTabControl4.Tabs["3"].Visible = false;
  3616. ultraTabControl4.Tabs["4"].Visible = false;
  3617. ultraTabControl4.Tabs["5"].Visible = false;
  3618. ultraTabControl4.Tabs["6"].Visible = false;
  3619. ultraTabControl4.Tabs["7"].Visible = false;
  3620. ultraTabControl4.Tabs["8"].Visible = true;
  3621. ultraTabControl4.Tabs["9"].Visible = false;
  3622. ultraTabControl4.Tabs["10"].Visible = false;
  3623. ultraTabControl4.Tabs["11"].Visible = false;
  3624. ultraGrid37.DisplayLayout.Bands[0].Columns["IsGood"].Header.Caption = "试验结果(一次)";
  3625. ultraGrid37.DisplayLayout.Bands[0].Columns["IsDefect"].Header.Caption = "试验结果(二次)";
  3626. }
  3627. else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0026"))//扩口
  3628. {
  3629. PipeCheckconsignPhydetailEntityKKbindingSource.DataSource = listSource;
  3630. ultraTabControl4.Tabs["10"].Selected = true;
  3631. ultraTabControl4.Tabs["0"].Visible = false;
  3632. ultraTabControl4.Tabs["1"].Visible = false;
  3633. ultraTabControl4.Tabs["2"].Visible = false;
  3634. ultraTabControl4.Tabs["3"].Visible = false;
  3635. ultraTabControl4.Tabs["4"].Visible = false;
  3636. ultraTabControl4.Tabs["5"].Visible = false;
  3637. ultraTabControl4.Tabs["6"].Visible = false;
  3638. ultraTabControl4.Tabs["7"].Visible = false;
  3639. ultraTabControl4.Tabs["8"].Visible = false;
  3640. ultraTabControl4.Tabs["9"].Visible = false;
  3641. ultraTabControl4.Tabs["10"].Visible = true;
  3642. ultraTabControl4.Tabs["11"].Visible = false;
  3643. }
  3644. }
  3645. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0050"))//其他
  3646. {
  3647. PipeCheckconsignPhydetailEntityKKbindingSource.DataSource = listSource;
  3648. ultraTabControl4.Tabs["11"].Selected = true;
  3649. ultraTabControl4.Tabs["0"].Visible = false;
  3650. ultraTabControl4.Tabs["1"].Visible = false;
  3651. ultraTabControl4.Tabs["2"].Visible = false;
  3652. ultraTabControl4.Tabs["3"].Visible = false;
  3653. ultraTabControl4.Tabs["4"].Visible = false;
  3654. ultraTabControl4.Tabs["5"].Visible = false;
  3655. ultraTabControl4.Tabs["6"].Visible = false;
  3656. ultraTabControl4.Tabs["7"].Visible = false;
  3657. ultraTabControl4.Tabs["8"].Visible = false;
  3658. ultraTabControl4.Tabs["9"].Visible = false;
  3659. ultraTabControl4.Tabs["10"].Visible = false;
  3660. ultraTabControl4.Tabs["11"].Visible = true;
  3661. ultraGrid56.DisplayLayout.Bands[0].Columns["AverageValue"].Header.Caption = "最小值";
  3662. foreach (UltraGridRow forRow in ultraGrid56.Rows)
  3663. {
  3664. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMinSign"].Text.Trim(), forRow.Cells["StdMin"].Text.Trim()))
  3665. {
  3666. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3667. }
  3668. if (!checkStr(forRow.Cells["AverageValue"].Text.Trim(), forRow.Cells["StdMaxSign"].Text.Trim(), forRow.Cells["StdMax"].Text.Trim()))
  3669. {
  3670. forRow.RowSelectorAppearance.BackColor = Color.Red;
  3671. }
  3672. }
  3673. }
  3674. }
  3675. private void ultraGrid14_AfterRowActivate(object sender, EventArgs e)
  3676. {
  3677. UltraGridRow uRow = this.ultraGrid14.ActiveRow;
  3678. List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
  3679. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPHY", new object[] { uRow.Cells["CheckNo"].Value.ToString(), uRow.Cells["SampleNo"].Value.ToString(), "3", arrId, this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  3680. PipeCheckconsignDetailEntitybindingSource4.DataSource = listSource;
  3681. }
  3682. private void ultraButton2_Click(object sender, EventArgs e)
  3683. {
  3684. if (this.ultraTxtYbEuestion.Text.Trim() == "")
  3685. {
  3686. MessageUtil.ShowTips("请选择计算公式!");
  3687. return;
  3688. }
  3689. double d = 0.0;
  3690. double c = 0.0;
  3691. double t = 0.0;
  3692. if (this.ultraTxtYbEuestion.Text.Trim() == "0.65*D" || this.ultraTxtYbEuestion.Text.Trim() == "7*D/8" || this.ultraTxtYbEuestion.Text.Trim() == "2*D/3")
  3693. {
  3694. if (this.ultraTxtYbD.Text.Trim() == "")
  3695. {
  3696. MessageUtil.ShowTips("请输入管子公称外径!");
  3697. return;
  3698. }
  3699. }
  3700. else if (this.ultraTxtYbEuestion.Text.Trim() == "(1+C)*T/(C+T/D)")
  3701. {
  3702. if (this.ultraTxtYbD.Text.Trim() == "" || this.ultraTxtYbC.Text.Trim() == "" || this.ultraTxtYbS.Text.Trim() == "")
  3703. {
  3704. MessageUtil.ShowTips("请输入管子的公称外径壁厚以及压扁系数!");
  3705. return;
  3706. }
  3707. }
  3708. d = double.Parse(this.ultraTxtYbD.Text.Trim().ToString3());
  3709. t = double.Parse(this.ultraTxtYbS.Text.Trim().ToString3());
  3710. c = double.Parse(this.ultraTxtYbC.Text.Trim().ToString3());
  3711. if (this.ultraTxtYbEuestion.Text.Trim() == "0.65*D")
  3712. {
  3713. this.ultraTxtYbSpac.Text = Math.Floor((0.65 * d)).ToString();
  3714. }
  3715. else if (this.ultraTxtYbEuestion.Text.Trim() == "7*D/8")
  3716. {
  3717. this.ultraTxtYbSpac.Text = Math.Floor(((7 * d) / 8)).ToString();
  3718. }
  3719. else if (this.ultraTxtYbEuestion.Text.Trim() == "2*D/3")
  3720. {
  3721. this.ultraTxtYbSpac.Text = Math.Floor(((2 * d) / 3)).ToString();
  3722. }
  3723. else if (this.ultraTxtYbEuestion.Text.Trim() == "(1+C)*T/(C+T/D)")
  3724. {
  3725. this.ultraTxtYbSpac.Text = Math.Floor((((1 + c) * t) / (c + t / d))).ToString();
  3726. }
  3727. }
  3728. private void ultraGrid17_CellChange(object sender, CellEventArgs e)
  3729. {
  3730. this.ultraGrid17.UpdateData();
  3731. UltraGridRow ur = this.ultraGrid17.ActiveRow;
  3732. UltraGridRow uRow = this.ultraGrid15.ActiveRow;
  3733. string specName = uRow.Cells["ItemNameS"].Text.Trim();//试验尺寸
  3734. int x = specName.IndexOf("×");//x位置
  3735. string width = specName.Substring(0, x).Replace("m", "");
  3736. string height = specName.Substring(x + 1).Replace("m", "");
  3737. int m = 0;
  3738. string ak1 = "";//真实值
  3739. string ak2 = "";
  3740. string ak3 = "";
  3741. int akNum = 0;
  3742. foreach (UltraGridRow row in this.ultraGrid17.Rows)
  3743. {
  3744. if (row.Cells["PhyName"].Text.Contains("ak"))
  3745. {
  3746. akNum = akNum + 1;
  3747. }
  3748. }
  3749. if (akNum > 0 && ur.Cells["PhyName"].Text.Contains("冲击功"))
  3750. {
  3751. if (e.Cell.Column.Key == "Value1")
  3752. {
  3753. if (ur.Cells["Value1"].Text == "-")
  3754. {
  3755. return;
  3756. }
  3757. ak1 = (Math.Round(100 * double.Parse(ur.Cells["Value1"].Text.Trim().Replace('<','-').ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString();
  3758. foreach (UltraGridRow akRow in this.ultraGrid17.Rows)
  3759. {
  3760. if (akRow.Cells["PhyName"].Text.Contains("ak"))
  3761. {
  3762. akRow.Cells["Value1"].Value = ak1;
  3763. if (akRow.Cells["Value2"].Text != "")
  3764. {
  3765. m = m + 1;
  3766. }
  3767. if (akRow.Cells["Value3"].Text != "")
  3768. {
  3769. m = m + 1;
  3770. }
  3771. m = m + 1;
  3772. akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m)).ToString();
  3773. }
  3774. }
  3775. }
  3776. if (e.Cell.Column.Key == "Value2")
  3777. {
  3778. if (ur.Cells["Value2"].Text == "-")
  3779. {
  3780. return;
  3781. }
  3782. ak2 = (Math.Round(100 * double.Parse(ur.Cells["Value2"].Text.Trim().Replace('<','-').ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString();
  3783. foreach (UltraGridRow akRow in this.ultraGrid17.Rows)
  3784. {
  3785. if (akRow.Cells["PhyName"].Text.Contains("ak"))
  3786. {
  3787. akRow.Cells["Value2"].Value = ak2;
  3788. if (ur.Cells["Value1"].Text != "")
  3789. {
  3790. m = m + 1;
  3791. }
  3792. if (ur.Cells["Value3"].Text != "")
  3793. {
  3794. m = m + 1;
  3795. }
  3796. m = m + 1;
  3797. akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m)).ToString();
  3798. }
  3799. }
  3800. }
  3801. if (e.Cell.Column.Key == "Value3")
  3802. {
  3803. if (ur.Cells["Value3"].Text == "-")
  3804. {
  3805. return;
  3806. }
  3807. ak3 = (Math.Round(100 * double.Parse(ur.Cells["Value3"].Text.Trim().Replace('<', '-').ToString3()) / (double.Parse(width) * (double.Parse(height) - 2)), 0)).ToString();
  3808. foreach (UltraGridRow akRow in this.ultraGrid17.Rows)
  3809. {
  3810. if (akRow.Cells["PhyName"].Text.Contains("ak"))
  3811. {
  3812. akRow.Cells["Value3"].Value = ak3;
  3813. if (akRow.Cells["Value1"].Text != "")
  3814. {
  3815. m = m + 1;
  3816. }
  3817. if (akRow.Cells["Value2"].Text != "")
  3818. {
  3819. m = m + 1;
  3820. }
  3821. m = m + 1;
  3822. akRow.Cells["AverageValue"].Value = Math.Round(((double.Parse(akRow.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(akRow.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m)).ToString();
  3823. }
  3824. }
  3825. }
  3826. }
  3827. else
  3828. {
  3829. if (e.Cell.Column.Key == "Value1")
  3830. {
  3831. if (ur.Cells["Value1"].Text != "")
  3832. {
  3833. m = m + 1;
  3834. }
  3835. if (ur.Cells["Value2"].Text != "")
  3836. {
  3837. m = m + 1;
  3838. }
  3839. if (ur.Cells["Value3"].Text != "")
  3840. {
  3841. m = m + 1;
  3842. }
  3843. if (ur.Cells["Value1"].Text == "-")
  3844. {
  3845. return;
  3846. }
  3847. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Trim().Replace('<', '-').ToString3())) / m), 2).ToString();
  3848. }
  3849. if (e.Cell.Column.Key == "Value2")
  3850. {
  3851. if (ur.Cells["Value1"].Text != "")
  3852. {
  3853. m = m + 1;
  3854. }
  3855. if (ur.Cells["Value2"].Text != "")
  3856. {
  3857. m = m + 1;
  3858. }
  3859. if (ur.Cells["Value3"].Text != "")
  3860. {
  3861. m = m + 1;
  3862. }
  3863. if (ur.Cells["Value2"].Text == "-")
  3864. {
  3865. return;
  3866. }
  3867. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 2).ToString();
  3868. }
  3869. if (e.Cell.Column.Key == "Value3")
  3870. {
  3871. if (ur.Cells["Value1"].Text != "")
  3872. {
  3873. m = m + 1;
  3874. }
  3875. if (ur.Cells["Value2"].Text != "")
  3876. {
  3877. m = m + 1;
  3878. }
  3879. if (ur.Cells["Value3"].Text != "")
  3880. {
  3881. m = m + 1;
  3882. }
  3883. if (ur.Cells["Value3"].Text == "-")
  3884. {
  3885. return;
  3886. }
  3887. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Trim().Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 2).ToString();
  3888. }
  3889. }
  3890. }
  3891. private void ultraGrid18_CellChange(object sender, CellEventArgs e)
  3892. {
  3893. this.ultraGrid18.UpdateData();
  3894. UltraGridRow ur = this.ultraGrid18.ActiveRow;
  3895. int m = 0;
  3896. if (e.Cell.Column.Key == "Value1")
  3897. {
  3898. if (ur.Cells["Value1"].Text != "")
  3899. {
  3900. m = m + 1;
  3901. }
  3902. if (ur.Cells["Value2"].Text != "")
  3903. {
  3904. m = m + 1;
  3905. }
  3906. if (ur.Cells["Value3"].Text != "")
  3907. {
  3908. m = m + 1;
  3909. }
  3910. if (ur.Cells["Value1"].Text == "-")
  3911. {
  3912. return;
  3913. }
  3914. if (ur.Cells["Value1"].Text == "-")
  3915. {
  3916. return;
  3917. }
  3918. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 1).ToString();
  3919. }
  3920. if (e.Cell.Column.Key == "Value2")
  3921. {
  3922. if (ur.Cells["Value1"].Text != "")
  3923. {
  3924. m = m + 1;
  3925. }
  3926. if (ur.Cells["Value2"].Text != "")
  3927. {
  3928. m = m + 1;
  3929. }
  3930. if (ur.Cells["Value3"].Text != "")
  3931. {
  3932. m = m + 1;
  3933. }
  3934. if (ur.Cells["Value2"].Text == "-")
  3935. {
  3936. return;
  3937. }
  3938. if (ur.Cells["Value2"].Text == "-")
  3939. {
  3940. return;
  3941. }
  3942. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('-', '0').Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('-', '0').Replace('<', '-').ToString3())) / m), 1).ToString();
  3943. }
  3944. if (e.Cell.Column.Key == "Value3")
  3945. {
  3946. if (ur.Cells["Value1"].Text != "")
  3947. {
  3948. m = m + 1;
  3949. }
  3950. if (ur.Cells["Value2"].Text != "")
  3951. {
  3952. m = m + 1;
  3953. }
  3954. if (ur.Cells["Value3"].Text != "")
  3955. {
  3956. m = m + 1;
  3957. }
  3958. if (ur.Cells["Value3"].Text == "-")
  3959. {
  3960. return;
  3961. }
  3962. if (ur.Cells["Value3"].Text == "-")
  3963. {
  3964. return;
  3965. }
  3966. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 1).ToString();
  3967. }
  3968. }
  3969. private void ultraGrid19_CellChange(object sender, CellEventArgs e)
  3970. {
  3971. this.ultraGrid19.UpdateData();
  3972. UltraGridRow ur = this.ultraGrid19.ActiveRow;
  3973. int m = 0;
  3974. string comFormual = this.ultraComFormual.Text.Trim();
  3975. if (e.Cell.Column.Key == "Value1D1" || e.Cell.Column.Key == "Value1D2")
  3976. {
  3977. if (comFormual.Equals("HV5"))
  3978. {
  3979. ur.Cells["Value1"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3())) / 2, 2), 0);
  3980. }
  3981. else if (comFormual.Equals("HV10"))
  3982. {
  3983. ur.Cells["Value1"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3())) / 2, 2), 0);
  3984. }
  3985. else
  3986. {
  3987. MessageUtil.ShowTips("公式选择错误!");
  3988. return;
  3989. }
  3990. if (ur.Cells["Value1"].Text != "")
  3991. {
  3992. m = m + 1;
  3993. }
  3994. if (ur.Cells["Value2"].Text != "")
  3995. {
  3996. m = m + 1;
  3997. }
  3998. if (ur.Cells["Value3"].Text != "")
  3999. {
  4000. m = m + 1;
  4001. }
  4002. if (ur.Cells["Value4"].Text != "")
  4003. {
  4004. m = m + 1;
  4005. }
  4006. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4007. }
  4008. if (e.Cell.Column.Key == "Value2D1" || e.Cell.Column.Key == "Value2D2")
  4009. {
  4010. if (comFormual.Equals("HV5"))
  4011. {
  4012. ur.Cells["Value1"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3())) / 2, 2), 0);
  4013. }
  4014. else if (comFormual.Equals("HV10"))
  4015. {
  4016. ur.Cells["Value1"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3())) / 2, 2), 0);
  4017. }
  4018. else
  4019. {
  4020. MessageUtil.ShowTips("公式选择错误!");
  4021. return;
  4022. }
  4023. if (ur.Cells["Value1"].Text != "")
  4024. {
  4025. m = m + 1;
  4026. }
  4027. if (ur.Cells["Value2"].Text != "")
  4028. {
  4029. m = m + 1;
  4030. }
  4031. if (ur.Cells["Value3"].Text != "")
  4032. {
  4033. m = m + 1;
  4034. }
  4035. if (ur.Cells["Value4"].Text != "")
  4036. {
  4037. m = m + 1;
  4038. }
  4039. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4040. }
  4041. if (e.Cell.Column.Key == "Value3D1" || e.Cell.Column.Key == "Value3D2")
  4042. {
  4043. if (comFormual.Equals("HV5"))
  4044. {
  4045. ur.Cells["Value1"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0);
  4046. }
  4047. else if (comFormual.Equals("HV10"))
  4048. {
  4049. ur.Cells["Value1"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0);
  4050. }
  4051. else
  4052. {
  4053. MessageUtil.ShowTips("公式选择错误!");
  4054. return;
  4055. }
  4056. if (ur.Cells["Value1"].Text != "")
  4057. {
  4058. m = m + 1;
  4059. }
  4060. if (ur.Cells["Value2"].Text != "")
  4061. {
  4062. m = m + 1;
  4063. }
  4064. if (ur.Cells["Value3"].Text != "")
  4065. {
  4066. m = m + 1;
  4067. }
  4068. if (ur.Cells["Value4"].Text != "")
  4069. {
  4070. m = m + 1;
  4071. }
  4072. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4073. }
  4074. if (e.Cell.Column.Key == "Value4D1" || e.Cell.Column.Key == "Value4D2")
  4075. {
  4076. if (comFormual.Equals("HV5"))
  4077. {
  4078. ur.Cells["Value1"].Value = Math.Round(0.1891 * 49.03 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0);
  4079. }
  4080. else if (comFormual.Equals("HV10"))
  4081. {
  4082. ur.Cells["Value1"].Value = Math.Round(0.1891 * 98.07 / Math.Pow((double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3())) / 2, 2), 0);
  4083. }
  4084. else
  4085. {
  4086. MessageUtil.ShowTips("公式选择错误!");
  4087. return;
  4088. }
  4089. if (ur.Cells["Value1"].Text != "")
  4090. {
  4091. m = m + 1;
  4092. }
  4093. if (ur.Cells["Value2"].Text != "")
  4094. {
  4095. m = m + 1;
  4096. }
  4097. if (ur.Cells["Value3"].Text != "")
  4098. {
  4099. m = m + 1;
  4100. }
  4101. if (ur.Cells["Value4"].Text != "")
  4102. {
  4103. m = m + 1;
  4104. }
  4105. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4106. }
  4107. if (e.Cell.Column.Key == "Value1")
  4108. {
  4109. if (ur.Cells["Value1"].Text != "")
  4110. {
  4111. m = m + 1;
  4112. }
  4113. if (ur.Cells["Value2"].Text != "")
  4114. {
  4115. m = m + 1;
  4116. }
  4117. if (ur.Cells["Value3"].Text != "")
  4118. {
  4119. m = m + 1;
  4120. }
  4121. if (ur.Cells["Value4"].Text != "")
  4122. {
  4123. m = m + 1;
  4124. }
  4125. if (ur.Cells["Value1"].Text == "-")
  4126. {
  4127. return;
  4128. }
  4129. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4130. }
  4131. if (e.Cell.Column.Key == "Value2")
  4132. {
  4133. if (ur.Cells["Value1"].Text != "")
  4134. {
  4135. m = m + 1;
  4136. }
  4137. if (ur.Cells["Value2"].Text != "")
  4138. {
  4139. m = m + 1;
  4140. }
  4141. if (ur.Cells["Value3"].Text != "")
  4142. {
  4143. m = m + 1;
  4144. }
  4145. if (ur.Cells["Value4"].Text != "")
  4146. {
  4147. m = m + 1;
  4148. }
  4149. if (ur.Cells["Value2"].Text == "-")
  4150. {
  4151. return;
  4152. }
  4153. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4154. }
  4155. if (e.Cell.Column.Key == "Value3")
  4156. {
  4157. if (ur.Cells["Value1"].Text != "")
  4158. {
  4159. m = m + 1;
  4160. }
  4161. if (ur.Cells["Value2"].Text != "")
  4162. {
  4163. m = m + 1;
  4164. }
  4165. if (ur.Cells["Value3"].Text != "")
  4166. {
  4167. m = m + 1;
  4168. }
  4169. if (ur.Cells["Value4"].Text != "")
  4170. {
  4171. m = m + 1;
  4172. }
  4173. if (ur.Cells["Value3"].Text == "-")
  4174. {
  4175. return;
  4176. }
  4177. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4178. }
  4179. if (e.Cell.Column.Key == "Value4")
  4180. {
  4181. if (ur.Cells["Value1"].Text != "")
  4182. {
  4183. m = m + 1;
  4184. }
  4185. if (ur.Cells["Value2"].Text != "")
  4186. {
  4187. m = m + 1;
  4188. }
  4189. if (ur.Cells["Value3"].Text != "")
  4190. {
  4191. m = m + 1;
  4192. }
  4193. if (ur.Cells["Value4"].Text != "")
  4194. {
  4195. m = m + 1;
  4196. }
  4197. if (ur.Cells["Value4"].Text == "-")
  4198. {
  4199. return;
  4200. }
  4201. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value4"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4202. }
  4203. }
  4204. private void ultraGrid20_CellChange(object sender, CellEventArgs e)
  4205. {
  4206. this.ultraGrid20.UpdateData();
  4207. UltraGridRow ur = this.ultraGrid20.ActiveRow;
  4208. int m = 0;
  4209. string comFormual = this.ultraComFormual.Text.Trim();
  4210. if (e.Cell.Column.Key == "Value1D1" || e.Cell.Column.Key == "Value1D2")
  4211. {
  4212. if (comFormual.Equals("HBW2.5"))
  4213. {
  4214. ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  4215. }
  4216. else if (comFormual.Equals("HBW5"))
  4217. {
  4218. ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  4219. }
  4220. else if (comFormual.Equals("HBW10"))
  4221. {
  4222. ur.Cells["Value1"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value1D1"].Text.ToString3()) + double.Parse(ur.Cells["Value1D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  4223. }
  4224. else
  4225. {
  4226. MessageUtil.ShowTips("公式选择错误!");
  4227. return;
  4228. }
  4229. if (ur.Cells["Value1"].Text != "")
  4230. {
  4231. m = m + 1;
  4232. }
  4233. if (ur.Cells["Value2"].Text != "")
  4234. {
  4235. m = m + 1;
  4236. }
  4237. if (ur.Cells["Value3"].Text != "")
  4238. {
  4239. m = m + 1;
  4240. }
  4241. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 2).ToString();
  4242. }
  4243. if (e.Cell.Column.Key == "Value2D1" || e.Cell.Column.Key == "Value2D2")
  4244. {
  4245. if (comFormual.Equals("HBW2.5"))
  4246. {
  4247. ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  4248. }
  4249. else if (comFormual.Equals("HBW5"))
  4250. {
  4251. ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  4252. }
  4253. else if (comFormual.Equals("HBW10"))
  4254. {
  4255. ur.Cells["Value2"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value2D1"].Text.ToString3()) + double.Parse(ur.Cells["Value2D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  4256. }
  4257. else
  4258. {
  4259. MessageUtil.ShowTips("公式选择错误!");
  4260. return;
  4261. }
  4262. if (ur.Cells["Value1"].Text != "")
  4263. {
  4264. m = m + 1;
  4265. }
  4266. if (ur.Cells["Value2"].Text != "")
  4267. {
  4268. m = m + 1;
  4269. }
  4270. if (ur.Cells["Value3"].Text != "")
  4271. {
  4272. m = m + 1;
  4273. }
  4274. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 2).ToString();
  4275. }
  4276. if (e.Cell.Column.Key == "Value3D1" || e.Cell.Column.Key == "Value3D2")
  4277. {
  4278. if (comFormual.Equals("HBW2.5"))
  4279. {
  4280. ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 1838.75 / (2.5 * 3.142 * (2.5 - Math.Sqrt(6.25 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  4281. }
  4282. else if (comFormual.Equals("HBW5"))
  4283. {
  4284. ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 7355 / (5 * 3.142 * (5 - Math.Sqrt(25 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  4285. }
  4286. else if (comFormual.Equals("HBW10"))
  4287. {
  4288. ur.Cells["Value3"].Value = (Math.Round(0.102 * 2 * 29420 / (10 * 3.142 * (10 - Math.Sqrt(100 - Math.Pow(double.Parse(ur.Cells["Value3D1"].Text.ToString3()) + double.Parse(ur.Cells["Value3D2"].Text.ToString3()), 2) / 4))), 0)).ToString();
  4289. }
  4290. else
  4291. {
  4292. MessageUtil.ShowTips("公式选择错误!");
  4293. return;
  4294. }
  4295. if (ur.Cells["Value1"].Text != "")
  4296. {
  4297. m = m + 1;
  4298. }
  4299. if (ur.Cells["Value2"].Text != "")
  4300. {
  4301. m = m + 1;
  4302. }
  4303. if (ur.Cells["Value3"].Text != "")
  4304. {
  4305. m = m + 1;
  4306. }
  4307. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4308. }
  4309. if (e.Cell.Column.Key == "Value1")
  4310. {
  4311. if (ur.Cells["Value1"].Text != "")
  4312. {
  4313. m = m + 1;
  4314. }
  4315. if (ur.Cells["Value2"].Text != "")
  4316. {
  4317. m = m + 1;
  4318. }
  4319. if (ur.Cells["Value3"].Text != "")
  4320. {
  4321. m = m + 1;
  4322. }
  4323. if (ur.Cells["Value1"].Text == "-")
  4324. {
  4325. return;
  4326. }
  4327. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4328. }
  4329. if (e.Cell.Column.Key == "Value2")
  4330. {
  4331. if (ur.Cells["Value1"].Text != "")
  4332. {
  4333. m = m + 1;
  4334. }
  4335. if (ur.Cells["Value2"].Text != "")
  4336. {
  4337. m = m + 1;
  4338. }
  4339. if (ur.Cells["Value3"].Text != "")
  4340. {
  4341. m = m + 1;
  4342. }
  4343. if (ur.Cells["Value2"].Text == "-")
  4344. {
  4345. return;
  4346. }
  4347. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4348. }
  4349. if (e.Cell.Column.Key == "Value3")
  4350. {
  4351. if (ur.Cells["Value1"].Text != "")
  4352. {
  4353. m = m + 1;
  4354. }
  4355. if (ur.Cells["Value2"].Text != "")
  4356. {
  4357. m = m + 1;
  4358. }
  4359. if (ur.Cells["Value3"].Text != "")
  4360. {
  4361. m = m + 1;
  4362. }
  4363. if (ur.Cells["Value3"].Text == "-")
  4364. {
  4365. return;
  4366. }
  4367. ur.Cells["AverageValue"].Value = Math.Round(((double.Parse(ur.Cells["Value1"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value2"].Text.Replace('<', '-').ToString3()) + double.Parse(ur.Cells["Value3"].Text.Replace('<', '-').ToString3())) / m), 0).ToString();
  4368. }
  4369. }
  4370. private void ultraGrid27_AfterRowActivate(object sender, EventArgs e)
  4371. {
  4372. UltraGridRow uRow = this.ultraGrid27.ActiveRow;
  4373. if(uRow.HasChild())
  4374. {
  4375. return;
  4376. }
  4377. if(uRow == null)
  4378. {
  4379. return;
  4380. }
  4381. List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
  4382. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPHYNoFrim", new object[] { uRow.Cells["CheckNo"].Value.ToString(), "3", arrId, ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  4383. PipeCheckconsignDetailEntitybindingSource2.DataSource = listSource;
  4384. }
  4385. //private void ultraGrid27_CellChange(object sender, CellEventArgs e)
  4386. //{
  4387. // if (e.Cell.Row.HasChild() && e.Cell.Column.Key == "CHK")
  4388. // {
  4389. // ultraGrid27.UpdateData();
  4390. // if (e.Cell.Value.ToString() == "True")
  4391. // {
  4392. // foreach (UltraGridRow dr in e.Cell.Row.ChildBands[0].Rows)
  4393. // {
  4394. // dr.Cells["CHK1"].Value = "True";
  4395. // }
  4396. // }
  4397. // else
  4398. // {
  4399. // foreach (UltraGridRow dr in e.Cell.Row.ChildBands[0].Rows)
  4400. // {
  4401. // dr.Cells["CHK1"].Value = "False";
  4402. // }
  4403. // }
  4404. // }
  4405. //}
  4406. private void ultraGrid40_AfterRowActivate(object sender, EventArgs e)
  4407. {
  4408. UltraGridRow uRow = this.ultraGrid40.ActiveRow;
  4409. if (uRow.HasChild())
  4410. {
  4411. return;
  4412. }
  4413. if (uRow == null)
  4414. {
  4415. return;
  4416. }
  4417. List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
  4418. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPHYFrim", new object[] { uRow.Cells["CheckNo"].Value.ToString(), arrId, ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
  4419. PipeCheckconsignDetailEntitybindingSource3.DataSource = listSource;
  4420. List<PipeCheckconsignDetailEntity> listSource1 = EntityHelper.GetData<PipeCheckconsignDetailEntity>(
  4421. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryDetaiFlag", new object[] { uRow.Cells["CheckNo"].Value.ToString(), arrId }, this.ob);
  4422. pipeCheckconsignDetailEntityBindingSource7.DataSource = listSource1;
  4423. for(int i = 0;i<ultraGrid54.Rows.Count;i++)
  4424. {
  4425. if (this.ultraGrid54.Rows[i].Cells["Flag"].Text != "已审核" && this.ultraGrid54.Rows[i].Cells["Flag"].Text != "判定已接收")
  4426. {
  4427. ultraGrid54.Rows[i].RowSelectorAppearance.BackColor = Color.Red;
  4428. }
  4429. }
  4430. }
  4431. //private void ultraGrid40_CellChange(object sender, CellEventArgs e)
  4432. //{
  4433. // if (e.Cell.Row.HasChild() && e.Cell.Column.Key == "CHK")
  4434. // {
  4435. // ultraGrid40.UpdateData();
  4436. // if (e.Cell.Value.ToString() == "True")
  4437. // {
  4438. // foreach (UltraGridRow dr in e.Cell.Row.ChildBands[0].Rows)
  4439. // {
  4440. // dr.Cells["CHK1"].Value = "True";
  4441. // }
  4442. // }
  4443. // else
  4444. // {
  4445. // foreach (UltraGridRow dr in e.Cell.Row.ChildBands[0].Rows)
  4446. // {
  4447. // dr.Cells["CHK1"].Value = "False";
  4448. // }
  4449. // }
  4450. // }
  4451. //}
  4452. private void ultraGrid41_AfterRowActivate(object sender, EventArgs e)
  4453. {
  4454. ultraTabControl5.Visible = true;
  4455. ultraTabControl3.Visible = false;
  4456. ultraTabControl4.Visible = false;
  4457. ultraTabControl2.Visible = false;
  4458. //PipeCheckconsignPhydetailEntitybindingSource.Clear();
  4459. //PipeCheckconsignPhydetailEntityCjbindingSource.Clear();
  4460. //PipeCheckconsignPhydetailEntityLSbindingSource.Clear();
  4461. //PipeCheckconsignPhydetailEntityWSbindingSource.Clear();
  4462. //PipeCheckconsignPhydetailEntityBSbindingSource.Clear();
  4463. //PipeCheckconsignPhydetailEntityJZWbindingSource.Clear();
  4464. //PipeCheckconsignPhydetailEntityJLDbindingSource.Clear();
  4465. //PipeCheckconsignPhydetailEntityZZbindingSource.Clear();
  4466. //PipeCheckconsignPhydetailEntityYBbindingSource.Clear();
  4467. //PipeCheckconsignPhydetailEntityWQbindingSource.Clear();
  4468. //PipeCheckconsignPhydetailEntityKKbindingSource.Clear();
  4469. UltraGridRow row = this.ultraGrid41.ActiveRow;
  4470. List<PipeCheckconsignPhydetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignPhydetailEntity>(
  4471. "com.steering.lims.data.outdec.FrmOutdecDataCJBase.queryCheckConsignBaseDetailPhyItem", new object[] { row.Cells["CheckNo"].Value.ToString(), row.Cells["SampleNo"].Value.ToString(), row.Cells["PhyCodeMax"].Value.ToString() }, this.ob);
  4472. if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0001"))//拉伸
  4473. {
  4474. PipeCheckconsignPhydetailEntitybindingSource.DataSource = listSource;
  4475. ultraTabControl5.Tabs["0"].Selected = true;
  4476. ultraTabControl5.Tabs["0"].Visible = true;
  4477. ultraTabControl5.Tabs["1"].Visible = false;
  4478. ultraTabControl5.Tabs["2"].Visible = false;
  4479. ultraTabControl5.Tabs["3"].Visible = false;
  4480. ultraTabControl5.Tabs["4"].Visible = false;
  4481. ultraTabControl5.Tabs["5"].Visible = false;
  4482. ultraTabControl5.Tabs["6"].Visible = false;
  4483. ultraTabControl5.Tabs["7"].Visible = false;
  4484. ultraTabControl5.Tabs["8"].Visible = false;
  4485. ultraTabControl5.Tabs["9"].Visible = false;
  4486. ultraTabControl5.Tabs["10"].Visible = false;
  4487. ultraTabControl5.Tabs["11"].Visible = false;
  4488. }
  4489. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0002"))//冲击
  4490. {
  4491. PipeCheckconsignPhydetailEntityCjbindingSource.DataSource = listSource;
  4492. ultraTabControl5.Tabs["1"].Selected = true;
  4493. ultraTabControl5.Tabs["0"].Visible = false;
  4494. ultraTabControl5.Tabs["1"].Visible = true;
  4495. ultraTabControl5.Tabs["2"].Visible = false;
  4496. ultraTabControl5.Tabs["3"].Visible = false;
  4497. ultraTabControl5.Tabs["4"].Visible = false;
  4498. ultraTabControl5.Tabs["5"].Visible = false;
  4499. ultraTabControl5.Tabs["6"].Visible = false;
  4500. ultraTabControl5.Tabs["7"].Visible = false;
  4501. ultraTabControl5.Tabs["8"].Visible = false;
  4502. ultraTabControl5.Tabs["9"].Visible = false;
  4503. ultraTabControl5.Tabs["10"].Visible = false;
  4504. ultraTabControl5.Tabs["11"].Visible = false;
  4505. }
  4506. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0003"))//布氏
  4507. {
  4508. PipeCheckconsignPhydetailEntityBSbindingSource.DataSource = listSource;
  4509. MergedCell(ultraGrid6, new string[] { "PhyName" });
  4510. ultraTabControl5.Tabs["4"].Selected = true;
  4511. ultraTabControl5.Tabs["0"].Visible = false;
  4512. ultraTabControl5.Tabs["1"].Visible = false;
  4513. ultraTabControl5.Tabs["2"].Visible = false;
  4514. ultraTabControl5.Tabs["3"].Visible = false;
  4515. ultraTabControl5.Tabs["4"].Visible = true;
  4516. ultraTabControl5.Tabs["5"].Visible = false;
  4517. ultraTabControl5.Tabs["6"].Visible = false;
  4518. ultraTabControl5.Tabs["7"].Visible = false;
  4519. ultraTabControl5.Tabs["8"].Visible = false;
  4520. ultraTabControl5.Tabs["9"].Visible = false;
  4521. ultraTabControl5.Tabs["10"].Visible = false;
  4522. ultraTabControl5.Tabs["11"].Visible = false;
  4523. }
  4524. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0004") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0018"))//洛氏
  4525. {
  4526. PipeCheckconsignPhydetailEntityLSbindingSource.DataSource = listSource;
  4527. MergedCell(ultraGrid5, new string[] { "PhyName" });
  4528. ultraTabControl5.Tabs["2"].Selected = true;
  4529. ultraTabControl5.Tabs["0"].Visible = false;
  4530. ultraTabControl5.Tabs["1"].Visible = false;
  4531. ultraTabControl5.Tabs["2"].Visible = true;
  4532. ultraTabControl5.Tabs["3"].Visible = false;
  4533. ultraTabControl5.Tabs["4"].Visible = false;
  4534. ultraTabControl5.Tabs["5"].Visible = false;
  4535. ultraTabControl5.Tabs["6"].Visible = false;
  4536. ultraTabControl5.Tabs["7"].Visible = false;
  4537. ultraTabControl5.Tabs["8"].Visible = false;
  4538. ultraTabControl5.Tabs["9"].Visible = false;
  4539. ultraTabControl5.Tabs["10"].Visible = false;
  4540. ultraTabControl5.Tabs["11"].Visible = false;
  4541. }
  4542. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0005"))//维氏
  4543. {
  4544. PipeCheckconsignPhydetailEntityWSbindingSource.DataSource = listSource;
  4545. MergedCell(ultraGrid5, new string[] { "PhyName" });
  4546. ultraTabControl5.Tabs["3"].Selected = true;
  4547. ultraTabControl5.Tabs["0"].Visible = false;
  4548. ultraTabControl5.Tabs["1"].Visible = false;
  4549. ultraTabControl5.Tabs["2"].Visible = false;
  4550. ultraTabControl5.Tabs["3"].Visible = true;
  4551. ultraTabControl5.Tabs["4"].Visible = false;
  4552. ultraTabControl5.Tabs["5"].Visible = false;
  4553. ultraTabControl5.Tabs["6"].Visible = false;
  4554. ultraTabControl5.Tabs["7"].Visible = false;
  4555. ultraTabControl5.Tabs["8"].Visible = false;
  4556. ultraTabControl5.Tabs["9"].Visible = false;
  4557. ultraTabControl5.Tabs["10"].Visible = false;
  4558. ultraTabControl5.Tabs["11"].Visible = false;
  4559. }
  4560. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0014") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0016") || row.Cells["PhyCodeMin"].Value.ToString().Equals("R0031"))//组织
  4561. {
  4562. PipeCheckconsignPhydetailEntityZZbindingSource.DataSource = listSource;
  4563. ultraTabControl5.Tabs["7"].Selected = true;
  4564. ultraTabControl5.Tabs["0"].Visible = false;
  4565. ultraTabControl5.Tabs["1"].Visible = false;
  4566. ultraTabControl5.Tabs["2"].Visible = false;
  4567. ultraTabControl5.Tabs["3"].Visible = false;
  4568. ultraTabControl5.Tabs["4"].Visible = false;
  4569. ultraTabControl5.Tabs["5"].Visible = false;
  4570. ultraTabControl5.Tabs["6"].Visible = false;
  4571. ultraTabControl5.Tabs["7"].Visible = true;
  4572. ultraTabControl5.Tabs["8"].Visible = false;
  4573. ultraTabControl5.Tabs["9"].Visible = false;
  4574. ultraTabControl5.Tabs["10"].Visible = false;
  4575. ultraTabControl5.Tabs["11"].Visible = false;
  4576. }
  4577. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0013"))//晶粒度
  4578. {
  4579. PipeCheckconsignPhydetailEntityJLDbindingSource.DataSource = listSource;
  4580. ultraTabControl5.Tabs["6"].Selected = true;
  4581. ultraTabControl5.Tabs["0"].Visible = false;
  4582. ultraTabControl5.Tabs["1"].Visible = false;
  4583. ultraTabControl5.Tabs["2"].Visible = false;
  4584. ultraTabControl5.Tabs["3"].Visible = false;
  4585. ultraTabControl5.Tabs["4"].Visible = false;
  4586. ultraTabControl5.Tabs["5"].Visible = false;
  4587. ultraTabControl5.Tabs["6"].Visible = true;
  4588. ultraTabControl5.Tabs["7"].Visible = false;
  4589. ultraTabControl5.Tabs["8"].Visible = false;
  4590. ultraTabControl5.Tabs["9"].Visible = false;
  4591. ultraTabControl5.Tabs["10"].Visible = false;
  4592. ultraTabControl5.Tabs["11"].Visible = false;
  4593. }
  4594. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0012"))//夹杂
  4595. {
  4596. PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource = listSource;
  4597. ultraTabControl5.Tabs["5"].Selected = true;
  4598. ultraTabControl5.Tabs["0"].Visible = false;
  4599. ultraTabControl5.Tabs["1"].Visible = false;
  4600. ultraTabControl5.Tabs["2"].Visible = false;
  4601. ultraTabControl5.Tabs["3"].Visible = false;
  4602. ultraTabControl5.Tabs["4"].Visible = false;
  4603. ultraTabControl5.Tabs["5"].Visible = true;
  4604. ultraTabControl5.Tabs["6"].Visible = false;
  4605. ultraTabControl5.Tabs["7"].Visible = false;
  4606. ultraTabControl5.Tabs["8"].Visible = false;
  4607. ultraTabControl5.Tabs["9"].Visible = false;
  4608. ultraTabControl5.Tabs["10"].Visible = false;
  4609. ultraTabControl5.Tabs["11"].Visible = false;
  4610. ultraGrid47.DisplayLayout.Bands[0].Columns["Value1"].Header.Caption = "一象限";
  4611. ultraGrid47.DisplayLayout.Bands[0].Columns["Value2"].Header.Caption = "二象限";
  4612. ultraGrid47.DisplayLayout.Bands[0].Columns["Value3"].Header.Caption = "三象限";
  4613. ultraGrid47.DisplayLayout.Bands[0].Columns["Value4"].Header.Caption = "四象限";
  4614. if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0115"))
  4615. {
  4616. ultraGrid47.DisplayLayout.Bands[0].Columns["Value2"].Hidden = false;
  4617. ultraGrid47.DisplayLayout.Bands[0].Columns["Value3"].Hidden = false;
  4618. ultraGrid47.DisplayLayout.Bands[0].Columns["Value4"].Hidden = false;
  4619. }
  4620. else
  4621. {
  4622. ultraGrid47.DisplayLayout.Bands[0].Columns["Value2"].Hidden = true;
  4623. ultraGrid47.DisplayLayout.Bands[0].Columns["Value3"].Hidden = true;
  4624. ultraGrid47.DisplayLayout.Bands[0].Columns["Value4"].Hidden = true;
  4625. }
  4626. }
  4627. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0010"))//工艺
  4628. {
  4629. if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0027") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0038") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0082") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0083") || row.Cells["PhyCodeMax"].Value.ToString().Equals("C0098"))//弯曲
  4630. {
  4631. PipeCheckconsignPhydetailEntityWQbindingSource.DataSource = listSource;
  4632. ultraTabControl5.Tabs["9"].Selected = true;
  4633. ultraTabControl5.Tabs["0"].Visible = false;
  4634. ultraTabControl5.Tabs["1"].Visible = false;
  4635. ultraTabControl5.Tabs["2"].Visible = false;
  4636. ultraTabControl5.Tabs["3"].Visible = false;
  4637. ultraTabControl5.Tabs["4"].Visible = false;
  4638. ultraTabControl5.Tabs["5"].Visible = false;
  4639. ultraTabControl5.Tabs["6"].Visible = false;
  4640. ultraTabControl5.Tabs["7"].Visible = false;
  4641. ultraTabControl5.Tabs["8"].Visible = false;
  4642. ultraTabControl5.Tabs["9"].Visible = true;
  4643. ultraTabControl5.Tabs["10"].Visible = false;
  4644. ultraTabControl5.Tabs["11"].Visible = false;
  4645. }
  4646. else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0009"))//压扁
  4647. {
  4648. PipeCheckconsignPhydetailEntityYBbindingSource.DataSource = listSource;
  4649. ultraTabControl5.Tabs["8"].Selected = true;
  4650. ultraTabControl5.Tabs["0"].Visible = false;
  4651. ultraTabControl5.Tabs["1"].Visible = false;
  4652. ultraTabControl5.Tabs["2"].Visible = false;
  4653. ultraTabControl5.Tabs["3"].Visible = false;
  4654. ultraTabControl5.Tabs["4"].Visible = false;
  4655. ultraTabControl5.Tabs["5"].Visible = false;
  4656. ultraTabControl5.Tabs["6"].Visible = false;
  4657. ultraTabControl5.Tabs["7"].Visible = false;
  4658. ultraTabControl5.Tabs["8"].Visible = true;
  4659. ultraTabControl5.Tabs["9"].Visible = false;
  4660. ultraTabControl5.Tabs["10"].Visible = false;
  4661. ultraTabControl5.Tabs["11"].Visible = false;
  4662. ultraGrid50.DisplayLayout.Bands[0].Columns["IsGood"].Header.Caption = "试验结果(一次)";
  4663. ultraGrid50.DisplayLayout.Bands[0].Columns["IsDefect"].Header.Caption = "试验结果(二次)";
  4664. }
  4665. else if (row.Cells["PhyCodeMax"].Value.ToString().Equals("C0026"))//扩口
  4666. {
  4667. PipeCheckconsignPhydetailEntityKKbindingSource.DataSource = listSource;
  4668. ultraTabControl5.Tabs["10"].Selected = true;
  4669. ultraTabControl5.Tabs["0"].Visible = false;
  4670. ultraTabControl5.Tabs["1"].Visible = false;
  4671. ultraTabControl5.Tabs["2"].Visible = false;
  4672. ultraTabControl5.Tabs["3"].Visible = false;
  4673. ultraTabControl5.Tabs["4"].Visible = false;
  4674. ultraTabControl5.Tabs["5"].Visible = false;
  4675. ultraTabControl5.Tabs["6"].Visible = false;
  4676. ultraTabControl5.Tabs["7"].Visible = false;
  4677. ultraTabControl5.Tabs["8"].Visible = false;
  4678. ultraTabControl5.Tabs["9"].Visible = false;
  4679. ultraTabControl5.Tabs["10"].Visible = true;
  4680. ultraTabControl5.Tabs["11"].Visible = false;
  4681. }
  4682. }
  4683. else if (row.Cells["PhyCodeMin"].Value.ToString().Equals("R0050"))
  4684. {
  4685. pipeCheckconsignPhydetailEntityQTBindingSource.DataSource = listSource;
  4686. ultraTabControl5.Tabs["11"].Selected = true;
  4687. ultraTabControl5.Tabs["0"].Visible = false;
  4688. ultraTabControl5.Tabs["1"].Visible = false;
  4689. ultraTabControl5.Tabs["2"].Visible = false;
  4690. ultraTabControl5.Tabs["3"].Visible = false;
  4691. ultraTabControl5.Tabs["4"].Visible = false;
  4692. ultraTabControl5.Tabs["5"].Visible = false;
  4693. ultraTabControl5.Tabs["6"].Visible = false;
  4694. ultraTabControl5.Tabs["7"].Visible = false;
  4695. ultraTabControl5.Tabs["8"].Visible = false;
  4696. ultraTabControl5.Tabs["9"].Visible = false;
  4697. ultraTabControl5.Tabs["10"].Visible = false;
  4698. ultraTabControl5.Tabs["11"].Visible = true;
  4699. ultraGrid57.DisplayLayout.Bands[0].Columns["AverageValue"].Header.Caption = "最小值";
  4700. }
  4701. }
  4702. private void ultraGrid8_CellChange(object sender, CellEventArgs e)
  4703. {
  4704. this.ultraGrid8.UpdateData();
  4705. if (e.Cell.Column.Key == "Value1")
  4706. {
  4707. if(!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) && e.Cell.Row.Cells["Value1"].Value.ToString2() == "")
  4708. {
  4709. return;
  4710. //if (!(e.Cell.Row.Cells["Value1"].Value.ToString2().Substring(e.Cell.Row.Cells["Value1"].Value.ToString2().Length - 1, 1)).Equals("0") && !(e.Cell.Row.Cells["Value1"].Value.ToString2().Substring(e.Cell.Row.Cells["Value1"].Value.ToString2().Length - 1, 1)).Equals("5"))
  4711. //{
  4712. // MessageUtil.ShowTips("末尾位只能是0或者5");
  4713. // return;
  4714. //}
  4715. }
  4716. List<PipeCheckconsignPhydetailEntity> list = PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource as List<PipeCheckconsignPhydetailEntity>;
  4717. list.Where(p => p.PhyCode == "P0064").ToList().ForEach(p =>
  4718. {
  4719. p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057" || q.PhyCode == "P0060" || q.PhyCode == "P0061").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)细系总和
  4720. });
  4721. list.Where(p => p.PhyCode == "P0065").ToList().ForEach(p =>
  4722. {
  4723. p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058" || q.PhyCode == "P0059" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)粗系总和
  4724. });
  4725. list.Where(p => p.PhyCode == "P0069").ToList().ForEach(p =>
  4726. {
  4727. p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+C)粗系总和
  4728. });
  4729. list.Where(p => p.PhyCode == "P0070").ToList().ForEach(p =>
  4730. {
  4731. p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+C)细系总和
  4732. });
  4733. list.Where(p => p.PhyCode == "P0071").ToList().ForEach(p =>
  4734. {
  4735. p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057" || q.PhyCode == "P0060").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C)细系总和
  4736. });
  4737. list.Where(p => p.PhyCode == "P0072").ToList().ForEach(p =>
  4738. {
  4739. p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C)粗系总和
  4740. });
  4741. list.Where(p => p.PhyCode == "P0085").ToList().ForEach(p =>
  4742. {
  4743. p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0056" || q.PhyCode == "P0057" || q.PhyCode == "P0058" || q.PhyCode == "P0059" || q.PhyCode == "P0060" || q.PhyCode == "P0061" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)粗细系总和
  4744. });
  4745. list.Where(p => p.PhyCode == "P0090").ToList().ForEach(p =>
  4746. {
  4747. p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B)粗系总和
  4748. });
  4749. list.Where(p => p.PhyCode == "P0091").ToList().ForEach(p =>
  4750. {
  4751. p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B)细系总和
  4752. });
  4753. list.Where(p => p.PhyCode == "P0096").ToList().ForEach(p =>
  4754. {
  4755. p.Value1 = list.Where(q => q.PhyCode == "P0058" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(B+D)粗系总和
  4756. });
  4757. list.Where(p => p.PhyCode == "P0097").ToList().ForEach(p =>
  4758. {
  4759. p.Value1 = list.Where(q => q.PhyCode == "P0057" || q.PhyCode == "P0061").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(B+D)粗系总和
  4760. });
  4761. ultraGrid8.Refresh();
  4762. }
  4763. }
  4764. private void ultraGrid21_CellChange(object sender, CellEventArgs e)
  4765. {
  4766. this.ultraGrid21.UpdateData();
  4767. if (e.Cell.Column.Key == "Value1")
  4768. {
  4769. List<PipeCheckconsignPhydetailEntity> list = PipeCheckconsignPhydetailEntityJZWbindingSource.DataSource as List<PipeCheckconsignPhydetailEntity>;
  4770. list.Where(p => p.PhyCode == "P0064").ToList().ForEach(p =>
  4771. {
  4772. p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057" || q.PhyCode == "P0060" || q.PhyCode == "P0061").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)细系总和
  4773. });
  4774. list.Where(p => p.PhyCode == "P0065").ToList().ForEach(p =>
  4775. {
  4776. p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058" || q.PhyCode == "P0059" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)粗系总和
  4777. });
  4778. list.Where(p => p.PhyCode == "P0069").ToList().ForEach(p =>
  4779. {
  4780. p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+C)粗系总和
  4781. });
  4782. list.Where(p => p.PhyCode == "P0070").ToList().ForEach(p =>
  4783. {
  4784. p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+C)细系总和
  4785. });
  4786. list.Where(p => p.PhyCode == "P0071").ToList().ForEach(p =>
  4787. {
  4788. p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057" || q.PhyCode == "P0060").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C)细系总和
  4789. });
  4790. list.Where(p => p.PhyCode == "P0072").ToList().ForEach(p =>
  4791. {
  4792. p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058" || q.PhyCode == "P0059").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C)粗系总和
  4793. });
  4794. list.Where(p => p.PhyCode == "P0085").ToList().ForEach(p =>
  4795. {
  4796. p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0056" || q.PhyCode == "P0057" || q.PhyCode == "P0058" || q.PhyCode == "P0059" || q.PhyCode == "P0060" || q.PhyCode == "P0061" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B+C+D)粗细系总和
  4797. });
  4798. list.Where(p => p.PhyCode == "P0090").ToList().ForEach(p =>
  4799. {
  4800. p.Value1 = list.Where(q => q.PhyCode == "P0056" || q.PhyCode == "P0058").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B)粗系总和
  4801. });
  4802. list.Where(p => p.PhyCode == "P0091").ToList().ForEach(p =>
  4803. {
  4804. p.Value1 = list.Where(q => q.PhyCode == "P0052" || q.PhyCode == "P0057").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(A+B)细系总和
  4805. });
  4806. list.Where(p => p.PhyCode == "P0096").ToList().ForEach(p =>
  4807. {
  4808. p.Value1 = list.Where(q => q.PhyCode == "P0058" || q.PhyCode == "P0062").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(B+D)粗系总和
  4809. });
  4810. list.Where(p => p.PhyCode == "P0097").ToList().ForEach(p =>
  4811. {
  4812. p.Value1 = list.Where(q => q.PhyCode == "P0057" || q.PhyCode == "P0061").Sum(q => double.Parse(q.Value1.ToString3())).ToString();//(B+D)粗系总和
  4813. });
  4814. ultraGrid21.Refresh();
  4815. }
  4816. }
  4817. private void ultraGrid10_CellChange(object sender, CellEventArgs e)
  4818. {
  4819. this.ultraGrid10.UpdateData();
  4820. if (e.Cell.Column.Key == "Value1")
  4821. {
  4822. if (StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3())) return;
  4823. }
  4824. }
  4825. private void chkRegTime_CheckedChanged(object sender, EventArgs e)
  4826. {
  4827. this.RegStartTime.Enabled = this.RegEndTime.Enabled = this.chkRegTime.Checked;
  4828. }
  4829. private void chkCheckNo_CheckedChanged(object sender, EventArgs e)
  4830. {
  4831. this.txtCheckNo.Enabled = this.chkCheckNo.Checked;
  4832. }
  4833. private void chkJudgeNo_CheckedChanged(object sender, EventArgs e)
  4834. {
  4835. this.txtJudgeNo.Enabled = this.chkJudgeNo.Checked;
  4836. }
  4837. private void chkSteel_CheckedChanged(object sender, EventArgs e)
  4838. {
  4839. this.txtSteel.Enabled = this.chkSteel.Checked;
  4840. }
  4841. private void chkGroup_CheckedChanged(object sender, EventArgs e)
  4842. {
  4843. this.cmbGroup.Enabled = this.chkGroup.Checked;
  4844. }
  4845. private void chkSampleNo_CheckedChanged(object sender, EventArgs e)
  4846. {
  4847. this.txtSampleNo.Enabled = this.chkSampleNo.Checked;
  4848. }
  4849. private void chkOrderNo_CheckedChanged(object sender, EventArgs e)
  4850. {
  4851. this.txtOrderNo.Enabled = this.chkOrderNo.Checked;
  4852. }
  4853. private void chkSpec_CheckedChanged(object sender, EventArgs e)
  4854. {
  4855. this.txtSpec.Enabled = this.chkSpec.Checked;
  4856. }
  4857. private void ultraGrid24_AfterRowActivate(object sender, EventArgs e)
  4858. {
  4859. this.ultraGrid24.UpdateData();
  4860. UltraGridRow row = this.ultraGrid24.ActiveRow;
  4861. if (row == null) return;
  4862. ultraTxtYbEuestion.Text = row.Cells["CalculationFormula"].Text;
  4863. ultraTxtYbC.Text = row.Cells["Value7"].Text;
  4864. ultraTxtYbSpac.Text = row.Cells["Value8"].Text;
  4865. ultraTxtYbQualfiled.Text = row.Cells["IsGood"].Text;
  4866. ultraTxtYbDefect.Text = row.Cells["IsDefect"].Text;
  4867. ultraTxtYbMemo.Text = row.Cells["Remark"].Text;
  4868. }
  4869. private void ultraGrid25_AfterRowActivate(object sender, EventArgs e)
  4870. {
  4871. this.ultraGrid25.UpdateData();
  4872. UltraGridRow row = this.ultraGrid25.ActiveRow;
  4873. if (row == null) return;
  4874. ultraTxtWqDiameter.Text = row.Cells["Value9"].Text;
  4875. ultraTxtWqAngle.Text = row.Cells["Value10"].Text;
  4876. ultraTxtWqQualfiled.Text = row.Cells["IsGood"].Text;
  4877. ultraTxtWqMemo.Text = row.Cells["Remark"].Text;
  4878. }
  4879. private void ultraGrid26_AfterRowActivate(object sender, EventArgs e)
  4880. {
  4881. this.ultraGrid26.UpdateData();
  4882. UltraGridRow row = this.ultraGrid26.ActiveRow;
  4883. if (row == null) return;
  4884. ultraTxtKkTop.Text = row.Cells["Value11"].Text;
  4885. ultraTxtKkFlarRate.Text = row.Cells["Value12"].Text;
  4886. ultraTxtKkGood.Text = row.Cells["IsGood"].Text;
  4887. ultraTxtKkMemo.Text = row.Cells["Remark"].Text;
  4888. }
  4889. private void ultraComMethod_ValueChanged(object sender, EventArgs e)
  4890. {
  4891. DataTable ds = PublicServer.GetData("com.steering.lims.data.outdec.FrmOutdecDataCJBase.doQueryMothName", new object[] { this.ultraComMethod.Value.ToString2() }, ob);
  4892. if(ds.Rows.Count > 0)
  4893. {
  4894. ultraComMethodName.DataSource = ds;
  4895. ultraComMethodName.ValueMember = "STD_ID";
  4896. }
  4897. ultraComMethodName.SelectedIndex = 0;
  4898. }
  4899. private void chkIsProuctor_CheckedChanged(object sender, EventArgs e)
  4900. {
  4901. this.cmbIsProductor.Enabled = this.chkIsProuctor.Checked;
  4902. }
  4903. private void chkType_CheckedChanged(object sender, EventArgs e)
  4904. {
  4905. this.cmbType.Enabled = this.chkType.Checked;
  4906. }
  4907. private void chkPrintK_CheckedChanged(object sender, EventArgs e)
  4908. {
  4909. this.cmbPrintK.Enabled = this.chkPrintK.Checked;
  4910. }
  4911. private void ultraGrid53_CellChange(object sender, CellEventArgs e)
  4912. {
  4913. this.ultraGrid53.UpdateData();
  4914. UltraGridRow ur = this.ultraGrid53.ActiveRow;
  4915. int m = 0;
  4916. double min = 0.0;
  4917. if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3")
  4918. {
  4919. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3()))
  4920. {
  4921. return;
  4922. }
  4923. min = double.Parse(ur.Cells["Value1"].Text.ToString3());
  4924. if (double.Parse(ur.Cells["Value2"].Text.ToString3()) < min)
  4925. {
  4926. min = double.Parse(ur.Cells["Value2"].Text.ToString3());
  4927. }
  4928. if (double.Parse(ur.Cells["Value3"].Text.ToString3()) < min)
  4929. {
  4930. min = double.Parse(ur.Cells["Value3"].Text.ToString3());
  4931. }
  4932. ur.Cells["AverageValue"].Value = Math.Round(min, 3).ToString();
  4933. }
  4934. }
  4935. private void ultraGrid55_CellChange(object sender, CellEventArgs e)
  4936. {
  4937. this.ultraGrid55.UpdateData();
  4938. UltraGridRow ur = this.ultraGrid55.ActiveRow;
  4939. int m = 0;
  4940. double min = 0.0;
  4941. if (e.Cell.Column.Key == "Value1" || e.Cell.Column.Key == "Value2" || e.Cell.Column.Key == "Value3")
  4942. {
  4943. if (!StringUtil.IsDouble(e.Cell.Row.Cells["Value1"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value2"].Value.ToString3()) || !StringUtil.IsDouble(e.Cell.Row.Cells["Value3"].Value.ToString3()))
  4944. {
  4945. return;
  4946. }
  4947. min = double.Parse(ur.Cells["Value1"].Text.ToString3());
  4948. if (double.Parse(ur.Cells["Value2"].Text.ToString3()) < min)
  4949. {
  4950. min = double.Parse(ur.Cells["Value2"].Text.ToString3());
  4951. }
  4952. if (double.Parse(ur.Cells["Value3"].Text.ToString3()) < min)
  4953. {
  4954. min = double.Parse(ur.Cells["Value3"].Text.ToString3());
  4955. }
  4956. ur.Cells["AverageValue"].Value = Math.Round(min, 3).ToString();
  4957. }
  4958. }
  4959. }
  4960. }