F_MST_0204.cs 125 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_MST_0204.cs
  5. * 2.功能描述:范围权限
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 王鑫 2014/09/17 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Data;
  12. using System.Windows.Forms;
  13. using Dongke.IBOSS.PRD.Basics.BaseControls;
  14. using Dongke.IBOSS.PRD.Basics.BaseResources;
  15. using Dongke.IBOSS.PRD.Basics.Library;
  16. using Dongke.IBOSS.PRD.Client.CommonModule;
  17. using Dongke.IBOSS.PRD.WCF.Proxys;
  18. namespace Dongke.IBOSS.PRD.Client.SystemModule
  19. {
  20. /// <summary>
  21. /// 范围权限
  22. /// </summary>
  23. public partial class F_MST_0204 : FormBase
  24. {
  25. #region 成员变量
  26. // 传过来的用户ID
  27. private int _userID;
  28. // 页面的数据源
  29. DataSet _userRightData;
  30. // 是否是第一次加载页面
  31. bool _isFirstLoad = true;
  32. //查看工号权限
  33. bool _viewUser = false; //默认是否选中
  34. // 工号权限
  35. bool _user = false; //默认是否选中
  36. // 查看成型线
  37. bool _viewGroutingLine = false;
  38. // 操作成型线
  39. bool _groutingLine = false;//
  40. // 操作温湿度
  41. bool _thermometer = false;
  42. // 查看温湿度
  43. bool _viewThermometer = false;
  44. // 操作部门
  45. bool _organization = false;
  46. // 查看部门
  47. bool _viewOrganization = false;
  48. // 操作工序
  49. bool _proceduce = false;
  50. // 操作生产线
  51. bool _productionline = false;
  52. // 查看工序
  53. bool _viewProceduce = false;
  54. // 取消工序
  55. bool _cancelProceduce = false;
  56. // 取消生产线
  57. bool _cancelProductionline = false;
  58. // 查看生产线
  59. bool _viewProductionline = false;
  60. #endregion
  61. #region 构造函数
  62. public F_MST_0204()
  63. {
  64. InitializeComponent();
  65. }
  66. public F_MST_0204(int userID)
  67. {
  68. InitializeComponent();
  69. this._userID = userID;
  70. // 设置标题
  71. this.Text = FormTitles.F_MST_0204;
  72. // 工具栏按钮文本赋值
  73. this.btnSave.Text = ButtonText.BTN_SAVE;
  74. this.btnCancel.Text = ButtonText.BTN_CLOSE;
  75. }
  76. public F_MST_0204(int userID, string userCode)
  77. {
  78. InitializeComponent();
  79. this._userID = userID;
  80. // 设置标题
  81. this.Text = FormTitles.F_MST_0204;
  82. // 工具栏按钮文本赋值
  83. this.btnSave.Text = ButtonText.BTN_SAVE;
  84. this.btnCancel.Text = ButtonText.BTN_CLOSE;
  85. this.lblUserCode.Text += userCode;
  86. }
  87. #endregion
  88. #region 事件
  89. /// <summary>
  90. /// 窗体加载事件
  91. /// </summary>
  92. /// <param name="sender"></param>
  93. /// <param name="e"></param>
  94. private void F_MST_0204_Load(object sender, EventArgs e)
  95. {
  96. try
  97. {
  98. // 保存按钮不可用
  99. //this.btnSave.Enabled = false;
  100. this._userRightData = (DataSet)DoAsync(new BaseAsyncMethod(this.GetUserRightData));
  101. if (this._userRightData != null && this._userRightData.Tables.Count >= Constant.INT_IS_ZERO)
  102. {
  103. //查看业务部门树的生成
  104. this.InitOrganizationTreeView(this._userRightData.Tables[0], true);
  105. this.tvwViewOrganization.ExpandAll();
  106. // 操作业务部门树的生成
  107. this.InitOrganizationTreeView(this._userRightData.Tables[1], false);
  108. this.tvwOrganization.ExpandAll();
  109. // 设置DataGridView属性
  110. this.dgvViewUser.AutoGenerateColumns = false;
  111. this.dgvViewUser.Columns[5].ReadOnly = true;
  112. // 工号权限的绑定
  113. this.dgvViewUser.DataSource = this._userRightData.Tables[2];
  114. // 设置DataGridView属性
  115. this.dgvUser.AutoGenerateColumns = false;
  116. this.dgvUser.Columns[5].ReadOnly = true;
  117. // 工号权限的绑定
  118. this.dgvUser.DataSource = this._userRightData.Tables[3];
  119. // 设置DataGridView属性
  120. this.dgvViewGroutingLine.AutoGenerateColumns = false;
  121. this.dgvViewGroutingLine.Columns[3].ReadOnly = true;
  122. // 查看成型线权限的绑定
  123. this.dgvViewGroutingLine.DataSource = this._userRightData.Tables[4];
  124. // 设置DataGridView属性
  125. this.dgvGroutingLine.AutoGenerateColumns = false;
  126. this.dgvGroutingLine.Columns[3].ReadOnly = true;
  127. // 操作成型线权限的绑定
  128. this.dgvGroutingLine.DataSource = this._userRightData.Tables[5];
  129. // 生成查看生产线及工序树
  130. InitGroutingLineTreeView(this._userRightData.Tables[6], this._userRightData.Tables[8]);
  131. this.tvwGroutinProductionLine.ExpandAll();
  132. InitGroutingLineTreeCKView(this._userRightData.Tables[7], this._userRightData.Tables[9]);
  133. this.tvwGroutinProductionLineCK.ExpandAll();
  134. // 撤销工序范围 InitCancelTreeCKView
  135. DataTable dtCopy = this._userRightData.Tables[6].Copy();
  136. dtCopy.TableName = "newtable";
  137. foreach(DataRow dr in dtCopy.Rows)
  138. {
  139. dr["purviewtype"] = -99;
  140. dr["RightFlag"] = 0;
  141. }
  142. dtCopy.AcceptChanges();
  143. this._userRightData.Tables.Add(dtCopy);
  144. InitCancelTreeCKView(dtCopy, this._userRightData.Tables[12]);
  145. this.treeViewCancel.ExpandAll();
  146. // 设置DataGridView属性
  147. this.dgvViewThermometer.AutoGenerateColumns = false;
  148. this.dgvViewThermometer.Columns[3].ReadOnly = true;
  149. // 查看温湿计权限的绑定
  150. this.dgvViewThermometer.DataSource = this._userRightData.Tables[10];
  151. // 设置DataGridView属性
  152. this.dgvThermometer.AutoGenerateColumns = false;
  153. this.dgvThermometer.Columns[3].ReadOnly = true;
  154. // 操作温湿计权限的绑定
  155. this.dgvThermometer.DataSource = this._userRightData.Tables[11];
  156. //绑定不限制复选框
  157. BindFunctionCodeAll(this._userRightData);
  158. }
  159. this._isFirstLoad = false;
  160. this.btnSave.Enabled = true;
  161. }
  162. catch (Exception ex)
  163. {
  164. // 对异常进行共通处理
  165. ExceptionManager.HandleEventException(this.ToString(),
  166. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  167. }
  168. }
  169. /// <summary>
  170. /// 绑定不限制复选框
  171. /// </summary>
  172. private void BindFunctionCodeAll(DataSet dsRightData)
  173. {
  174. //查看部门权限
  175. DataRow[] drViewOrg = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=1");
  176. if (drViewOrg.Length > 0)
  177. {
  178. this._viewOrganization = true;
  179. this.chkViewOrganizationFunctionCodeAll.Checked = true;
  180. }
  181. //操作部门权限
  182. DataRow[] drOrg = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=2");
  183. if (drOrg.Length > 0)
  184. {
  185. this._organization = true;
  186. this.chkOrganizationFunctionCodeAll.Checked = true;
  187. }
  188. //查看工号范围权限
  189. DataRow[] drViewUser = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=3");
  190. if (drViewUser.Length > 0)
  191. {
  192. this._viewUser = true; //默认是有的
  193. this.chkViewUserFunctionCodeAll.Checked = true;
  194. }
  195. //操作工号范围权限
  196. DataRow[] drUser = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=4");
  197. if (drUser.Length > 0)
  198. {
  199. this._user = true;
  200. this.chkUserFunctionCodeAll1.Checked = true;
  201. }
  202. //查看成型线范围权限
  203. DataRow[] drViewGroutingLine = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=5");
  204. if (drViewGroutingLine.Length > 0)
  205. {
  206. this._viewGroutingLine = true;
  207. this.chkViewGroutingLinerFunctionCodeAll.Checked = true;
  208. }
  209. //操作成型线范围权限
  210. DataRow[] drGroutingLine = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=6");
  211. if (drGroutingLine.Length > 0)
  212. {
  213. this._groutingLine = true;
  214. this.chkGroutingLinerFunctionCodeAll.Checked = true;
  215. }
  216. //查看生产线范围权限
  217. DataRow[] drViewProductionLine = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=7");
  218. if (drViewProductionLine.Length > 0)
  219. {
  220. this._viewProductionline = true;
  221. this.chkViewProductionlineFunctionCodeAll.Checked = true;
  222. }
  223. //查看工序 范围权限
  224. DataRow[] drViewProceduce = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=9");
  225. if (drViewProceduce.Length > 0)
  226. {
  227. this._viewProceduce = true;
  228. this.chkViewProceduceFunctionCodeAll.Checked = true;
  229. }
  230. //操作生产线范围权限
  231. DataRow[] drProductionLine = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=8");
  232. if (drProductionLine.Length > 0)
  233. {
  234. this._productionline = true;
  235. this.chkProductionlineFunctionCodeAll.Checked = true;
  236. }
  237. //操作工序范围权限
  238. DataRow[] drProceduce = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=10");
  239. if (drProceduce.Length > 0)
  240. {
  241. this._proceduce = true;
  242. this.chkProceduceFunctionCodeAll.Checked = true;
  243. }
  244. //查看温湿计范围权限
  245. DataRow[] drViewThermometer = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=11");
  246. if (drViewThermometer.Length > 0)
  247. {
  248. this._viewThermometer = true;
  249. this.chkViewThermometerFunctionCodeAll.Checked = true;
  250. }
  251. //操作温湿计范围权限
  252. DataRow[] drThermometer = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=12");
  253. if (drThermometer.Length > 0)
  254. {
  255. this._thermometer = true;
  256. this.chkThermometerFunctionCodeAll.Checked = true;
  257. }
  258. //取消工序 范围权限
  259. DataRow[] drCancelProceduce = dsRightData.Tables[13].Select("PurviewID=-1 and PurviewType=13");
  260. if (drCancelProceduce.Length > 0)
  261. {
  262. this._cancelProceduce = true;
  263. this.chkCancelProceduceFunctionCodeAll.Checked = true;
  264. }
  265. }
  266. /// <summary>
  267. /// 窗体关闭时事件
  268. /// </summary>
  269. /// <param name="sender"></param>
  270. /// <param name="e"></param>
  271. private void F_MST_0204_FormClosing(object sender, FormClosingEventArgs e)
  272. {
  273. try
  274. {
  275. // 判断数据是否被修改过,修改过需要提示保存消息
  276. if (DataJudge.IsChange(this._userRightData))
  277. //if (this.btnSave.Enabled)
  278. {
  279. DialogResult result = MessageBox.Show(Messages.MSG_CMN_Q001, this.Text,
  280. MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
  281. if (result == DialogResult.Yes)
  282. {
  283. // 保存数据
  284. btnSave_Click(sender, e);
  285. }
  286. else if (result == DialogResult.Cancel)
  287. {
  288. e.Cancel = true;
  289. }
  290. }
  291. }
  292. catch (Exception ex)
  293. {
  294. // 对异常进行共通处理
  295. ExceptionManager.HandleEventException(this.ToString(),
  296. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  297. }
  298. }
  299. /// <summary>
  300. /// 部门查看权限全选按钮事件
  301. /// </summary>
  302. /// <param name="sender"></param>
  303. /// <param name="e"></param>
  304. private void chkViewOrganizationChooseAll_CheckedChanged(object sender, EventArgs e)
  305. {
  306. this.CheckTreeview(this.tvwViewOrganization, this.chkViewOrganizationChooseAll.Checked);
  307. }
  308. /// <summary>
  309. /// 查看业务部门树形全部展开
  310. /// </summary>
  311. /// <param name="sender"></param>
  312. /// <param name="e"></param>
  313. private void btnViewOrganizationExpand_Click(object sender, EventArgs e)
  314. {
  315. this.tvwViewOrganization.ExpandAll();
  316. }
  317. /// <summary>
  318. /// 查看业务部门树形全部收缩
  319. /// </summary>
  320. /// <param name="sender"></param>
  321. /// <param name="e"></param>
  322. private void btnViewOrganizationCollapse_Click(object sender, EventArgs e)
  323. {
  324. this.tvwViewOrganization.CollapseAll();
  325. }
  326. /// <summary>
  327. /// 组织机构范围权限的子节点选择后,父节点自动选择
  328. /// 父节点选择之后,子节点自动选择
  329. /// 选择之后修改后台数据源
  330. /// </summary>
  331. /// <param name="sender"></param>
  332. /// <param name="e"></param>
  333. private void tvwViewOrganization_AfterCheck(object sender, TreeViewEventArgs e)
  334. {
  335. try
  336. {
  337. int purviewID = Convert.ToInt32(e.Node.Tag);
  338. foreach (DataRow dataRow in _userRightData.Tables[0].Rows)
  339. {
  340. if (purviewID == Convert.ToInt32(dataRow["PurviewID"]))
  341. {
  342. dataRow["RightFlag"] = e.Node.Checked;
  343. break;
  344. }
  345. }
  346. //if (!this._isFirstLoad)
  347. //{
  348. // // 保存按钮状态改变
  349. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  350. //}
  351. //this.btnSave.Enabled = true;
  352. }
  353. catch (Exception ex)
  354. {
  355. // 对异常进行共通处理
  356. ExceptionManager.HandleEventException(this.ToString(),
  357. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  358. }
  359. }
  360. /// <summary>
  361. /// 窗体关闭
  362. /// </summary>
  363. /// <param name="sender"></param>
  364. /// <param name="e"></param>
  365. private void btnCancel_Click(object sender, EventArgs e)
  366. {
  367. this.Close();
  368. }
  369. //保存按钮事件
  370. private void btnSave_Click(object sender, EventArgs e)
  371. {
  372. try
  373. {
  374. this.btnSave.Enabled = false;
  375. this.btnCancel.Enabled = false;
  376. int returnAffectRows = (int)DoAsync(new BaseAsyncMethod(SaveUserRightInfo));
  377. this.btnSave.Enabled = true;
  378. this.btnCancel.Enabled = true;
  379. if (returnAffectRows > Constant.INT_IS_ZERO)
  380. {
  381. this._userRightData.AcceptChanges();
  382. //this.btnSave.Enabled = false;
  383. // 提示信息
  384. MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "修改用户范围权限", "保存"),
  385. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  386. this.Close();
  387. }
  388. else
  389. {
  390. // 提示信息
  391. MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "修改用户范围权限", "保存"),
  392. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  393. }
  394. }
  395. catch (Exception ex)
  396. {
  397. this.btnSave.Enabled = true;
  398. this.btnCancel.Enabled = true;
  399. // 对异常进行共通处理
  400. ExceptionManager.HandleEventException(this.ToString(),
  401. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  402. }
  403. }
  404. /// <summary>
  405. /// 操作部门树结点改变
  406. /// </summary>
  407. /// <param name="sender"></param>
  408. /// <param name="e"></param>
  409. private void tvwOrganization_AfterCheck(object sender, TreeViewEventArgs e)
  410. {
  411. try
  412. {
  413. int purviewID = Convert.ToInt32(e.Node.Tag);
  414. foreach (DataRow dataRow in _userRightData.Tables[1].Rows)
  415. {
  416. if (purviewID == Convert.ToInt32(dataRow["PurviewID"]))
  417. {
  418. dataRow["RightFlag"] = e.Node.Checked;
  419. break;
  420. }
  421. }
  422. //if (!this._isFirstLoad)
  423. //{
  424. // // 保存按钮状态改变
  425. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  426. //}
  427. //this.btnSave.Enabled = true;
  428. }
  429. catch (Exception ex)
  430. {
  431. // 对异常进行共通处理
  432. ExceptionManager.HandleEventException(this.ToString(),
  433. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  434. }
  435. }
  436. // <summary>
  437. /// 操作业务部门树形全部选中或者全部取消选中
  438. /// </summary>
  439. /// <param name="sender"></param>
  440. /// <param name="e"></param>
  441. private void chkOrganizationChooseAll_CheckedChanged(object sender, EventArgs e)
  442. {
  443. this.CheckTreeview(this.tvwOrganization, this.chkOrganizationChooseAll.Checked);
  444. }
  445. /// <summary>
  446. /// 操作业务部门树形全部展开
  447. /// </summary>
  448. /// <param name="sender"></param>
  449. /// <param name="e"></param>
  450. private void btnOrganizationExpand_Click(object sender, EventArgs e)
  451. {
  452. this.tvwOrganization.ExpandAll();
  453. }
  454. /// <summary>
  455. /// 操作业务部门树形全部收缩
  456. /// </summary>
  457. /// <param name="sender"></param>
  458. /// <param name="e"></param>
  459. private void btnOrganizationCollapse_Click(object sender, EventArgs e)
  460. {
  461. this.tvwOrganization.CollapseAll();
  462. }
  463. /// <summary>
  464. /// 操作员范围选择发生改变,保存按钮状态
  465. /// </summary>
  466. /// <param name="sender"></param>
  467. /// <param name="e"></param>
  468. private void dgvUser_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  469. {
  470. //if (!this._isFirstLoad)
  471. //{
  472. // // 保存按钮状态改变
  473. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  474. //}
  475. //this.btnSave.Enabled = true;
  476. }
  477. /// <summary>
  478. /// 操作员范围权限全部选中或者取消
  479. /// </summary>
  480. /// <param name="sender"></param>
  481. /// <param name="e"></param>
  482. private void chkUserChooseAll_CheckedChanged(object sender, EventArgs e)
  483. {
  484. DataTable returnData = (DataTable)this.dgvViewUser.DataSource;
  485. if (returnData != null)
  486. {
  487. int rightFlag = Convert.ToInt16(chkUserChooseAll.Checked);
  488. for (int i = 0; i < returnData.Rows.Count; i++)
  489. {
  490. returnData.Rows[i]["RightFlag"] = rightFlag;
  491. }
  492. //if (!this._isFirstLoad)
  493. //{
  494. // // 保存按钮状态改变
  495. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  496. //}
  497. //this.btnSave.Enabled = true;
  498. }
  499. }
  500. // <summary>
  501. /// 操作员范围选择发生改变,保存按钮状态
  502. /// </summary>
  503. /// <param name="sender"></param>
  504. /// <param name="e"></param>
  505. private void dgvUser_CellValueChanged_1(object sender, DataGridViewCellEventArgs e)
  506. {
  507. //if (!this._isFirstLoad)
  508. //{
  509. // // 保存按钮状态改变
  510. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  511. //}
  512. //this.btnSave.Enabled = true;
  513. }
  514. /// <summary>
  515. /// 工号范围权限复选框改变事件
  516. /// </summary>
  517. /// <param name="sender"></param>
  518. /// <param name="e"></param>
  519. private void chkUserChoose_CheckedChanged(object sender, EventArgs e)
  520. {
  521. DataTable returnData = (DataTable)this.dgvUser.DataSource;
  522. if (returnData != null)
  523. {
  524. int rightFlag = Convert.ToInt16(chkUserChoose.Checked);
  525. for (int i = 0; i < returnData.Rows.Count; i++)
  526. {
  527. returnData.Rows[i]["RightFlag"] = rightFlag;
  528. }
  529. //if (!this._isFirstLoad)
  530. //{
  531. // // 保存按钮状态改变
  532. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  533. //}
  534. //this.btnSave.Enabled = true;
  535. }
  536. }
  537. /// <summary>
  538. /// 生产线单元格值改变
  539. /// </summary>
  540. /// <param name="sender"></param>
  541. /// <param name="e"></param>
  542. private void dgvViewGroutingLine_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  543. {
  544. //if (!this._isFirstLoad)
  545. //{
  546. // // 保存按钮状态改变
  547. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  548. //}
  549. //this.btnSave.Enabled = true;
  550. }
  551. /// <summary>
  552. /// 查看成型范围权限复选框事件
  553. /// </summary>
  554. /// <param name="sender"></param>
  555. /// <param name="e"></param>
  556. private void chkViewGroutingLineChooseAll_CheckedChanged(object sender, EventArgs e)
  557. {
  558. DataTable returnData = (DataTable)this.dgvViewGroutingLine.DataSource;
  559. if (returnData != null)
  560. {
  561. int rightFlag = Convert.ToInt16(chkViewGroutingLineChooseAll.Checked);
  562. for (int i = 0; i < returnData.Rows.Count; i++)
  563. {
  564. returnData.Rows[i]["RightFlag"] = rightFlag;
  565. }
  566. //if (!this._isFirstLoad)
  567. //{
  568. // // 保存按钮状态改变
  569. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  570. //}
  571. //this.btnSave.Enabled = true;
  572. }
  573. }
  574. /// <summary>
  575. /// 操作成型生产线单元格值改变
  576. /// </summary>
  577. /// <param name="sender"></param>
  578. /// <param name="e"></param>
  579. private void dgvGroutingLine_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  580. {
  581. //if (!this._isFirstLoad)
  582. //{
  583. // // 保存按钮状态改变
  584. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  585. //}
  586. //this.btnSave.Enabled = true;
  587. }
  588. /// <summary>
  589. /// 操作成型生产线复选框选中事件
  590. /// </summary>
  591. /// <param name="sender"></param>
  592. /// <param name="e"></param>
  593. private void chkGroutingLineChooseAll_CheckedChanged(object sender, EventArgs e)
  594. {
  595. DataTable returnData = (DataTable)this.dgvGroutingLine.DataSource;
  596. if (returnData != null)
  597. {
  598. int rightFlag = Convert.ToInt16(chkGroutingLineChooseAll.Checked);
  599. for (int i = 0; i < returnData.Rows.Count; i++)
  600. {
  601. returnData.Rows[i]["RightFlag"] = rightFlag;
  602. }
  603. //if (!this._isFirstLoad)
  604. //{
  605. // // 保存按钮状态改变
  606. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  607. //}
  608. //this.btnSave.Enabled = true;
  609. }
  610. }
  611. /// <summary>
  612. /// 操作生产线单元格值改变
  613. /// </summary>
  614. /// <param name="sender"></param>
  615. /// <param name="e"></param>
  616. private void dgvProductionLine_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  617. {
  618. //if (!this._isFirstLoad)
  619. //{
  620. // // 保存按钮状态改变
  621. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  622. //}
  623. //this.btnSave.Enabled = true;
  624. }
  625. /// <summary>
  626. /// 查看生产线及工序范围权限选中改变事件
  627. /// </summary>
  628. /// <param name="sender"></param>
  629. /// <param name="e"></param>
  630. private void tvwGroutinProductionLine_AfterCheck(object sender, TreeViewEventArgs e)
  631. {
  632. try
  633. {
  634. int purviewID = Convert.ToInt32(e.Node.Tag);
  635. //起始为ProductionLine_为成型生产线,否则为工序
  636. foreach (DataRow dataRow in (e.Node.Name.StartsWith("ProductionLine_") ? _userRightData.Tables[6].Rows : _userRightData.Tables[8].Rows))
  637. {
  638. if (purviewID == Convert.ToInt32(dataRow["PurviewID"]))
  639. {
  640. dataRow["RightFlag"] = e.Node.Checked;
  641. break;
  642. }
  643. if (e.Node.Parent != null)
  644. {
  645. if (e.Node.Checked)
  646. e.Node.Parent.Checked = true;
  647. }
  648. }
  649. //if (!this._isFirstLoad)
  650. //{
  651. // // 保存按钮状态改变
  652. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  653. //}
  654. //this.btnSave.Enabled = true;
  655. }
  656. catch (Exception ex)
  657. {
  658. // 对异常进行共通处理
  659. ExceptionManager.HandleEventException(this.ToString(),
  660. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  661. }
  662. }
  663. /// <summary>
  664. /// 查看生产线及工序权限全选
  665. /// </summary>
  666. /// <param name="sender"></param>
  667. /// <param name="e"></param>
  668. private void chkProductionProceduceChooseAll_CheckedChanged(object sender, EventArgs e)
  669. {
  670. this.CheckTreeview(this.tvwGroutinProductionLine, this.chkProductionProceduceChooseAll.Checked);
  671. }
  672. /// <summary>
  673. /// 查看生产线及工序范围权限展开
  674. /// </summary>
  675. /// <param name="sender"></param>
  676. /// <param name="e"></param>
  677. private void btnViewProductionLineExpand_Click(object sender, EventArgs e)
  678. {
  679. this.tvwGroutinProductionLine.ExpandAll();
  680. }
  681. /// <summary>
  682. /// 查看生产线及工序范围权限收缩
  683. /// </summary>
  684. /// <param name="sender"></param>
  685. /// <param name="e"></param>
  686. private void btnProductionCollapse_Click(object sender, EventArgs e)
  687. {
  688. this.tvwGroutinProductionLine.CollapseAll();
  689. }
  690. /// <summary>
  691. /// 操作工序范围权限单元格值改变事件
  692. /// </summary>
  693. /// <param name="sender"></param>
  694. /// <param name="e"></param>
  695. private void dgvProcedure_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  696. {
  697. //if (!this._isFirstLoad)
  698. //{
  699. // // 保存按钮状态改变
  700. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  701. //}
  702. //this.btnSave.Enabled = true;
  703. }
  704. /// <summary>
  705. /// 温湿计查看权限改变后
  706. /// </summary>
  707. /// <param name="sender"></param>
  708. /// <param name="e"></param>
  709. private void dgvViewThermometer_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  710. {
  711. //if (!this._isFirstLoad)
  712. //{
  713. // // 保存按钮状态改变
  714. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  715. //}
  716. //this.btnSave.Enabled = true;
  717. }
  718. /// <summary>
  719. /// 温湿计范围权限改变后
  720. /// </summary>
  721. /// <param name="sender"></param>
  722. /// <param name="e"></param>
  723. private void dgvThermometer_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  724. {
  725. //if (!this._isFirstLoad)
  726. //{
  727. // // 保存按钮状态改变
  728. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  729. //}
  730. //this.btnSave.Enabled = true;
  731. }
  732. /// <summary>
  733. /// 操作工序范围选定值改变后
  734. /// </summary>
  735. /// <param name="sender"></param>
  736. /// <param name="e"></param>
  737. private void tvwGroutinProductionLineCK_AfterCheck(object sender, TreeViewEventArgs e)
  738. {
  739. try
  740. {
  741. int purviewID = Convert.ToInt32(e.Node.Tag);
  742. //起始为ProductionLine_为成型生产线,否则为工序
  743. foreach (DataRow dataRow in (e.Node.Name.StartsWith("ProductionLine_") ? _userRightData.Tables[7].Rows : _userRightData.Tables[9].Rows))
  744. {
  745. if (purviewID == Convert.ToInt32(dataRow["PurviewID"]))
  746. {
  747. dataRow["RightFlag"] = e.Node.Checked;
  748. break;
  749. }
  750. if (e.Node.Parent != null)
  751. {
  752. if (e.Node.Checked)
  753. e.Node.Parent.Checked = true;
  754. }
  755. }
  756. //if (!this._isFirstLoad)
  757. //{
  758. // // 保存按钮状态改变
  759. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  760. //}
  761. //this.btnSave.Enabled = true;
  762. }
  763. catch (Exception ex)
  764. {
  765. // 对异常进行共通处理
  766. ExceptionManager.HandleEventException(this.ToString(),
  767. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  768. }
  769. }
  770. /// <summary>
  771. /// 操作工序范围权限全选改变事件
  772. /// </summary>
  773. /// <param name="sender"></param>
  774. /// <param name="e"></param>
  775. private void chkProcedureChooseAll_CheckedChanged(object sender, EventArgs e)
  776. {
  777. this.CheckTreeview(this.tvwGroutinProductionLineCK, this.chkProcedureChooseAll.Checked);
  778. }
  779. /// <summary>
  780. /// 操作工序展开所有节点
  781. /// </summary>
  782. /// <param name="sender"></param>
  783. /// <param name="e"></param>
  784. private void btnCKOpen_Click(object sender, EventArgs e)
  785. {
  786. this.tvwGroutinProductionLineCK.ExpandAll();
  787. }
  788. /// <summary>
  789. /// 操作工序折叠所有节点
  790. /// </summary>
  791. /// <param name="sender"></param>
  792. /// <param name="e"></param>
  793. private void btnCKClose_Click(object sender, EventArgs e)
  794. {
  795. this.tvwGroutinProductionLineCK.CollapseAll();
  796. }
  797. /// <summary>
  798. /// 查看温湿计复选框选中事件
  799. /// </summary>
  800. /// <param name="sender"></param>
  801. /// <param name="e"></param>
  802. private void cbThermometerVAll_CheckedChanged(object sender, EventArgs e)
  803. {
  804. DataTable returnData = (DataTable)this.dgvViewThermometer.DataSource;
  805. if (returnData != null)
  806. {
  807. int rightFlag = Convert.ToInt16(cbThermometerVAll.Checked);
  808. for (int i = 0; i < returnData.Rows.Count; i++)
  809. {
  810. returnData.Rows[i]["RightFlag"] = rightFlag;
  811. }
  812. //if (!this._isFirstLoad)
  813. //{
  814. // // 保存按钮状态改变
  815. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  816. //}
  817. //this.btnSave.Enabled = true;
  818. }
  819. }
  820. /// <summary>
  821. /// 操作温湿计复选框选中事件
  822. /// </summary>
  823. /// <param name="sender"></param>
  824. /// <param name="e"></param>
  825. private void cbThermometerAll_CheckedChanged(object sender, EventArgs e)
  826. {
  827. DataTable returnData = (DataTable)this.dgvThermometer.DataSource;
  828. if (returnData != null)
  829. {
  830. int rightFlag = Convert.ToInt16(cbThermometerAll.Checked);
  831. for (int i = 0; i < returnData.Rows.Count; i++)
  832. {
  833. returnData.Rows[i]["RightFlag"] = rightFlag;
  834. }
  835. //if (!this._isFirstLoad)
  836. //{
  837. // // 保存按钮状态改变
  838. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  839. //}
  840. //this.btnSave.Enabled = true;
  841. }
  842. }
  843. #endregion
  844. #region 私有方法
  845. /// 获取员工档案数据集
  846. /// </summary>
  847. /// <returns></returns>
  848. private DataSet GetUserRightData()
  849. {
  850. return SystemModuleProxy.Service.GetUserRightData(this._userID);
  851. }
  852. /// <summary>
  853. /// 根据取得的数据,生成部门树
  854. /// </summary>
  855. /// <param name="treeTable"></param>
  856. /// <param name="isViewOrganization">是否是查看部门</param>
  857. private void InitOrganizationTreeView(DataTable treeTable, bool isViewOrganization)
  858. {
  859. try
  860. {
  861. TreeNode node = null;
  862. DataRow[] organizationRows = treeTable.Select
  863. ("OrganizationCode LIKE '0%' AND LEN(OrganizationCode) = 3");
  864. // 递归生成功能权限树
  865. this.InitTreeView(treeTable, organizationRows, node, isViewOrganization);
  866. }
  867. catch (Exception ex)
  868. {
  869. throw ex;
  870. }
  871. }
  872. /// <summary>
  873. /// 递归创建部门树
  874. /// </summary>
  875. /// <param name="treeTable"></param>
  876. /// <param name="rows"></param>
  877. /// <param name="node"></param>
  878. private void InitTreeView(DataTable treeTable, DataRow[] rows, TreeNode node, bool isViewOrganization)
  879. {
  880. foreach (DataRow row in rows)
  881. {
  882. TreeNode sNode;
  883. if (node == null)
  884. {
  885. sNode = new TreeNode();
  886. sNode.Text = '[' + row["OrganizationCode"].ToString() + ']' + row["OrganizationName"].ToString();
  887. sNode.Name = row["OrganizationCode"].ToString();
  888. sNode.Tag = row["PurviewID"];
  889. if (Convert.ToBoolean(row["RightFlag"]))
  890. {
  891. sNode.Checked = true;
  892. }
  893. if (isViewOrganization)
  894. {
  895. this.tvwViewOrganization.Nodes.Add(sNode);
  896. }
  897. else
  898. {
  899. this.tvwOrganization.Nodes.Add(sNode);
  900. }
  901. }
  902. else
  903. {
  904. sNode = node.Nodes.Add('[' + row["OrganizationCode"].ToString() + ']' + row["OrganizationName"].ToString());
  905. sNode.Name = row["OrganizationCode"].ToString();
  906. sNode.Tag = row["PurviewID"];
  907. if (Convert.ToBoolean(row["RightFlag"]))
  908. {
  909. sNode.Checked = true;
  910. }
  911. }
  912. string filterExpression = "OrganizationCode LIKE '" + row["OrganizationCode"].ToString()
  913. + "%' AND LEN(OrganizationCode) = " + (row["OrganizationCode"].ToString().Length + 3);
  914. DataRow[] subRows = treeTable.Select(filterExpression);
  915. // 递归方法
  916. InitTreeView(treeTable, subRows, sNode, isViewOrganization);
  917. }
  918. }
  919. /// <summary>
  920. /// 将全部节点选择或者取消选中
  921. /// </summary>
  922. /// <param name="treeView"></param>
  923. /// <param name="flag"></param>
  924. private void CheckTreeview(TreeView treeView, bool flag)
  925. {
  926. TreeNodeCollection nodes = treeView.Nodes;
  927. foreach (TreeNode node in nodes)
  928. {
  929. CheckSubNodes(node, flag);
  930. }
  931. }
  932. /// <summary>
  933. /// 递归选中节点或者取消选中节点
  934. /// </summary>
  935. /// <param name="treeNode"></param>
  936. /// <param name="flag"></param>
  937. private void CheckSubNodes(TreeNode treeNode, bool flag)
  938. {
  939. treeNode.Checked = flag;
  940. foreach (TreeNode node in treeNode.Nodes)
  941. {
  942. CheckSubNodes(node, flag);
  943. }
  944. }
  945. /// <summary>
  946. /// 保存用户范围权限
  947. /// </summary>
  948. /// <returns>更新数据影响的行数</returns>
  949. private object SaveUserRightInfo()
  950. {
  951. try
  952. {
  953. if (chkViewOrganizationFunctionCodeAll.Checked || chkAll.Checked)
  954. {
  955. // 查看部门权限
  956. if (this._userRightData.Tables[0].Select("PurviewID=-1 and PurviewType=1").Length == 0)
  957. {
  958. DataRow r1 = _userRightData.Tables[0].NewRow();
  959. r1["PurviewID"] = -1;
  960. r1["PurviewType"] = 1;
  961. r1["RightFlag"] = chkViewOrganizationFunctionCodeAll.Checked ? 1 : 0;
  962. _userRightData.Tables[0].Rows.Add(r1);
  963. _userRightData.Tables[0].AcceptChanges();
  964. }
  965. }
  966. if (chkOrganizationFunctionCodeAll.Checked || chkAll.Checked)
  967. {
  968. // 操作部门权限
  969. if (this._userRightData.Tables[1].Select("PurviewID=-1 and PurviewType=2").Length == 0)
  970. {
  971. DataRow r1 = _userRightData.Tables[1].NewRow();
  972. r1["PurviewID"] = -1;
  973. r1["PurviewType"] = 2;
  974. r1["RightFlag"] = 1;
  975. _userRightData.Tables[1].Rows.Add(r1);
  976. _userRightData.Tables[1].AcceptChanges();
  977. }
  978. }
  979. if (chkViewUserFunctionCodeAll.Checked || chkAll.Checked)
  980. {
  981. // 查看工号权限
  982. if (this._userRightData.Tables[2].Select("PurviewID=-1 and PurviewType=3").Length == 0)
  983. {
  984. DataRow r1 = _userRightData.Tables[2].NewRow();
  985. r1["PurviewID"] = -1;
  986. r1["PurviewType"] = 3;
  987. r1["RightFlag"] = 1;
  988. _userRightData.Tables[2].Rows.Add(r1);
  989. _userRightData.Tables[2].AcceptChanges();
  990. }
  991. }
  992. if (chkUserFunctionCodeAll1.Checked || chkAll.Checked)
  993. {
  994. // 操作工号权限
  995. if (this._userRightData.Tables[3].Select("PurviewID=-1 and PurviewType=4").Length == 0)
  996. {
  997. DataRow r1 = _userRightData.Tables[3].NewRow();
  998. r1["PurviewID"] = -1;
  999. r1["PurviewType"] = 4;
  1000. r1["RightFlag"] = 1;
  1001. _userRightData.Tables[3].Rows.Add(r1);
  1002. _userRightData.Tables[3].AcceptChanges();
  1003. }
  1004. }
  1005. if (chkViewGroutingLinerFunctionCodeAll.Checked || chkAll.Checked)
  1006. {
  1007. // 查看成型线权限
  1008. if (this._userRightData.Tables[4].Select("PurviewID=-1 and PurviewType=5").Length == 0)
  1009. {
  1010. DataRow r1 = _userRightData.Tables[4].NewRow();
  1011. r1["PurviewID"] = -1;
  1012. r1["PurviewType"] = 5;
  1013. r1["RightFlag"] = 1;
  1014. _userRightData.Tables[4].Rows.Add(r1);
  1015. _userRightData.Tables[4].AcceptChanges();
  1016. }
  1017. }
  1018. if (chkGroutingLinerFunctionCodeAll.Checked || chkAll.Checked)
  1019. {
  1020. // 操作成型线权限
  1021. if (this._userRightData.Tables[5].Select("PurviewID=-1 and PurviewType=6").Length == 0)
  1022. {
  1023. DataRow r1 = _userRightData.Tables[5].NewRow();
  1024. r1["PurviewID"] = -1;
  1025. r1["PurviewType"] = 6;
  1026. r1["RightFlag"] = 1;
  1027. _userRightData.Tables[5].Rows.Add(r1);
  1028. _userRightData.Tables[5].AcceptChanges();
  1029. }
  1030. }
  1031. if (chkViewThermometerFunctionCodeAll.Checked || chkAll.Checked)
  1032. {
  1033. // 查看温湿度权限
  1034. if (this._userRightData.Tables[10].Select("PurviewID=-1 and PurviewType=11").Length == 0)
  1035. {
  1036. DataRow r1 = _userRightData.Tables[10].NewRow();
  1037. r1["PurviewID"] = -1;
  1038. r1["PurviewType"] = 11;
  1039. r1["RightFlag"] = 1;
  1040. _userRightData.Tables[10].Rows.Add(r1);
  1041. _userRightData.Tables[10].AcceptChanges();
  1042. }
  1043. }
  1044. if (chkThermometerFunctionCodeAll.Checked || chkAll.Checked)
  1045. {
  1046. // 操作温湿度权限
  1047. if (this._userRightData.Tables[11].Select("PurviewID=-1 and PurviewType=12").Length == 0)
  1048. {
  1049. DataRow r1 = _userRightData.Tables[11].NewRow();
  1050. r1["PurviewID"] = -1;
  1051. r1["PurviewType"] = 12;
  1052. r1["RightFlag"] = 1;
  1053. _userRightData.Tables[11].Rows.Add(r1);
  1054. _userRightData.Tables[11].AcceptChanges();
  1055. }
  1056. }
  1057. if (chkViewProductionlineFunctionCodeAll.Checked || chkAll.Checked)
  1058. {
  1059. // 查看生产线权限
  1060. if (this._userRightData.Tables[6].Select("PurviewID=-1 and PurviewType=7").Length == 0)
  1061. {
  1062. DataRow r1 = _userRightData.Tables[6].NewRow();
  1063. r1["PurviewID"] = -1;
  1064. r1["PurviewType"] = 7;
  1065. r1["RightFlag"] = 1;
  1066. _userRightData.Tables[6].Rows.Add(r1);
  1067. _userRightData.Tables[6].AcceptChanges();
  1068. }
  1069. }
  1070. if (chkViewProceduceFunctionCodeAll.Checked || chkAll.Checked)
  1071. {
  1072. // 查看工序权限
  1073. if (this._userRightData.Tables[8].Select("PurviewID=-1 and PurviewType=9").Length == 0)
  1074. {
  1075. DataRow r1 = _userRightData.Tables[8].NewRow();
  1076. r1["PurviewID"] = -1;
  1077. r1["PurviewType"] = 9;
  1078. r1["RightFlag"] = 1;
  1079. _userRightData.Tables[8].Rows.Add(r1);
  1080. _userRightData.Tables[8].AcceptChanges();
  1081. }
  1082. }
  1083. if (chkProductionlineFunctionCodeAll.Checked || chkAll.Checked)
  1084. {
  1085. // 操作生产线权限
  1086. if (this._userRightData.Tables[7].Select("PurviewID=-1 and PurviewType=8").Length == 0)
  1087. {
  1088. DataRow r1 = _userRightData.Tables[7].NewRow();
  1089. r1["PurviewID"] = -1;
  1090. r1["PurviewType"] = 8;
  1091. r1["RightFlag"] = 1;
  1092. _userRightData.Tables[7].Rows.Add(r1);
  1093. _userRightData.Tables[7].AcceptChanges();
  1094. }
  1095. }
  1096. if (chkProceduceFunctionCodeAll.Checked || chkAll.Checked)
  1097. {
  1098. // 操作工序权限
  1099. if (this._userRightData.Tables[9].Select("PurviewID=-1 and PurviewType=10").Length == 0)
  1100. {
  1101. DataRow r1 = _userRightData.Tables[9].NewRow();
  1102. r1["PurviewID"] = -1;
  1103. r1["PurviewType"] = 10;
  1104. r1["RightFlag"] = 1;
  1105. _userRightData.Tables[9].Rows.Add(r1);
  1106. _userRightData.Tables[9].AcceptChanges();
  1107. }
  1108. }
  1109. if (chkCancelProceduceFunctionCodeAll.Checked || chkAll.Checked)
  1110. {
  1111. // 取消工序权限
  1112. if (this._userRightData.Tables[12].Select("PurviewID=-1 and PurviewType=13").Length == 0)
  1113. {
  1114. DataRow r1 = _userRightData.Tables[12].NewRow();
  1115. r1["PurviewID"] = -1;
  1116. r1["PurviewType"] = 13;
  1117. r1["RightFlag"] = 1;
  1118. _userRightData.Tables[12].Rows.Add(r1);
  1119. _userRightData.Tables[12].AcceptChanges();
  1120. }
  1121. }
  1122. return SystemModuleProxy.Service.SaveUserRight(_userRightData, _userID);
  1123. }
  1124. catch (Exception ex)
  1125. {
  1126. throw ex;
  1127. }
  1128. }
  1129. /// <summary>
  1130. /// 生成查看成型线树
  1131. /// </summary>
  1132. /// <param name="GroutingLineTable"></param>
  1133. /// <param name="ProductionLineTable"></param>
  1134. private void InitGroutingLineTreeView(DataTable GroutingLineTable, DataTable ProductionLineTable)
  1135. {
  1136. foreach (DataRow row in GroutingLineTable.Rows)
  1137. {
  1138. TreeNode sNode;
  1139. sNode = new TreeNode();
  1140. sNode.Text = '[' + row["ProductionLineCode"].ToString() + ']' + row["ProductionLinename"].ToString();
  1141. sNode.Name = "ProductionLine_" + row["ProductionLineCode"].ToString();
  1142. sNode.Tag = row["PurviewID"];
  1143. if (Convert.ToBoolean(row["RightFlag"]))
  1144. {
  1145. sNode.Checked = true;
  1146. }
  1147. this.tvwGroutinProductionLine.Nodes.Add(sNode);
  1148. InitGroutingProductionTreeView(sNode, ProductionLineTable);
  1149. }
  1150. }
  1151. /// <summary>
  1152. /// 加载查看工序树结点
  1153. /// </summary>
  1154. /// <param name="GroutingLineTable"></param>
  1155. /// <param name="ProductionLineTable"></param>
  1156. private void InitGroutingLineTreeCKView(DataTable GroutingLineTable, DataTable ProductionLineTable)
  1157. {
  1158. foreach (DataRow row in GroutingLineTable.Rows)
  1159. {
  1160. TreeNode sNode;
  1161. sNode = new TreeNode();
  1162. sNode.Text = '[' + row["ProductionLineCode"].ToString() + ']' + row["ProductionLinename"].ToString();
  1163. sNode.Name = "ProductionLine_" + row["ProductionLineCode"].ToString();
  1164. sNode.Tag = row["PurviewID"];
  1165. if (Convert.ToBoolean(row["RightFlag"]))
  1166. {
  1167. sNode.Checked = true;
  1168. }
  1169. this.tvwGroutinProductionLineCK.Nodes.Add(sNode);
  1170. InitGroutingProductionTreeView(sNode, ProductionLineTable);
  1171. }
  1172. }
  1173. #region 取消工序
  1174. /// <summary>
  1175. /// 加载查看工序树结点
  1176. /// </summary>
  1177. /// <param name="GroutingLineTable"></param>
  1178. /// <param name="ProductionLineTable"></param>
  1179. private void InitCancelTreeCKView(DataTable GroutingLineTable, DataTable ProductionLineTable)
  1180. {
  1181. foreach (DataRow row in GroutingLineTable.Rows)
  1182. {
  1183. TreeNode sNode;
  1184. sNode = new TreeNode();
  1185. sNode.Text = '[' + row["ProductionLineCode"].ToString() + ']' + row["ProductionLinename"].ToString();
  1186. sNode.Name = "ProductionLine_" + row["ProductionLineCode"].ToString();
  1187. sNode.Tag = row["PurviewID"];
  1188. if (Convert.ToBoolean(row["RightFlag"]))
  1189. {
  1190. sNode.Checked = true;
  1191. }
  1192. // this.tvwGroutinProductionLineCK.Nodes.Add(sNode);
  1193. this.treeViewCancel.Nodes.Add(sNode);
  1194. InitCancelProcedureTreeView(sNode, ProductionLineTable);
  1195. }
  1196. }
  1197. /// <summary>
  1198. /// 生成查看成工序树
  1199. /// </summary>
  1200. /// <param name="GroutingLineTable"></param>
  1201. /// <param name="ProductionLineTable"></param>
  1202. private void InitCancelProcedureTreeView(TreeNode sNode, DataTable ProductionLineTable)
  1203. {
  1204. DataRow[] rows = ProductionLineTable.Select
  1205. ("ProductionLineid=" + sNode.Tag.ToString());
  1206. foreach (DataRow row in rows)
  1207. {
  1208. TreeNode childNode;
  1209. childNode = sNode.Nodes.Add('[' + row["ProcedureCode"].ToString() + ']' + row["Procedurename"].ToString());
  1210. childNode.Name = "Procedure_" + row["ProcedureCode"].ToString();
  1211. childNode.Tag = row["PurviewID"];
  1212. if (Convert.ToBoolean(row["RightFlag"]))
  1213. {
  1214. childNode.Checked = true;
  1215. }
  1216. }
  1217. }
  1218. #endregion
  1219. /// <summary>
  1220. /// 生成查看成工序树
  1221. /// </summary>
  1222. /// <param name="GroutingLineTable"></param>
  1223. /// <param name="ProductionLineTable"></param>
  1224. private void InitGroutingProductionTreeView(TreeNode sNode, DataTable ProductionLineTable)
  1225. {
  1226. DataRow[] rows = ProductionLineTable.Select
  1227. ("ProductionLineid=" + sNode.Tag.ToString());
  1228. foreach (DataRow row in rows)
  1229. {
  1230. TreeNode childNode;
  1231. childNode = sNode.Nodes.Add('[' + row["ProcedureCode"].ToString() + ']' + row["Procedurename"].ToString());
  1232. childNode.Name = "Procedure_" + row["ProcedureCode"].ToString();
  1233. childNode.Tag = row["PurviewID"];
  1234. if (Convert.ToBoolean(row["RightFlag"]))
  1235. {
  1236. childNode.Checked = true;
  1237. }
  1238. }
  1239. }
  1240. #endregion
  1241. /// <summary>
  1242. /// 查看部门选中项改变事件
  1243. /// </summary>
  1244. /// <param name="sender"></param>
  1245. /// <param name="e"></param>
  1246. private void chkViewOrganizationFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  1247. {
  1248. //if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  1249. //{
  1250. // this.btnSave.Enabled = false;
  1251. //}
  1252. //else
  1253. //{
  1254. // this.btnSave.Enabled = true;
  1255. //}
  1256. //// 操作工号
  1257. //if (!this.btnSave.Enabled)
  1258. //{
  1259. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  1260. // {
  1261. // this.btnSave.Enabled = false;
  1262. // }
  1263. // else
  1264. // {
  1265. // this.btnSave.Enabled = true;
  1266. // }
  1267. //}
  1268. //// 查看工号
  1269. //if (!this.btnSave.Enabled)
  1270. //{
  1271. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  1272. // {
  1273. // this.btnSave.Enabled = false;
  1274. // }
  1275. // else
  1276. // {
  1277. // this.btnSave.Enabled = true;
  1278. // }
  1279. //}
  1280. ////查看成型线
  1281. //if (!this.btnSave.Enabled)
  1282. //{
  1283. // // 自己按钮事件
  1284. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  1285. // {
  1286. // this.btnSave.Enabled = false;
  1287. // }
  1288. // else
  1289. // {
  1290. // this.btnSave.Enabled = true;
  1291. // }
  1292. //}
  1293. ////操作成型线
  1294. //if (!this.btnSave.Enabled)
  1295. //{
  1296. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  1297. // {
  1298. // this.btnSave.Enabled = false;
  1299. // }
  1300. // else
  1301. // {
  1302. // this.btnSave.Enabled = true;
  1303. // }
  1304. //}
  1305. ////操作温湿度
  1306. //if (!this.btnSave.Enabled)
  1307. //{
  1308. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  1309. // {
  1310. // this.btnSave.Enabled = false;
  1311. // }
  1312. // else
  1313. // {
  1314. // this.btnSave.Enabled = true;
  1315. // }
  1316. //}
  1317. ////查看温湿度
  1318. //if (!this.btnSave.Enabled)
  1319. //{
  1320. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  1321. // {
  1322. // this.btnSave.Enabled = false;
  1323. // }
  1324. // else
  1325. // {
  1326. // this.btnSave.Enabled = true;
  1327. // }
  1328. //}
  1329. ////操作部门
  1330. //if (!this.btnSave.Enabled)
  1331. //{
  1332. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  1333. // {
  1334. // this.btnSave.Enabled = false;
  1335. // }
  1336. // else
  1337. // {
  1338. // this.btnSave.Enabled = true;
  1339. // }
  1340. //}
  1341. ////查看工序
  1342. //if (!this.btnSave.Enabled)
  1343. //{
  1344. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  1345. // {
  1346. // this.btnSave.Enabled = false;
  1347. // }
  1348. // else
  1349. // {
  1350. // this.btnSave.Enabled = true;
  1351. // }
  1352. //}
  1353. ////查看生产线
  1354. //if (!this.btnSave.Enabled)
  1355. //{
  1356. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  1357. // {
  1358. // this.btnSave.Enabled = false;
  1359. // }
  1360. // else
  1361. // {
  1362. // this.btnSave.Enabled = true;
  1363. // }
  1364. //}
  1365. ////操作工序
  1366. //if (!this.btnSave.Enabled)
  1367. //{
  1368. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  1369. // {
  1370. // this.btnSave.Enabled = false;
  1371. // }
  1372. // else
  1373. // {
  1374. // this.btnSave.Enabled = true;
  1375. // }
  1376. //}
  1377. ////操作生产线
  1378. //if (!this.btnSave.Enabled)
  1379. //{
  1380. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  1381. // {
  1382. // this.btnSave.Enabled = false;
  1383. // }
  1384. // else
  1385. // {
  1386. // this.btnSave.Enabled = true;
  1387. // }
  1388. //}
  1389. //// 取消工序
  1390. //if (!this.btnSave.Enabled)
  1391. //{
  1392. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  1393. // {
  1394. // this.btnSave.Enabled = false;
  1395. // }
  1396. // else
  1397. // {
  1398. // this.btnSave.Enabled = true;
  1399. // }
  1400. //}
  1401. //if (!this.btnSave.Enabled)
  1402. //{
  1403. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  1404. //}
  1405. //this.btnSave.Enabled = true;
  1406. }
  1407. /// <summary>
  1408. /// 操作部门选中项改变事件
  1409. /// </summary>
  1410. /// <param name="sender"></param>
  1411. /// <param name="e"></param>
  1412. private void chkOrganizationFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  1413. {
  1414. //if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  1415. //{
  1416. // this.btnSave.Enabled = false;
  1417. //}
  1418. //else
  1419. //{
  1420. // this.btnSave.Enabled = true;
  1421. //}
  1422. //// 操作工号
  1423. //if (!this.btnSave.Enabled)
  1424. //{
  1425. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  1426. // {
  1427. // this.btnSave.Enabled = false;
  1428. // }
  1429. // else
  1430. // {
  1431. // this.btnSave.Enabled = true;
  1432. // }
  1433. //}
  1434. //// 查看工号
  1435. //if (!this.btnSave.Enabled)
  1436. //{
  1437. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  1438. // {
  1439. // this.btnSave.Enabled = false;
  1440. // }
  1441. // else
  1442. // {
  1443. // this.btnSave.Enabled = true;
  1444. // }
  1445. //}
  1446. ////查看成型线
  1447. //if (!this.btnSave.Enabled)
  1448. //{
  1449. // // 自己按钮事件
  1450. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  1451. // {
  1452. // this.btnSave.Enabled = false;
  1453. // }
  1454. // else
  1455. // {
  1456. // this.btnSave.Enabled = true;
  1457. // }
  1458. //}
  1459. ////操作成型线
  1460. //if (!this.btnSave.Enabled)
  1461. //{
  1462. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  1463. // {
  1464. // this.btnSave.Enabled = false;
  1465. // }
  1466. // else
  1467. // {
  1468. // this.btnSave.Enabled = true;
  1469. // }
  1470. //}
  1471. ////操作温湿度
  1472. //if (!this.btnSave.Enabled)
  1473. //{
  1474. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  1475. // {
  1476. // this.btnSave.Enabled = false;
  1477. // }
  1478. // else
  1479. // {
  1480. // this.btnSave.Enabled = true;
  1481. // }
  1482. //}
  1483. ////查看温湿度
  1484. //if (!this.btnSave.Enabled)
  1485. //{
  1486. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  1487. // {
  1488. // this.btnSave.Enabled = false;
  1489. // }
  1490. // else
  1491. // {
  1492. // this.btnSave.Enabled = true;
  1493. // }
  1494. //}
  1495. ////查看部门
  1496. //if (!this.btnSave.Enabled)
  1497. //{
  1498. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  1499. // {
  1500. // this.btnSave.Enabled = false;
  1501. // }
  1502. // else
  1503. // {
  1504. // this.btnSave.Enabled = true;
  1505. // }
  1506. //}
  1507. ////查看工序
  1508. //if (!this.btnSave.Enabled)
  1509. //{
  1510. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  1511. // {
  1512. // this.btnSave.Enabled = false;
  1513. // }
  1514. // else
  1515. // {
  1516. // this.btnSave.Enabled = true;
  1517. // }
  1518. //}
  1519. ////查看生产线
  1520. //if (!this.btnSave.Enabled)
  1521. //{
  1522. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  1523. // {
  1524. // this.btnSave.Enabled = false;
  1525. // }
  1526. // else
  1527. // {
  1528. // this.btnSave.Enabled = true;
  1529. // }
  1530. //}
  1531. ////操作工序
  1532. //if (!this.btnSave.Enabled)
  1533. //{
  1534. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  1535. // {
  1536. // this.btnSave.Enabled = false;
  1537. // }
  1538. // else
  1539. // {
  1540. // this.btnSave.Enabled = true;
  1541. // }
  1542. //}
  1543. ////操作生产线
  1544. //if (!this.btnSave.Enabled)
  1545. //{
  1546. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  1547. // {
  1548. // this.btnSave.Enabled = false;
  1549. // }
  1550. // else
  1551. // {
  1552. // this.btnSave.Enabled = true;
  1553. // }
  1554. //}
  1555. //// 取消工序
  1556. //if (!this.btnSave.Enabled)
  1557. //{
  1558. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  1559. // {
  1560. // this.btnSave.Enabled = false;
  1561. // }
  1562. // else
  1563. // {
  1564. // this.btnSave.Enabled = true;
  1565. // }
  1566. //}
  1567. //if (!this.btnSave.Enabled)
  1568. //{
  1569. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  1570. //}
  1571. //this.btnSave.Enabled = true;
  1572. }
  1573. /// <summary>
  1574. /// 查看工号选中项改变事件
  1575. /// </summary>
  1576. /// <param name="sender"></param>
  1577. /// <param name="e"></param>
  1578. private void chkViewUserFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  1579. {
  1580. //// 自己按钮事件
  1581. //if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  1582. //{
  1583. // this.btnSave.Enabled = false;
  1584. //}
  1585. //else
  1586. //{
  1587. // this.btnSave.Enabled = true;
  1588. //}
  1589. //// 操作工号
  1590. //if (!this.btnSave.Enabled)
  1591. //{
  1592. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  1593. // {
  1594. // this.btnSave.Enabled = false;
  1595. // }
  1596. // else
  1597. // {
  1598. // this.btnSave.Enabled = true;
  1599. // }
  1600. //}
  1601. //// 查看成型线
  1602. //if (!this.btnSave.Enabled)
  1603. //{
  1604. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  1605. // {
  1606. // this.btnSave.Enabled = false;
  1607. // }
  1608. // else
  1609. // {
  1610. // this.btnSave.Enabled = true;
  1611. // }
  1612. //}
  1613. ////操作成型线
  1614. //if (!this.btnSave.Enabled)
  1615. //{
  1616. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  1617. // {
  1618. // this.btnSave.Enabled = false;
  1619. // }
  1620. // else
  1621. // {
  1622. // this.btnSave.Enabled = true;
  1623. // }
  1624. //}
  1625. ////查看温湿度
  1626. //if (!this.btnSave.Enabled)
  1627. //{
  1628. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  1629. // {
  1630. // this.btnSave.Enabled = false;
  1631. // }
  1632. // else
  1633. // {
  1634. // this.btnSave.Enabled = true;
  1635. // }
  1636. //}
  1637. ////操作温湿度
  1638. //if (!this.btnSave.Enabled)
  1639. //{
  1640. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  1641. // {
  1642. // this.btnSave.Enabled = false;
  1643. // }
  1644. // else
  1645. // {
  1646. // this.btnSave.Enabled = true;
  1647. // }
  1648. //}
  1649. ////查看部门
  1650. //if (!this.btnSave.Enabled)
  1651. //{
  1652. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  1653. // {
  1654. // this.btnSave.Enabled = false;
  1655. // }
  1656. // else
  1657. // {
  1658. // this.btnSave.Enabled = true;
  1659. // }
  1660. //}
  1661. ////操作部门
  1662. //if (!this.btnSave.Enabled)
  1663. //{
  1664. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  1665. // {
  1666. // this.btnSave.Enabled = false;
  1667. // }
  1668. // else
  1669. // {
  1670. // this.btnSave.Enabled = true;
  1671. // }
  1672. //}
  1673. ////查看工序
  1674. //if (!this.btnSave.Enabled)
  1675. //{
  1676. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  1677. // {
  1678. // this.btnSave.Enabled = false;
  1679. // }
  1680. // else
  1681. // {
  1682. // this.btnSave.Enabled = true;
  1683. // }
  1684. //}
  1685. ////查看生产线
  1686. //if (!this.btnSave.Enabled)
  1687. //{
  1688. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  1689. // {
  1690. // this.btnSave.Enabled = false;
  1691. // }
  1692. // else
  1693. // {
  1694. // this.btnSave.Enabled = true;
  1695. // }
  1696. //}
  1697. ////操作工序
  1698. //if (!this.btnSave.Enabled)
  1699. //{
  1700. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  1701. // {
  1702. // this.btnSave.Enabled = false;
  1703. // }
  1704. // else
  1705. // {
  1706. // this.btnSave.Enabled = true;
  1707. // }
  1708. //}
  1709. ////操作生产线
  1710. //if (!this.btnSave.Enabled)
  1711. //{
  1712. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  1713. // {
  1714. // this.btnSave.Enabled = false;
  1715. // }
  1716. // else
  1717. // {
  1718. // this.btnSave.Enabled = true;
  1719. // }
  1720. //}
  1721. //// 取消工序
  1722. //if (!this.btnSave.Enabled)
  1723. //{
  1724. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  1725. // {
  1726. // this.btnSave.Enabled = false;
  1727. // }
  1728. // else
  1729. // {
  1730. // this.btnSave.Enabled = true;
  1731. // }
  1732. //}
  1733. //if (!this.btnSave.Enabled)
  1734. //{
  1735. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  1736. //}
  1737. //this.btnSave.Enabled = true;
  1738. }
  1739. /// <summary>
  1740. /// 操作工号选中项改变事件
  1741. /// </summary>
  1742. /// <param name="sender"></param>
  1743. /// <param name="e"></param>
  1744. private void chkUserFunctionCodeAll1_CheckedChanged(object sender, EventArgs e)
  1745. {
  1746. //// 自己按钮事件
  1747. //if (this.chkUserFunctionCodeAll1.Checked == this._user)
  1748. //{
  1749. // this.btnSave.Enabled = false;
  1750. //}
  1751. //else
  1752. //{
  1753. // this.btnSave.Enabled = true;
  1754. //}
  1755. //// 查看工号
  1756. //if (!this.btnSave.Enabled)
  1757. //{
  1758. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  1759. // {
  1760. // this.btnSave.Enabled = false;
  1761. // }
  1762. // else
  1763. // {
  1764. // this.btnSave.Enabled = true;
  1765. // }
  1766. //}
  1767. //// 查看成型线
  1768. //if (!this.btnSave.Enabled)
  1769. //{
  1770. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  1771. // {
  1772. // this.btnSave.Enabled = false;
  1773. // }
  1774. // else
  1775. // {
  1776. // this.btnSave.Enabled = true;
  1777. // }
  1778. //}
  1779. ////操作成型线
  1780. //if (!this.btnSave.Enabled)
  1781. //{
  1782. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  1783. // {
  1784. // this.btnSave.Enabled = false;
  1785. // }
  1786. // else
  1787. // {
  1788. // this.btnSave.Enabled = true;
  1789. // }
  1790. //}
  1791. ////查看温湿度
  1792. //if (!this.btnSave.Enabled)
  1793. //{
  1794. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  1795. // {
  1796. // this.btnSave.Enabled = false;
  1797. // }
  1798. // else
  1799. // {
  1800. // this.btnSave.Enabled = true;
  1801. // }
  1802. //}
  1803. ////操作温湿度
  1804. //if (!this.btnSave.Enabled)
  1805. //{
  1806. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  1807. // {
  1808. // this.btnSave.Enabled = false;
  1809. // }
  1810. // else
  1811. // {
  1812. // this.btnSave.Enabled = true;
  1813. // }
  1814. //}
  1815. ////查看部门
  1816. //if (!this.btnSave.Enabled)
  1817. //{
  1818. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  1819. // {
  1820. // this.btnSave.Enabled = false;
  1821. // }
  1822. // else
  1823. // {
  1824. // this.btnSave.Enabled = true;
  1825. // }
  1826. //}
  1827. ////操作部门
  1828. //if (!this.btnSave.Enabled)
  1829. //{
  1830. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  1831. // {
  1832. // this.btnSave.Enabled = false;
  1833. // }
  1834. // else
  1835. // {
  1836. // this.btnSave.Enabled = true;
  1837. // }
  1838. //}
  1839. ////查看工序
  1840. //if (!this.btnSave.Enabled)
  1841. //{
  1842. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  1843. // {
  1844. // this.btnSave.Enabled = false;
  1845. // }
  1846. // else
  1847. // {
  1848. // this.btnSave.Enabled = true;
  1849. // }
  1850. //}
  1851. ////查看生产线
  1852. //if (!this.btnSave.Enabled)
  1853. //{
  1854. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  1855. // {
  1856. // this.btnSave.Enabled = false;
  1857. // }
  1858. // else
  1859. // {
  1860. // this.btnSave.Enabled = true;
  1861. // }
  1862. //}
  1863. ////操作工序
  1864. //if (!this.btnSave.Enabled)
  1865. //{
  1866. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  1867. // {
  1868. // this.btnSave.Enabled = false;
  1869. // }
  1870. // else
  1871. // {
  1872. // this.btnSave.Enabled = true;
  1873. // }
  1874. //}
  1875. ////操作生产线
  1876. //if (!this.btnSave.Enabled)
  1877. //{
  1878. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  1879. // {
  1880. // this.btnSave.Enabled = false;
  1881. // }
  1882. // else
  1883. // {
  1884. // this.btnSave.Enabled = true;
  1885. // }
  1886. //}
  1887. //// 取消工序
  1888. //if (!this.btnSave.Enabled)
  1889. //{
  1890. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  1891. // {
  1892. // this.btnSave.Enabled = false;
  1893. // }
  1894. // else
  1895. // {
  1896. // this.btnSave.Enabled = true;
  1897. // }
  1898. //}
  1899. //if (!this.btnSave.Enabled)
  1900. //{
  1901. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  1902. //}
  1903. //this.btnSave.Enabled = true;
  1904. }
  1905. /// <summary>
  1906. /// 查看成型线选中项改变事件
  1907. /// </summary>
  1908. /// <param name="sender"></param>
  1909. /// <param name="e"></param>
  1910. private void chkViewGroutingLinerFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  1911. {
  1912. //// 自己按钮事件
  1913. //if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  1914. //{
  1915. // this.btnSave.Enabled = false;
  1916. //}
  1917. //else
  1918. //{
  1919. // this.btnSave.Enabled = true;
  1920. //}
  1921. //// 操作工号
  1922. //if (!this.btnSave.Enabled)
  1923. //{
  1924. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  1925. // {
  1926. // this.btnSave.Enabled = false;
  1927. // }
  1928. // else
  1929. // {
  1930. // this.btnSave.Enabled = true;
  1931. // }
  1932. //}
  1933. //// 查看工号
  1934. //if (!this.btnSave.Enabled)
  1935. //{
  1936. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  1937. // {
  1938. // this.btnSave.Enabled = false;
  1939. // }
  1940. // else
  1941. // {
  1942. // this.btnSave.Enabled = true;
  1943. // }
  1944. //}
  1945. ////操作成型线
  1946. //if (!this.btnSave.Enabled)
  1947. //{
  1948. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  1949. // {
  1950. // this.btnSave.Enabled = false;
  1951. // }
  1952. // else
  1953. // {
  1954. // this.btnSave.Enabled = true;
  1955. // }
  1956. //}
  1957. ////查看温湿度
  1958. //if (!this.btnSave.Enabled)
  1959. //{
  1960. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  1961. // {
  1962. // this.btnSave.Enabled = false;
  1963. // }
  1964. // else
  1965. // {
  1966. // this.btnSave.Enabled = true;
  1967. // }
  1968. //}
  1969. ////操作温湿度
  1970. //if (!this.btnSave.Enabled)
  1971. //{
  1972. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  1973. // {
  1974. // this.btnSave.Enabled = false;
  1975. // }
  1976. // else
  1977. // {
  1978. // this.btnSave.Enabled = true;
  1979. // }
  1980. //}
  1981. ////查看部门
  1982. //if (!this.btnSave.Enabled)
  1983. //{
  1984. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  1985. // {
  1986. // this.btnSave.Enabled = false;
  1987. // }
  1988. // else
  1989. // {
  1990. // this.btnSave.Enabled = true;
  1991. // }
  1992. //}
  1993. ////操作部门
  1994. //if (!this.btnSave.Enabled)
  1995. //{
  1996. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  1997. // {
  1998. // this.btnSave.Enabled = false;
  1999. // }
  2000. // else
  2001. // {
  2002. // this.btnSave.Enabled = true;
  2003. // }
  2004. //}
  2005. ////查看工序
  2006. //if (!this.btnSave.Enabled)
  2007. //{
  2008. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  2009. // {
  2010. // this.btnSave.Enabled = false;
  2011. // }
  2012. // else
  2013. // {
  2014. // this.btnSave.Enabled = true;
  2015. // }
  2016. //}
  2017. ////查看生产线
  2018. //if (!this.btnSave.Enabled)
  2019. //{
  2020. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  2021. // {
  2022. // this.btnSave.Enabled = false;
  2023. // }
  2024. // else
  2025. // {
  2026. // this.btnSave.Enabled = true;
  2027. // }
  2028. //}
  2029. ////操作工序
  2030. //if (!this.btnSave.Enabled)
  2031. //{
  2032. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  2033. // {
  2034. // this.btnSave.Enabled = false;
  2035. // }
  2036. // else
  2037. // {
  2038. // this.btnSave.Enabled = true;
  2039. // }
  2040. //}
  2041. ////操作生产线
  2042. //if (!this.btnSave.Enabled)
  2043. //{
  2044. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  2045. // {
  2046. // this.btnSave.Enabled = false;
  2047. // }
  2048. // else
  2049. // {
  2050. // this.btnSave.Enabled = true;
  2051. // }
  2052. //}
  2053. //// 取消工序
  2054. //if (!this.btnSave.Enabled)
  2055. //{
  2056. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  2057. // {
  2058. // this.btnSave.Enabled = false;
  2059. // }
  2060. // else
  2061. // {
  2062. // this.btnSave.Enabled = true;
  2063. // }
  2064. //}
  2065. //if (!this.btnSave.Enabled)
  2066. //{
  2067. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  2068. //}
  2069. //this.btnSave.Enabled = true;
  2070. }
  2071. /// <summary>
  2072. /// 操作成型线选中项改变事件
  2073. /// </summary>
  2074. /// <param name="sender"></param>
  2075. /// <param name="e"></param>
  2076. private void chkGroutingLinerFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  2077. {
  2078. //if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  2079. //{
  2080. // this.btnSave.Enabled = false;
  2081. //}
  2082. //else
  2083. //{
  2084. // this.btnSave.Enabled = true;
  2085. //}
  2086. //// 操作工号
  2087. //if (!this.btnSave.Enabled)
  2088. //{
  2089. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  2090. // {
  2091. // this.btnSave.Enabled = false;
  2092. // }
  2093. // else
  2094. // {
  2095. // this.btnSave.Enabled = true;
  2096. // }
  2097. //}
  2098. //// 查看工号
  2099. //if (!this.btnSave.Enabled)
  2100. //{
  2101. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  2102. // {
  2103. // this.btnSave.Enabled = false;
  2104. // }
  2105. // else
  2106. // {
  2107. // this.btnSave.Enabled = true;
  2108. // }
  2109. //}
  2110. ////查看成型线
  2111. //if (!this.btnSave.Enabled)
  2112. //{
  2113. // // 自己按钮事件
  2114. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  2115. // {
  2116. // this.btnSave.Enabled = false;
  2117. // }
  2118. // else
  2119. // {
  2120. // this.btnSave.Enabled = true;
  2121. // }
  2122. //}
  2123. ////查看温湿度
  2124. //if (!this.btnSave.Enabled)
  2125. //{
  2126. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  2127. // {
  2128. // this.btnSave.Enabled = false;
  2129. // }
  2130. // else
  2131. // {
  2132. // this.btnSave.Enabled = true;
  2133. // }
  2134. //}
  2135. ////操作温湿度
  2136. //if (!this.btnSave.Enabled)
  2137. //{
  2138. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  2139. // {
  2140. // this.btnSave.Enabled = false;
  2141. // }
  2142. // else
  2143. // {
  2144. // this.btnSave.Enabled = true;
  2145. // }
  2146. //}
  2147. ////查看部门
  2148. //if (!this.btnSave.Enabled)
  2149. //{
  2150. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  2151. // {
  2152. // this.btnSave.Enabled = false;
  2153. // }
  2154. // else
  2155. // {
  2156. // this.btnSave.Enabled = true;
  2157. // }
  2158. //}
  2159. ////操作部门
  2160. //if (!this.btnSave.Enabled)
  2161. //{
  2162. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  2163. // {
  2164. // this.btnSave.Enabled = false;
  2165. // }
  2166. // else
  2167. // {
  2168. // this.btnSave.Enabled = true;
  2169. // }
  2170. //}
  2171. ////查看工序
  2172. //if (!this.btnSave.Enabled)
  2173. //{
  2174. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  2175. // {
  2176. // this.btnSave.Enabled = false;
  2177. // }
  2178. // else
  2179. // {
  2180. // this.btnSave.Enabled = true;
  2181. // }
  2182. //}
  2183. ////查看生产线
  2184. //if (!this.btnSave.Enabled)
  2185. //{
  2186. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  2187. // {
  2188. // this.btnSave.Enabled = false;
  2189. // }
  2190. // else
  2191. // {
  2192. // this.btnSave.Enabled = true;
  2193. // }
  2194. //}
  2195. ////操作工序
  2196. //if (!this.btnSave.Enabled)
  2197. //{
  2198. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  2199. // {
  2200. // this.btnSave.Enabled = false;
  2201. // }
  2202. // else
  2203. // {
  2204. // this.btnSave.Enabled = true;
  2205. // }
  2206. //}
  2207. ////操作生产线
  2208. //if (!this.btnSave.Enabled)
  2209. //{
  2210. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  2211. // {
  2212. // this.btnSave.Enabled = false;
  2213. // }
  2214. // else
  2215. // {
  2216. // this.btnSave.Enabled = true;
  2217. // }
  2218. //}
  2219. //// 取消工序
  2220. //if (!this.btnSave.Enabled)
  2221. //{
  2222. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  2223. // {
  2224. // this.btnSave.Enabled = false;
  2225. // }
  2226. // else
  2227. // {
  2228. // this.btnSave.Enabled = true;
  2229. // }
  2230. //}
  2231. //if (!this.btnSave.Enabled)
  2232. //{
  2233. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  2234. //}
  2235. //this.btnSave.Enabled = true;
  2236. }
  2237. /// <summary>
  2238. /// 查看工序不限制事件
  2239. /// </summary>
  2240. /// <param name="sender"></param>
  2241. /// <param name="e"></param>
  2242. private void chkViewProceduceFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  2243. {
  2244. //if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  2245. //{
  2246. // this.btnSave.Enabled = false;
  2247. //}
  2248. //else
  2249. //{
  2250. // this.btnSave.Enabled = true;
  2251. //}
  2252. //// 查看生产线
  2253. //if (!this.btnSave.Enabled)
  2254. //{
  2255. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  2256. // {
  2257. // this.btnSave.Enabled = false;
  2258. // }
  2259. // else
  2260. // {
  2261. // this.btnSave.Enabled = true;
  2262. // }
  2263. //}
  2264. //// 操作工号
  2265. //if (!this.btnSave.Enabled)
  2266. //{
  2267. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  2268. // {
  2269. // this.btnSave.Enabled = false;
  2270. // }
  2271. // else
  2272. // {
  2273. // this.btnSave.Enabled = true;
  2274. // }
  2275. //}
  2276. //// 查看工号
  2277. //if (!this.btnSave.Enabled)
  2278. //{
  2279. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  2280. // {
  2281. // this.btnSave.Enabled = false;
  2282. // }
  2283. // else
  2284. // {
  2285. // this.btnSave.Enabled = true;
  2286. // }
  2287. //}
  2288. ////查看成型线
  2289. //if (!this.btnSave.Enabled)
  2290. //{
  2291. // // 自己按钮事件
  2292. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  2293. // {
  2294. // this.btnSave.Enabled = false;
  2295. // }
  2296. // else
  2297. // {
  2298. // this.btnSave.Enabled = true;
  2299. // }
  2300. //}
  2301. ////操作成型线
  2302. //if (!this.btnSave.Enabled)
  2303. //{
  2304. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  2305. // {
  2306. // this.btnSave.Enabled = false;
  2307. // }
  2308. // else
  2309. // {
  2310. // this.btnSave.Enabled = true;
  2311. // }
  2312. //}
  2313. ////操作温湿度
  2314. //if (!this.btnSave.Enabled)
  2315. //{
  2316. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  2317. // {
  2318. // this.btnSave.Enabled = false;
  2319. // }
  2320. // else
  2321. // {
  2322. // this.btnSave.Enabled = true;
  2323. // }
  2324. //}
  2325. ////查看温湿度
  2326. //if (!this.btnSave.Enabled)
  2327. //{
  2328. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  2329. // {
  2330. // this.btnSave.Enabled = false;
  2331. // }
  2332. // else
  2333. // {
  2334. // this.btnSave.Enabled = true;
  2335. // }
  2336. //}
  2337. ////查看部门
  2338. //if (!this.btnSave.Enabled)
  2339. //{
  2340. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  2341. // {
  2342. // this.btnSave.Enabled = false;
  2343. // }
  2344. // else
  2345. // {
  2346. // this.btnSave.Enabled = true;
  2347. // }
  2348. //}
  2349. ////操作部门
  2350. //if (!this.btnSave.Enabled)
  2351. //{
  2352. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  2353. // {
  2354. // this.btnSave.Enabled = false;
  2355. // }
  2356. // else
  2357. // {
  2358. // this.btnSave.Enabled = true;
  2359. // }
  2360. //}
  2361. ////操作工序
  2362. //if (!this.btnSave.Enabled)
  2363. //{
  2364. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  2365. // {
  2366. // this.btnSave.Enabled = false;
  2367. // }
  2368. // else
  2369. // {
  2370. // this.btnSave.Enabled = true;
  2371. // }
  2372. //}
  2373. ////操作生产线
  2374. //if (!this.btnSave.Enabled)
  2375. //{
  2376. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  2377. // {
  2378. // this.btnSave.Enabled = false;
  2379. // }
  2380. // else
  2381. // {
  2382. // this.btnSave.Enabled = true;
  2383. // }
  2384. //}
  2385. //// 取消工序
  2386. //if (!this.btnSave.Enabled)
  2387. //{
  2388. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  2389. // {
  2390. // this.btnSave.Enabled = false;
  2391. // }
  2392. // else
  2393. // {
  2394. // this.btnSave.Enabled = true;
  2395. // }
  2396. //}
  2397. //if (!this.btnSave.Enabled)
  2398. //{
  2399. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  2400. //}
  2401. //this.btnSave.Enabled = true;
  2402. }
  2403. /// <summary>
  2404. /// 操作工序按钮事件
  2405. /// </summary>
  2406. /// <param name="sender"></param>
  2407. /// <param name="e"></param>
  2408. private void chkProceduceFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  2409. {
  2410. //if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  2411. //{
  2412. // this.btnSave.Enabled = false;
  2413. //}
  2414. //else
  2415. //{
  2416. // this.btnSave.Enabled = true;
  2417. //}
  2418. //// 操作生产线
  2419. //if (!this.btnSave.Enabled)
  2420. //{
  2421. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  2422. // {
  2423. // this.btnSave.Enabled = false;
  2424. // }
  2425. // else
  2426. // {
  2427. // this.btnSave.Enabled = true;
  2428. // }
  2429. //}
  2430. //// 操作工号
  2431. //if (!this.btnSave.Enabled)
  2432. //{
  2433. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  2434. // {
  2435. // this.btnSave.Enabled = false;
  2436. // }
  2437. // else
  2438. // {
  2439. // this.btnSave.Enabled = true;
  2440. // }
  2441. //}
  2442. //// 查看工号
  2443. //if (!this.btnSave.Enabled)
  2444. //{
  2445. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  2446. // {
  2447. // this.btnSave.Enabled = false;
  2448. // }
  2449. // else
  2450. // {
  2451. // this.btnSave.Enabled = true;
  2452. // }
  2453. //}
  2454. ////查看成型线
  2455. //if (!this.btnSave.Enabled)
  2456. //{
  2457. // // 自己按钮事件
  2458. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  2459. // {
  2460. // this.btnSave.Enabled = false;
  2461. // }
  2462. // else
  2463. // {
  2464. // this.btnSave.Enabled = true;
  2465. // }
  2466. //}
  2467. ////操作成型线
  2468. //if (!this.btnSave.Enabled)
  2469. //{
  2470. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  2471. // {
  2472. // this.btnSave.Enabled = false;
  2473. // }
  2474. // else
  2475. // {
  2476. // this.btnSave.Enabled = true;
  2477. // }
  2478. //}
  2479. ////操作温湿度
  2480. //if (!this.btnSave.Enabled)
  2481. //{
  2482. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  2483. // {
  2484. // this.btnSave.Enabled = false;
  2485. // }
  2486. // else
  2487. // {
  2488. // this.btnSave.Enabled = true;
  2489. // }
  2490. //}
  2491. ////查看温湿度
  2492. //if (!this.btnSave.Enabled)
  2493. //{
  2494. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  2495. // {
  2496. // this.btnSave.Enabled = false;
  2497. // }
  2498. // else
  2499. // {
  2500. // this.btnSave.Enabled = true;
  2501. // }
  2502. //}
  2503. ////查看部门
  2504. //if (!this.btnSave.Enabled)
  2505. //{
  2506. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  2507. // {
  2508. // this.btnSave.Enabled = false;
  2509. // }
  2510. // else
  2511. // {
  2512. // this.btnSave.Enabled = true;
  2513. // }
  2514. //}
  2515. ////操作部门
  2516. //if (!this.btnSave.Enabled)
  2517. //{
  2518. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  2519. // {
  2520. // this.btnSave.Enabled = false;
  2521. // }
  2522. // else
  2523. // {
  2524. // this.btnSave.Enabled = true;
  2525. // }
  2526. //}
  2527. ////查看工序
  2528. //if (!this.btnSave.Enabled)
  2529. //{
  2530. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  2531. // {
  2532. // this.btnSave.Enabled = false;
  2533. // }
  2534. // else
  2535. // {
  2536. // this.btnSave.Enabled = true;
  2537. // }
  2538. //}
  2539. ////查看生产线
  2540. //if (!this.btnSave.Enabled)
  2541. //{
  2542. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  2543. // {
  2544. // this.btnSave.Enabled = false;
  2545. // }
  2546. // else
  2547. // {
  2548. // this.btnSave.Enabled = true;
  2549. // }
  2550. //}
  2551. //// 取消工序
  2552. //if (!this.btnSave.Enabled)
  2553. //{
  2554. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  2555. // {
  2556. // this.btnSave.Enabled = false;
  2557. // }
  2558. // else
  2559. // {
  2560. // this.btnSave.Enabled = true;
  2561. // }
  2562. //}
  2563. //if (!this.btnSave.Enabled)
  2564. //{
  2565. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  2566. //}
  2567. //this.btnSave.Enabled = true;
  2568. }
  2569. /// <summary>
  2570. /// 查看温湿度按钮事件
  2571. /// </summary>
  2572. /// <param name="sender"></param>
  2573. /// <param name="e"></param>
  2574. private void chkViewThermometerFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  2575. {
  2576. //if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  2577. //{
  2578. // this.btnSave.Enabled = false;
  2579. //}
  2580. //else
  2581. //{
  2582. // this.btnSave.Enabled = true;
  2583. //}
  2584. //// 操作工号
  2585. //if (!this.btnSave.Enabled)
  2586. //{
  2587. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  2588. // {
  2589. // this.btnSave.Enabled = false;
  2590. // }
  2591. // else
  2592. // {
  2593. // this.btnSave.Enabled = true;
  2594. // }
  2595. //}
  2596. //// 查看工号
  2597. //if (!this.btnSave.Enabled)
  2598. //{
  2599. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  2600. // {
  2601. // this.btnSave.Enabled = false;
  2602. // }
  2603. // else
  2604. // {
  2605. // this.btnSave.Enabled = true;
  2606. // }
  2607. //}
  2608. ////查看成型线
  2609. //if (!this.btnSave.Enabled)
  2610. //{
  2611. // // 自己按钮事件
  2612. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  2613. // {
  2614. // this.btnSave.Enabled = false;
  2615. // }
  2616. // else
  2617. // {
  2618. // this.btnSave.Enabled = true;
  2619. // }
  2620. //}
  2621. ////操作成型线
  2622. //if (!this.btnSave.Enabled)
  2623. //{
  2624. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  2625. // {
  2626. // this.btnSave.Enabled = false;
  2627. // }
  2628. // else
  2629. // {
  2630. // this.btnSave.Enabled = true;
  2631. // }
  2632. //}
  2633. ////操作温湿度
  2634. //if (!this.btnSave.Enabled)
  2635. //{
  2636. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  2637. // {
  2638. // this.btnSave.Enabled = false;
  2639. // }
  2640. // else
  2641. // {
  2642. // this.btnSave.Enabled = true;
  2643. // }
  2644. //}
  2645. ////查看部门
  2646. //if (!this.btnSave.Enabled)
  2647. //{
  2648. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  2649. // {
  2650. // this.btnSave.Enabled = false;
  2651. // }
  2652. // else
  2653. // {
  2654. // this.btnSave.Enabled = true;
  2655. // }
  2656. //}
  2657. ////操作部门
  2658. //if (!this.btnSave.Enabled)
  2659. //{
  2660. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  2661. // {
  2662. // this.btnSave.Enabled = false;
  2663. // }
  2664. // else
  2665. // {
  2666. // this.btnSave.Enabled = true;
  2667. // }
  2668. //}
  2669. ////查看工序
  2670. //if (!this.btnSave.Enabled)
  2671. //{
  2672. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  2673. // {
  2674. // this.btnSave.Enabled = false;
  2675. // }
  2676. // else
  2677. // {
  2678. // this.btnSave.Enabled = true;
  2679. // }
  2680. //}
  2681. ////查看生产线
  2682. //if (!this.btnSave.Enabled)
  2683. //{
  2684. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  2685. // {
  2686. // this.btnSave.Enabled = false;
  2687. // }
  2688. // else
  2689. // {
  2690. // this.btnSave.Enabled = true;
  2691. // }
  2692. //}
  2693. ////操作工序
  2694. //if (!this.btnSave.Enabled)
  2695. //{
  2696. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  2697. // {
  2698. // this.btnSave.Enabled = false;
  2699. // }
  2700. // else
  2701. // {
  2702. // this.btnSave.Enabled = true;
  2703. // }
  2704. //}
  2705. ////操作生产线
  2706. //if (!this.btnSave.Enabled)
  2707. //{
  2708. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  2709. // {
  2710. // this.btnSave.Enabled = false;
  2711. // }
  2712. // else
  2713. // {
  2714. // this.btnSave.Enabled = true;
  2715. // }
  2716. //}
  2717. //// 取消工序
  2718. //if (!this.btnSave.Enabled)
  2719. //{
  2720. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  2721. // {
  2722. // this.btnSave.Enabled = false;
  2723. // }
  2724. // else
  2725. // {
  2726. // this.btnSave.Enabled = true;
  2727. // }
  2728. //}
  2729. //if (!this.btnSave.Enabled)
  2730. //{
  2731. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  2732. //}
  2733. //this.btnSave.Enabled = true;
  2734. }
  2735. /// <summary>
  2736. /// 操作温湿度按钮事件
  2737. /// </summary>
  2738. /// <param name="sender"></param>
  2739. /// <param name="e"></param>
  2740. private void chkThermometerFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  2741. {
  2742. //if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  2743. //{
  2744. // this.btnSave.Enabled = false;
  2745. //}
  2746. //else
  2747. //{
  2748. // this.btnSave.Enabled = true;
  2749. //}
  2750. //// 操作工号
  2751. //if (!this.btnSave.Enabled)
  2752. //{
  2753. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  2754. // {
  2755. // this.btnSave.Enabled = false;
  2756. // }
  2757. // else
  2758. // {
  2759. // this.btnSave.Enabled = true;
  2760. // }
  2761. //}
  2762. //// 查看工号
  2763. //if (!this.btnSave.Enabled)
  2764. //{
  2765. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  2766. // {
  2767. // this.btnSave.Enabled = false;
  2768. // }
  2769. // else
  2770. // {
  2771. // this.btnSave.Enabled = true;
  2772. // }
  2773. //}
  2774. ////查看成型线
  2775. //if (!this.btnSave.Enabled)
  2776. //{
  2777. // // 自己按钮事件
  2778. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  2779. // {
  2780. // this.btnSave.Enabled = false;
  2781. // }
  2782. // else
  2783. // {
  2784. // this.btnSave.Enabled = true;
  2785. // }
  2786. //}
  2787. ////操作成型线
  2788. //if (!this.btnSave.Enabled)
  2789. //{
  2790. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  2791. // {
  2792. // this.btnSave.Enabled = false;
  2793. // }
  2794. // else
  2795. // {
  2796. // this.btnSave.Enabled = true;
  2797. // }
  2798. //}
  2799. ////查看温湿度
  2800. //if (!this.btnSave.Enabled)
  2801. //{
  2802. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  2803. // {
  2804. // this.btnSave.Enabled = false;
  2805. // }
  2806. // else
  2807. // {
  2808. // this.btnSave.Enabled = true;
  2809. // }
  2810. //}
  2811. ////查看部门
  2812. //if (!this.btnSave.Enabled)
  2813. //{
  2814. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  2815. // {
  2816. // this.btnSave.Enabled = false;
  2817. // }
  2818. // else
  2819. // {
  2820. // this.btnSave.Enabled = true;
  2821. // }
  2822. //}
  2823. ////操作部门
  2824. //if (!this.btnSave.Enabled)
  2825. //{
  2826. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  2827. // {
  2828. // this.btnSave.Enabled = false;
  2829. // }
  2830. // else
  2831. // {
  2832. // this.btnSave.Enabled = true;
  2833. // }
  2834. //}
  2835. ////查看工序
  2836. //if (!this.btnSave.Enabled)
  2837. //{
  2838. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  2839. // {
  2840. // this.btnSave.Enabled = false;
  2841. // }
  2842. // else
  2843. // {
  2844. // this.btnSave.Enabled = true;
  2845. // }
  2846. //}
  2847. ////查看生产线
  2848. //if (!this.btnSave.Enabled)
  2849. //{
  2850. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  2851. // {
  2852. // this.btnSave.Enabled = false;
  2853. // }
  2854. // else
  2855. // {
  2856. // this.btnSave.Enabled = true;
  2857. // }
  2858. //}
  2859. ////操作工序
  2860. //if (!this.btnSave.Enabled)
  2861. //{
  2862. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  2863. // {
  2864. // this.btnSave.Enabled = false;
  2865. // }
  2866. // else
  2867. // {
  2868. // this.btnSave.Enabled = true;
  2869. // }
  2870. //}
  2871. ////操作生产线
  2872. //if (!this.btnSave.Enabled)
  2873. //{
  2874. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  2875. // {
  2876. // this.btnSave.Enabled = false;
  2877. // }
  2878. // else
  2879. // {
  2880. // this.btnSave.Enabled = true;
  2881. // }
  2882. //}
  2883. //// 取消工序
  2884. //if (!this.btnSave.Enabled)
  2885. //{
  2886. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  2887. // {
  2888. // this.btnSave.Enabled = false;
  2889. // }
  2890. // else
  2891. // {
  2892. // this.btnSave.Enabled = true;
  2893. // }
  2894. //}
  2895. //if (!this.btnSave.Enabled)
  2896. //{
  2897. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  2898. //}
  2899. //this.btnSave.Enabled = true;
  2900. }
  2901. private void dgvUser_UserAddedRow(object sender, DataGridViewRowEventArgs e)
  2902. {
  2903. }
  2904. /// <summary>
  2905. /// 查看生产线按钮事件
  2906. /// </summary>
  2907. /// <param name="sender"></param>
  2908. /// <param name="e"></param>
  2909. private void chkViewProductionlineFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  2910. {
  2911. //if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  2912. //{
  2913. // this.btnSave.Enabled = false;
  2914. //}
  2915. //else
  2916. //{
  2917. // this.btnSave.Enabled = true;
  2918. //}
  2919. //// 查看工序
  2920. //if (!this.btnSave.Enabled)
  2921. //{
  2922. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  2923. // {
  2924. // this.btnSave.Enabled = false;
  2925. // }
  2926. // else
  2927. // {
  2928. // this.btnSave.Enabled = true;
  2929. // }
  2930. //}
  2931. //// 操作工号
  2932. //if (!this.btnSave.Enabled)
  2933. //{
  2934. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  2935. // {
  2936. // this.btnSave.Enabled = false;
  2937. // }
  2938. // else
  2939. // {
  2940. // this.btnSave.Enabled = true;
  2941. // }
  2942. //}
  2943. //// 查看工号
  2944. //if (!this.btnSave.Enabled)
  2945. //{
  2946. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  2947. // {
  2948. // this.btnSave.Enabled = false;
  2949. // }
  2950. // else
  2951. // {
  2952. // this.btnSave.Enabled = true;
  2953. // }
  2954. //}
  2955. ////查看成型线
  2956. //if (!this.btnSave.Enabled)
  2957. //{
  2958. // // 自己按钮事件
  2959. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  2960. // {
  2961. // this.btnSave.Enabled = false;
  2962. // }
  2963. // else
  2964. // {
  2965. // this.btnSave.Enabled = true;
  2966. // }
  2967. //}
  2968. ////操作成型线
  2969. //if (!this.btnSave.Enabled)
  2970. //{
  2971. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  2972. // {
  2973. // this.btnSave.Enabled = false;
  2974. // }
  2975. // else
  2976. // {
  2977. // this.btnSave.Enabled = true;
  2978. // }
  2979. //}
  2980. ////操作温湿度
  2981. //if (!this.btnSave.Enabled)
  2982. //{
  2983. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  2984. // {
  2985. // this.btnSave.Enabled = false;
  2986. // }
  2987. // else
  2988. // {
  2989. // this.btnSave.Enabled = true;
  2990. // }
  2991. //}
  2992. ////查看温湿度
  2993. //if (!this.btnSave.Enabled)
  2994. //{
  2995. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  2996. // {
  2997. // this.btnSave.Enabled = false;
  2998. // }
  2999. // else
  3000. // {
  3001. // this.btnSave.Enabled = true;
  3002. // }
  3003. //}
  3004. ////查看部门
  3005. //if (!this.btnSave.Enabled)
  3006. //{
  3007. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  3008. // {
  3009. // this.btnSave.Enabled = false;
  3010. // }
  3011. // else
  3012. // {
  3013. // this.btnSave.Enabled = true;
  3014. // }
  3015. //}
  3016. ////操作部门
  3017. //if (!this.btnSave.Enabled)
  3018. //{
  3019. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  3020. // {
  3021. // this.btnSave.Enabled = false;
  3022. // }
  3023. // else
  3024. // {
  3025. // this.btnSave.Enabled = true;
  3026. // }
  3027. //}
  3028. ////操作工序
  3029. //if (!this.btnSave.Enabled)
  3030. //{
  3031. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  3032. // {
  3033. // this.btnSave.Enabled = false;
  3034. // }
  3035. // else
  3036. // {
  3037. // this.btnSave.Enabled = true;
  3038. // }
  3039. //}
  3040. ////操作生产线
  3041. //if (!this.btnSave.Enabled)
  3042. //{
  3043. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  3044. // {
  3045. // this.btnSave.Enabled = false;
  3046. // }
  3047. // else
  3048. // {
  3049. // this.btnSave.Enabled = true;
  3050. // }
  3051. //}
  3052. //// 取消工序
  3053. //if (!this.btnSave.Enabled)
  3054. //{
  3055. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  3056. // {
  3057. // this.btnSave.Enabled = false;
  3058. // }
  3059. // else
  3060. // {
  3061. // this.btnSave.Enabled = true;
  3062. // }
  3063. //}
  3064. //if (!this.btnSave.Enabled)
  3065. //{
  3066. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  3067. //}
  3068. //this.btnSave.Enabled = true;
  3069. }
  3070. /// <summary>
  3071. /// 操作生产线按钮事件
  3072. /// </summary>
  3073. /// <param name="sender"></param>
  3074. /// <param name="e"></param>
  3075. private void chkProductionlineFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  3076. {
  3077. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  3078. // {
  3079. // this.btnSave.Enabled = false;
  3080. // }
  3081. // else
  3082. // {
  3083. // this.btnSave.Enabled = true;
  3084. // }
  3085. // 操作生产线
  3086. // if (!this.btnSave.Enabled)
  3087. // {
  3088. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  3089. // {
  3090. // this.btnSave.Enabled = false;
  3091. // }
  3092. // else
  3093. // {
  3094. // this.btnSave.Enabled = true;
  3095. // }
  3096. // }
  3097. // 操作工号
  3098. // if (!this.btnSave.Enabled)
  3099. // {
  3100. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  3101. // {
  3102. // this.btnSave.Enabled = false;
  3103. // }
  3104. // else
  3105. // {
  3106. // this.btnSave.Enabled = true;
  3107. // }
  3108. // }
  3109. // 查看工号
  3110. // if (!this.btnSave.Enabled)
  3111. // {
  3112. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  3113. // {
  3114. // this.btnSave.Enabled = false;
  3115. // }
  3116. // else
  3117. // {
  3118. // this.btnSave.Enabled = true;
  3119. // }
  3120. // }
  3121. // 查看成型线
  3122. // if (!this.btnSave.Enabled)
  3123. // {
  3124. // 自己按钮事件
  3125. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  3126. // {
  3127. // this.btnSave.Enabled = false;
  3128. // }
  3129. // else
  3130. // {
  3131. // this.btnSave.Enabled = true;
  3132. // }
  3133. // }
  3134. // 操作成型线
  3135. // if (!this.btnSave.Enabled)
  3136. // {
  3137. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  3138. // {
  3139. // this.btnSave.Enabled = false;
  3140. // }
  3141. // else
  3142. // {
  3143. // this.btnSave.Enabled = true;
  3144. // }
  3145. // }
  3146. // 操作温湿度
  3147. // if (!this.btnSave.Enabled)
  3148. // {
  3149. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  3150. // {
  3151. // this.btnSave.Enabled = false;
  3152. // }
  3153. // else
  3154. // {
  3155. // this.btnSave.Enabled = true;
  3156. // }
  3157. // }
  3158. // 查看温湿度
  3159. // if (!this.btnSave.Enabled)
  3160. // {
  3161. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  3162. // {
  3163. // this.btnSave.Enabled = false;
  3164. // }
  3165. // else
  3166. // {
  3167. // this.btnSave.Enabled = true;
  3168. // }
  3169. // }
  3170. // 查看部门
  3171. // if (!this.btnSave.Enabled)
  3172. // {
  3173. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  3174. // {
  3175. // this.btnSave.Enabled = false;
  3176. // }
  3177. // else
  3178. // {
  3179. // this.btnSave.Enabled = true;
  3180. // }
  3181. // }
  3182. // 操作部门
  3183. // if (!this.btnSave.Enabled)
  3184. // {
  3185. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  3186. // {
  3187. // this.btnSave.Enabled = false;
  3188. // }
  3189. // else
  3190. // {
  3191. // this.btnSave.Enabled = true;
  3192. // }
  3193. // }
  3194. // 查看工序
  3195. // if (!this.btnSave.Enabled)
  3196. // {
  3197. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  3198. // {
  3199. // this.btnSave.Enabled = false;
  3200. // }
  3201. // else
  3202. // {
  3203. // this.btnSave.Enabled = true;
  3204. // }
  3205. // }
  3206. // 查看生产线
  3207. // if (!this.btnSave.Enabled)
  3208. // {
  3209. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  3210. // {
  3211. // this.btnSave.Enabled = false;
  3212. // }
  3213. // else
  3214. // {
  3215. // this.btnSave.Enabled = true;
  3216. // }
  3217. // }
  3218. // 取消工序
  3219. // if (!this.btnSave.Enabled)
  3220. // {
  3221. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  3222. // {
  3223. // this.btnSave.Enabled = false;
  3224. // }
  3225. // else
  3226. // {
  3227. // this.btnSave.Enabled = true;
  3228. // }
  3229. // }
  3230. // if (!this.btnSave.Enabled)
  3231. // {
  3232. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  3233. // }
  3234. // this.btnSave.Enabled = true;
  3235. }
  3236. private void chkCancelProceduceChooseAll_CheckedChanged(object sender, EventArgs e)
  3237. {
  3238. this.CheckTreeview(this.treeViewCancel, this.chkCancelProceduceChooseAll.Checked);
  3239. }
  3240. private void chkCancelProceduceFunctionCodeAll_CheckedChanged(object sender, EventArgs e)
  3241. {
  3242. //// 取消工序
  3243. //if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  3244. //{
  3245. // this.btnSave.Enabled = false;
  3246. //}
  3247. //else
  3248. //{
  3249. // this.btnSave.Enabled = true;
  3250. //}
  3251. //if (!this.btnSave.Enabled)
  3252. //{
  3253. // if (this.chkThermometerFunctionCodeAll.Checked == this._thermometer)
  3254. // {
  3255. // this.btnSave.Enabled = false;
  3256. // }
  3257. // else
  3258. // {
  3259. // this.btnSave.Enabled = true;
  3260. // }
  3261. //}
  3262. //// 操作工号
  3263. //if (!this.btnSave.Enabled)
  3264. //{
  3265. // if (this.chkUserFunctionCodeAll1.Checked == this._user)
  3266. // {
  3267. // this.btnSave.Enabled = false;
  3268. // }
  3269. // else
  3270. // {
  3271. // this.btnSave.Enabled = true;
  3272. // }
  3273. //}
  3274. //// 查看工号
  3275. //if (!this.btnSave.Enabled)
  3276. //{
  3277. // if (this.chkViewUserFunctionCodeAll.Checked == this._viewUser)
  3278. // {
  3279. // this.btnSave.Enabled = false;
  3280. // }
  3281. // else
  3282. // {
  3283. // this.btnSave.Enabled = true;
  3284. // }
  3285. //}
  3286. ////查看成型线
  3287. //if (!this.btnSave.Enabled)
  3288. //{
  3289. // // 自己按钮事件
  3290. // if (this.chkViewGroutingLinerFunctionCodeAll.Checked == this._viewGroutingLine)
  3291. // {
  3292. // this.btnSave.Enabled = false;
  3293. // }
  3294. // else
  3295. // {
  3296. // this.btnSave.Enabled = true;
  3297. // }
  3298. //}
  3299. ////操作成型线
  3300. //if (!this.btnSave.Enabled)
  3301. //{
  3302. // if (this.chkGroutingLinerFunctionCodeAll.Checked == this._groutingLine)
  3303. // {
  3304. // this.btnSave.Enabled = false;
  3305. // }
  3306. // else
  3307. // {
  3308. // this.btnSave.Enabled = true;
  3309. // }
  3310. //}
  3311. ////查看温湿度
  3312. //if (!this.btnSave.Enabled)
  3313. //{
  3314. // if (this.chkViewThermometerFunctionCodeAll.Checked == this._viewThermometer)
  3315. // {
  3316. // this.btnSave.Enabled = false;
  3317. // }
  3318. // else
  3319. // {
  3320. // this.btnSave.Enabled = true;
  3321. // }
  3322. //}
  3323. ////查看部门
  3324. //if (!this.btnSave.Enabled)
  3325. //{
  3326. // if (this.chkViewOrganizationFunctionCodeAll.Checked == this._viewOrganization)
  3327. // {
  3328. // this.btnSave.Enabled = false;
  3329. // }
  3330. // else
  3331. // {
  3332. // this.btnSave.Enabled = true;
  3333. // }
  3334. //}
  3335. ////操作部门
  3336. //if (!this.btnSave.Enabled)
  3337. //{
  3338. // if (this.chkOrganizationFunctionCodeAll.Checked == this._organization)
  3339. // {
  3340. // this.btnSave.Enabled = false;
  3341. // }
  3342. // else
  3343. // {
  3344. // this.btnSave.Enabled = true;
  3345. // }
  3346. //}
  3347. ////查看工序
  3348. //if (!this.btnSave.Enabled)
  3349. //{
  3350. // if (this.chkViewProceduceFunctionCodeAll.Checked == this._viewProceduce)
  3351. // {
  3352. // this.btnSave.Enabled = false;
  3353. // }
  3354. // else
  3355. // {
  3356. // this.btnSave.Enabled = true;
  3357. // }
  3358. //}
  3359. ////查看生产线
  3360. //if (!this.btnSave.Enabled)
  3361. //{
  3362. // if (this.chkViewProductionlineFunctionCodeAll.Checked == this._viewProductionline)
  3363. // {
  3364. // this.btnSave.Enabled = false;
  3365. // }
  3366. // else
  3367. // {
  3368. // this.btnSave.Enabled = true;
  3369. // }
  3370. //}
  3371. ////操作工序
  3372. //if (!this.btnSave.Enabled)
  3373. //{
  3374. // if (this.chkProceduceFunctionCodeAll.Checked == this._proceduce)
  3375. // {
  3376. // this.btnSave.Enabled = false;
  3377. // }
  3378. // else
  3379. // {
  3380. // this.btnSave.Enabled = true;
  3381. // }
  3382. //}
  3383. ////操作生产线
  3384. //if (!this.btnSave.Enabled)
  3385. //{
  3386. // if (this.chkProductionlineFunctionCodeAll.Checked == this._productionline)
  3387. // {
  3388. // this.btnSave.Enabled = false;
  3389. // }
  3390. // else
  3391. // {
  3392. // this.btnSave.Enabled = true;
  3393. // }
  3394. //}
  3395. //// 取消工序
  3396. //if (!this.btnSave.Enabled)
  3397. //{
  3398. // if (this.chkCancelProceduceFunctionCodeAll.Checked == this._cancelProceduce)
  3399. // {
  3400. // this.btnSave.Enabled = false;
  3401. // }
  3402. // else
  3403. // {
  3404. // this.btnSave.Enabled = true;
  3405. // }
  3406. //}
  3407. //if (!this.btnSave.Enabled)
  3408. //{
  3409. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  3410. //}
  3411. //this.btnSave.Enabled = true;
  3412. }
  3413. private void btnCancelProductionLineExpand_Click(object sender, EventArgs e)
  3414. {
  3415. this.treeViewCancel.ExpandAll();
  3416. }
  3417. private void btnCancelProductionCollapse_Click(object sender, EventArgs e)
  3418. {
  3419. this.treeViewCancel.CollapseAll();
  3420. }
  3421. private void treeViewCancel_AfterCheck(object sender, TreeViewEventArgs e)
  3422. {
  3423. try
  3424. {
  3425. int purviewID = Convert.ToInt32(e.Node.Tag);
  3426. //起始为ProductionLine_为成型生产线,否则为工序
  3427. foreach (DataRow dataRow in (e.Node.Name.StartsWith("ProductionLine_") ? _userRightData.Tables[14].Rows : _userRightData.Tables[12].Rows))
  3428. {
  3429. if (purviewID == Convert.ToInt32(dataRow["PurviewID"]))
  3430. {
  3431. dataRow["RightFlag"] = e.Node.Checked;
  3432. break;
  3433. }
  3434. if (e.Node.Parent != null)
  3435. {
  3436. if (e.Node.Checked)
  3437. e.Node.Parent.Checked = true;
  3438. }
  3439. }
  3440. //if (!this._isFirstLoad)
  3441. //{
  3442. // // 保存按钮状态改变
  3443. // this.btnSave.Enabled = DataJudge.IsChange(this._userRightData);
  3444. //}
  3445. //this.btnSave.Enabled = true;
  3446. }
  3447. catch (Exception ex)
  3448. {
  3449. // 对异常进行共通处理
  3450. ExceptionManager.HandleEventException(this.ToString(),
  3451. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  3452. }
  3453. }
  3454. }
  3455. }