FrmBLCodeManage.cs 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Format;
  3. using Core.Mes.Client.Comm.Server;
  4. using Core.Mes.Client.Comm.Tool;
  5. using CoreFS.CA06;
  6. using CoreFS.SA06;
  7. using Infragistics.Win;
  8. using Infragistics.Win.UltraWinEditors;
  9. using Infragistics.Win.UltraWinGrid;
  10. using System;
  11. using System.Collections;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.Linq;
  15. using System.Windows.Forms;
  16. namespace Core.StlMes.Client.Qcm
  17. {
  18. public partial class FrmBLCodeManage : FrmBase
  19. {
  20. private string _steels = "'1'";
  21. public string Steels
  22. {
  23. get { return _steels; }
  24. set { _steels = value; }
  25. }
  26. private string _stdCode = "";
  27. public string StdCode
  28. {
  29. get { return _stdCode; }
  30. set { _stdCode = value; }
  31. }
  32. private string keyJg = "";
  33. public string KeyJg
  34. {
  35. get { return keyJg; }
  36. set { keyJg = value; }
  37. }
  38. private string dimater = "";
  39. public string Dimater
  40. {
  41. get { return dimater; }
  42. set { dimater = value; }
  43. }
  44. private string height = "";
  45. public string Height1
  46. {
  47. get { return height; }
  48. set { height = value; }
  49. }
  50. private string specCode = "";
  51. public string SpecCode
  52. {
  53. get { return specCode; }
  54. set { specCode = value; }
  55. }
  56. private string textMsc = "";
  57. public string TextMsc
  58. {
  59. get { return textMsc; }
  60. set { textMsc = value; }
  61. }
  62. private string ordLnPk = "";
  63. public string OrdLnPk
  64. {
  65. get { return ordLnPk; }
  66. set { ordLnPk = value; }
  67. }
  68. //新增保存参数
  69. private ComMscBlEntity mscBlEntity;
  70. private PscEntity pscEntity;
  71. public FrmBLCodeManage()
  72. {
  73. InitializeComponent();
  74. this.IsLoadUserView = true;
  75. this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Hidden = true;
  76. GridHelper.SetExcludeColumnsActive(ultraGrid1.DisplayLayout.Bands[0], "");
  77. ExceptionHelper.RegistException();
  78. }
  79. public void PopupLoad(string customInfo, OpeBase ob)
  80. {
  81. this.CustomInfo = customInfo;
  82. this.ob = ob;
  83. this.OnLoad(EventArgs.Empty);
  84. }
  85. private void FrmBLCodeManage_Load(object sender, EventArgs e)
  86. {//初始化界面上的下拉框
  87. InitCombo();
  88. }
  89. /// <summary>
  90. /// 初始化下拉框
  91. /// </summary>
  92. /// <param name="uce">下拉框控件名字</param>
  93. /// <param name="MethodId">请求的服务包名+类名+方法名</param>
  94. /// <param name="memberValue">下拉框的值成员</param>
  95. private void initJGDropDown(UltraComboEditor uce, string MethodId, string memberValue)
  96. {
  97. //初始化编辑区域下拉框
  98. DataTable dt = ServerHelper.GetData(MethodId, null, this.ob);
  99. if (dt != null && dt.Rows.Count > 0)
  100. {
  101. if (uce == ultraComboEditor8)
  102. {
  103. Object[] obj = new Object[] { "", "" };
  104. dt.Rows.Add(obj);
  105. }
  106. uce.DataSource = dt;
  107. uce.ValueMember = memberValue;
  108. }
  109. }
  110. private void InitCombo()
  111. {
  112. ultraComboEditor5.DataSource = ServerHelper.GetData("com.steering.pss.qcm.JGCodeManage.GetCPProduct", new object[] { }, ob);
  113. ultraComboEditor5.ValueMember = "PRODUCCODE";
  114. ultraComboEditor5.DisplayMember = "PRODUCNAME";
  115. ultraComboEditor9.DataSource = ServerHelper.GetData("com.steering.pss.qcm.JGCodeManage.GetJGModel", new object[] { }, ob);
  116. ultraComboEditor9.ValueMember = "MODEL_CODE";
  117. ultraComboEditor9.DisplayMember = "MODEL_DESC";
  118. //initJGDropDown(ultraComboEditor5, "com.steering.pss.qcm.JGCodeManage.GetCPProduct", "PRODUCCODE"); //品名
  119. initJGDropDown(ultraComboEditor7, "com.steering.pss.qcm.JGCodeManage.GetJGSteel", "STEELCODE"); //钢级牌号
  120. initJGDropDown(ultraComboEditor8, "com.steering.pss.qcm.BLCodeManage.GetBLSType", "STD_STYLE"); //标准类别
  121. //initJGDropDown(ultraComboEditor9, "com.steering.pss.qcm.JGCodeManage.GetJGModel", "MODEL_CODE"); //扣型描述
  122. //initJGDropDown(ultraComboEditor10, "com.steering.pss.qcm.BLCodeManage.GetBLStd_Alpha", "STD_CODE"); //标准
  123. ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "1218", ob, false);
  124. ClsBaseInfo.FillComBaseInfo(ultraComboEditor2, "1219", ob, false);
  125. ClsBaseInfo.SetComboItemHeight(ultraComboEditor5);
  126. ClsBaseInfo.SetComboItemHeight(ultraComboEditor7);
  127. ClsBaseInfo.SetComboItemHeight(ultraComboEditor8);
  128. ClsBaseInfo.SetComboItemHeight(ultraComboEditor9);
  129. //设置品名默认为备料管
  130. DataTable dt3 = (DataTable)ultraComboEditor5.DataSource;
  131. dt3.DefaultView.RowFilter = "PRODUCCODE IN ('S000046', 'S000130','S000155')";
  132. //if (ultraComboEditor5.Items.Count > 0)
  133. //{
  134. // ultraComboEditor5.SelectedIndex = 0;
  135. //}
  136. //else
  137. //{
  138. // MessageUtil.ShowWarning("在品名基础数据中未找到[备料管],请维护[备料管]!");
  139. // return;
  140. //}
  141. //设置扣型默认为/
  142. DataTable dt = (DataTable)ultraComboEditor9.DataSource;
  143. dt.DefaultView.RowFilter = "MODEL_DESC = '/'";
  144. if (ultraComboEditor9.Items.Count > 0)
  145. {
  146. ultraComboEditor9.SelectedIndex = 0;
  147. }
  148. else
  149. {
  150. MessageUtil.ShowWarning("在扣型基础数据中未找到[/],请维护[/]!");
  151. return;
  152. }
  153. ValueList plnStatusList = new ValueList();
  154. plnStatusList.ValueListItems.Add("0", "计划");
  155. plnStatusList.ValueListItems.Add("1", "生产中");
  156. plnStatusList.ValueListItems.Add("2", "完成");
  157. plnStatusList.ValueListItems.Add("3", "关闭");
  158. plnStatusList.ValueListItems.Add("4", "关闭");
  159. ultraGrid1.DisplayLayout.Bands[0].Columns["PLN_STATUS"].ValueList = plnStatusList;
  160. }
  161. private bool _isPopup = false;
  162. /// <summary>
  163. /// 是否弹窗
  164. /// </summary>
  165. public bool IsPopup
  166. {
  167. get { return _isPopup; }
  168. set { _isPopup = value; }
  169. }
  170. public override void ToolBar_Click(object sender, string ToolbarKey)
  171. {
  172. switch (ToolbarKey)
  173. {
  174. case "Query":
  175. this.doQuery();
  176. break;
  177. case "Add":
  178. this.doAdd();
  179. break;
  180. case "Update":
  181. this.doUpdate();
  182. break;
  183. case "Delete":
  184. this.doDeleteOrResume(true);
  185. break;
  186. case "Resume":
  187. this.doDeleteOrResume(false);
  188. break;
  189. case "Refresh":
  190. this.doRefresh();
  191. break;
  192. case "TechnologyReview":
  193. TechnologyReview();
  194. break;
  195. case "ShowMsc":
  196. ShowMsc();
  197. break;
  198. case "Export":
  199. Export();
  200. break;
  201. case "ShowBlOrder":
  202. ShowBlOrder();
  203. break;
  204. case "Close":
  205. this.Close();
  206. break;
  207. }
  208. }
  209. private void ShowBlOrder()
  210. {
  211. if (ultraGrid1.ActiveRow == null) return;
  212. try
  213. {
  214. this.Cursor = Cursors.WaitCursor;
  215. FrmBlCodeManageOrder frm = new FrmBlCodeManageOrder(ob, ultraGrid1.ActiveRow.GetValue("PSC_BL"));
  216. frm.Load += (a, b) =>
  217. {
  218. this.Cursor = Cursors.Default;
  219. };
  220. frm.ShowDialog();
  221. }
  222. finally
  223. {
  224. this.Cursor = Cursors.Default;
  225. }
  226. }
  227. private void Export()
  228. {
  229. GridHelper.ulGridToExcel(ultraGrid1, "备料基础信息");
  230. }
  231. private void ShowMsc()
  232. {
  233. if (ultraGrid1.ActiveRow == null)
  234. {
  235. MessageUtil.ShowWarning("请选择一行记录!");
  236. return;
  237. }
  238. DataTable dtPsc = GetPscByBl(ultraGrid1.GetActiveRowValue("PSC_BL"));
  239. if (dtPsc.Rows.Count > 1)
  240. {
  241. MessageUtil.ShowWarning("通过备料码找到多条产品信息,请作废多余的产品信息!\r\n(查找方式:品名+钢级+标准类别+标准名称)");
  242. return;
  243. }
  244. string psc = dtPsc.Rows[0]["PSC"].ToString();
  245. string useCode = ultraGrid1.GetActiveRowValue("USE_CODE");
  246. FrmProPSCMSC2Popup popup = null;
  247. try
  248. {
  249. this.Cursor = Cursors.WaitCursor;
  250. popup = new FrmProPSCMSC2Popup(new string[] { psc, textMsc, dimater, height, specCode, ordLnPk }, "", "", useCode, ordLnPk, false,
  251. this.ValidDataPurviewIds, StdExceptionType.AllMsc, "", ob);
  252. }
  253. finally
  254. {
  255. this.Cursor = Cursors.Default;
  256. }
  257. popup.ShowDialog();
  258. }
  259. private DataTable GetPscByBl(String blCode)
  260. {
  261. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.getPscByBl", new object[] { blCode }, ob);
  262. return dt;
  263. }
  264. private void TechnologyReview()
  265. {
  266. if (ultraGrid1.ActiveRow == null)
  267. {
  268. if (_isPopup == false)
  269. {
  270. MessageUtil.ShowWarning("请选择一条记录,然后再进行提交技术评审!");
  271. }
  272. }
  273. string blCode = ultraGrid1.ActiveRow.GetValue("PSC_BL");
  274. bool result = TechnologyReview2(blCode);
  275. if (result)
  276. {
  277. if (_isPopup == false)
  278. {
  279. MessageUtil.ShowTips("提交技术评审成功!");
  280. }
  281. }
  282. else
  283. {
  284. return;
  285. }
  286. doQuery();
  287. var queryableRows = ultraGrid1.Rows.AsQueryable().Where(a => a.GetValue("PSC_BL") == blCode);
  288. if (queryableRows.Count() > 0)
  289. {
  290. queryableRows.First().Activate();
  291. }
  292. }
  293. public bool TechnologyReview2(string blCode)
  294. {
  295. DataTable dtMscBl = QueryMscBlByPk(blCode);
  296. if (dtMscBl.Rows[0]["REVIEW_STATUS"].ToString() == "1")
  297. {
  298. if (_isPopup == false)
  299. {
  300. MessageUtil.ShowWarning("正在技术评审中,不允许再次提交技术评审!");
  301. return false;
  302. }
  303. return true;
  304. }
  305. if (_isPopup == false && MessageUtil.ShowYesNoAndQuestion("是否确认提交技术评审?") == DialogResult.No)
  306. {
  307. return false;
  308. }
  309. CoreClientParam ccp = new CoreClientParam();
  310. ccp.MethodName = "qualityDesignBL";
  311. ccp.ServerName = "com.steering.pss.sale.order.qualityDesign.QualityDesignBL";
  312. ccp.ServerParams = new object[] { blCode, UserInfo.GetUserName() };
  313. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  314. if (ccp.ReturnInfo != "")
  315. {
  316. MessageUtil.ShowWarning(ccp.ReturnInfo);
  317. return false;
  318. }
  319. else
  320. {
  321. ServerHelper.SetData("com.steering.pss.qcm.BLCodeManage.updateReviewStateByPk",
  322. new object[] { "1", blCode }, ob);
  323. return true;
  324. }
  325. }
  326. private void doRefresh()
  327. {
  328. InitCombo();
  329. }
  330. //ArrayList parms = new ArrayList(); //参数
  331. private void doQuery()
  332. {
  333. try
  334. {
  335. ((Form)this.TopLevelControl).Cursor = Cursors.WaitCursor;
  336. bool validFlag = chkValid.Checked;
  337. ArrayList parm = new ArrayList();
  338. if (this.ultraCheckEditor1.Checked)
  339. {
  340. parm.Add(this.ultraTextEditor1.Text);
  341. }
  342. else
  343. {
  344. parm.Add("");
  345. }
  346. if (this.ultraCheckEditor2.Checked)
  347. {
  348. parm.Add(this.ultraTextEditor2.Text);
  349. }
  350. else
  351. {
  352. parm.Add("");
  353. }
  354. if (this.ultraCheckEditor3.Checked)
  355. {
  356. parm.Add(this.ultraTextEditor4.Text);
  357. }
  358. else
  359. {
  360. parm.Add("");
  361. }
  362. if (this.ultraCheckEditor4.Checked)
  363. {
  364. parm.Add(this.ultraTextEditor5.Text);
  365. }
  366. else
  367. {
  368. parm.Add("");
  369. }
  370. if (this.ultraCheckEditor5.Checked)
  371. {
  372. parm.Add(this.ultraTextEditor6.Text);
  373. }
  374. else
  375. {
  376. parm.Add("");
  377. }
  378. string steels = _steels.Substring(1, _steels.Length - 1);
  379. //steels = steels.Substring(0, steels.Length - 1);
  380. steels = "1";//取消钢级限制
  381. parm.Add(steels);
  382. parm.Add(ultraCheckEditor6.Checked ? ultraNumericEditor4.Value.ToString2() : "");
  383. parm.Add(ultraCheckEditor7.Checked ? ultraNumericEditor3.Value.ToString2() : "");
  384. parm.Add(_stdCode);
  385. parm.Add(keyJg);
  386. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.doQuery", new Object[] { validFlag, parm }, this.ob);
  387. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
  388. //不同颜色区分是否有效数据
  389. UltraGridColumn[] col = new UltraGridColumn[] { this.ultraGrid1.DisplayLayout.Bands[0].Columns["MEMO"] };
  390. //GridHelper.RefreshAndAutoSizeExceptRows(ultraGrid1, col);
  391. Infragistics.Win.UltraWinGrid.UltraGridRow row = null;
  392. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  393. {
  394. row = ultraGrid1.Rows[i];
  395. if (!row.Cells["VALIDFLAG"].Value.ToString().Equals("有效"))
  396. {
  397. row.Appearance.ForeColor = Color.Red;
  398. }
  399. else
  400. {
  401. row.Appearance.ForeColor = Color.Black;
  402. }
  403. }
  404. if (dt != null && dt.Rows.Count > 0)
  405. {
  406. ultraGrid1.Rows[0].Activate();//默认激活首行
  407. }
  408. if (ultraGrid1.Rows.Count == 0)
  409. {
  410. numMinL.Value = 6;
  411. numMinL.Value = 9;
  412. }
  413. }
  414. finally
  415. {
  416. ((Form)this.TopLevelControl).Cursor = Cursors.Default;
  417. }
  418. }
  419. private void doAdd()
  420. {
  421. //parms = new ArrayList();
  422. if (ValidInput())
  423. {
  424. if (isExistBl("Add") == true)
  425. {
  426. MessageUtil.ShowWarning("系统已经存在相同的数据!");
  427. return;
  428. }
  429. string strJSONBl = JSONFormat.Format(mscBlEntity);
  430. string strJSONPsc = JSONFormat.Format(pscEntity);
  431. int count = ServerHelper.SetData("com.steering.pss.qcm.BLCodeManage.doAdd",
  432. new Object[] { strJSONBl, strJSONPsc }, this.ob);
  433. if (count > 0)
  434. {
  435. doQuery();
  436. //高亮显示新增的数据
  437. UltraGridRow[] rows = ultraGrid1.Rows.AsQueryable().Where("CREATE_NAME = '" + this.UserInfo.GetUserName() + "'")
  438. .OrderByDescending(a => a.GetValue("CREATE_TIME")).ToArray();
  439. if (rows.Length > 0)
  440. {
  441. rows[0].Activate();
  442. }
  443. }
  444. }
  445. }
  446. private void doUpdate()
  447. {
  448. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  449. if (ugr == null)
  450. {
  451. MessageBox.Show("请选择需要操作的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  452. return;
  453. }
  454. if (ugr.GetValue("CREATE_NAME") != UserInfo.GetUserName() && UserInfo.GetUserID() != "admin")
  455. {
  456. MessageUtil.ShowWarning("您不是该记录的创建人,没有修改权限!");
  457. return;
  458. }
  459. if (ugr.Cells["VALIDFLAG"].Value.ToString() == "无效")
  460. {
  461. MessageBox.Show("您所选的数据已经无效,无法修改", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  462. return;
  463. }
  464. if (PkIsChange() && QueryIsRef(ugr.Cells["PSC_BL"].Value.ToString()))
  465. {
  466. MessageUtil.ShowWarning("该备料已被引用,不能修改!");
  467. return;
  468. }
  469. DataTable dtMscBl = QueryMscBlByPk(ugr.Cells["PSC_BL"].Value.ToString());
  470. if (dtMscBl.Rows[0]["REVIEW_STATUS"].ToString() == "1")
  471. {
  472. MessageUtil.ShowWarning("正在技术评审中,不允许修改!");
  473. return;
  474. }
  475. //parms = new ArrayList();
  476. if (ValidInput())
  477. {
  478. if (isExistBl("Update") == true)
  479. {
  480. MessageUtil.ShowWarning("系统已经存在相同的数据!");
  481. return;
  482. }
  483. if (MessageBox.Show("是否确认修改该行数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  484. {
  485. return;
  486. }
  487. //parms.Add(this.UserInfo.GetUserName()); //操作人
  488. //string blcode = ugr.Cells["PSC_BL"].Value.ToString();
  489. //parms.Add(blcode);
  490. string strJSONBl = JSONFormat.Format(mscBlEntity);
  491. string strJSONPsc = JSONFormat.Format(pscEntity);
  492. int count = ServerHelper.SetData("com.steering.pss.qcm.BLCodeManage.doUpdate", new Object[] { strJSONBl, strJSONPsc }, this.ob);
  493. if (count > 0)
  494. {
  495. doQuery();
  496. //高亮显示修改的数据
  497. Infragistics.Win.UltraWinGrid.UltraGridRow row = null;
  498. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  499. {
  500. row = ultraGrid1.Rows[i];
  501. if (row.Cells["PSC_BL"].Value.ToString().Equals(mscBlEntity.PscBl.ToString()))
  502. {
  503. row.Activate();
  504. break;
  505. }
  506. }
  507. }
  508. }
  509. }
  510. /// <summary>
  511. /// 删除与恢复
  512. /// </summary>
  513. /// <param name="flag">true删除,false恢复</param>
  514. private void doDeleteOrResume(bool flag)
  515. {
  516. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  517. if (ugr == null)
  518. {
  519. MessageBox.Show("请选择需要操作的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  520. return;
  521. }
  522. string blcode = ugr.Cells["PSC_BL"].Value.ToString(); //备料码
  523. if (ugr.Cells["VALIDFLAG"].Value.ToString() == "无效" && flag == true)
  524. {
  525. MessageBox.Show("您所选的数据已经无效,无法作废", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  526. return;
  527. }
  528. DataTable dtMscBl = QueryMscBlByPk(blcode);
  529. if (dtMscBl.Rows[0]["REVIEW_STATUS"].ToString() == "1")
  530. {
  531. if (_isPopup == false)
  532. {
  533. MessageUtil.ShowWarning("该备料正在技术评审中,不能作废!");
  534. }
  535. return;
  536. }
  537. //if (flag)
  538. //{
  539. // if (IsRef(blcode))
  540. // {
  541. // MessageUtil.ShowWarning("该备料码已被引用,不能作废!");
  542. // return;
  543. // }
  544. //}
  545. if (ugr.Cells["VALIDFLAG"].Value.ToString() == "有效" && flag == false)
  546. {
  547. MessageBox.Show("您所选的数据已经有效,无法恢复", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  548. return;
  549. }
  550. if (MessageBox.Show("是否确认" + (flag ? "作废" : "恢复") + "选中的数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  551. {
  552. return;
  553. }
  554. string deletename = this.UserInfo.GetUserName().Trim(); //操作人
  555. int count = ServerHelper.SetData("com.steering.pss.qcm.BLCodeManage.doDeleteOrResume", new Object[] { blcode, deletename, flag }, this.ob);
  556. if (count > 0)
  557. {
  558. doQuery();
  559. if (flag == false)
  560. {
  561. Infragistics.Win.UltraWinGrid.UltraGridRow row = null;
  562. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  563. {
  564. row = ultraGrid1.Rows[i];
  565. if (row.Cells["PSC_BL"].Value.ToString().Equals(blcode))
  566. {
  567. row.Activate();
  568. break;
  569. }
  570. }
  571. }
  572. }
  573. }
  574. private bool IsRef(string blCode)
  575. {
  576. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.getIsRef",
  577. new object[] { blCode }, ob);
  578. if (dt.Rows[0][0].ToString() != "0")
  579. {
  580. return true;
  581. }
  582. else
  583. {
  584. return false;
  585. }
  586. }
  587. private bool isExistBl(string strAction)
  588. {
  589. bool isSample = false;
  590. string stdStyle = ultraComboEditor8.Value == null ? "" : ultraComboEditor8.Value.ToString();
  591. if (ultraGrid1.ActiveRow != null)
  592. {
  593. if (ultraGrid1.ActiveRow.Cells["PRODUCCODE"].Value.ToString() == ultraComboEditor5.Value.ToString()
  594. && ultraGrid1.ActiveRow.Cells["STD_CODE"].Value.ToString() == ultraTextEditor7.Tag.ToString2()
  595. && ultraGrid1.ActiveRow.Cells["STEELCODE"].Value.ToString() == ultraComboEditor7.Value.ToString()
  596. && ultraGrid1.ActiveRow.Cells["STD_STYLE"].Value.ToString() == stdStyle
  597. && ultraGrid1.ActiveRow.Cells["MODEL_CODE"].Value.ToString() == ultraComboEditor9.Value.ToString()
  598. && ultraGrid1.ActiveRow.Cells["MIN_D"].Value.ToString() == ultraNumericEditor1.Value.ToString()
  599. && ultraGrid1.ActiveRow.Cells["MIN_H"].Value.ToString() == ultraNumericEditor2.Value.ToString()
  600. && ultraGrid1.ActiveRow.Cells["USE_CODE"].Value.ToString() == ultraTextEditor8.Tag.ToString2())
  601. {
  602. isSample = true;
  603. }
  604. }
  605. if (strAction == "Add")
  606. {
  607. if (isSample == true)
  608. {
  609. return true;
  610. }
  611. else
  612. {
  613. return isExistBl();
  614. }
  615. }
  616. if (strAction == "Update")
  617. {
  618. if (isSample == true)
  619. {
  620. return false;
  621. }
  622. else
  623. {
  624. return isExistBl();
  625. }
  626. }
  627. return true;
  628. }
  629. private bool isExistBl()
  630. {
  631. ArrayList list = new ArrayList();
  632. list.Add(ultraComboEditor5.Value.ToString());
  633. list.Add(ultraComboEditor5.Value.ToString());
  634. list.Add(ultraComboEditor5.Value.ToString());
  635. list.Add(ultraTextEditor7.Tag.ToString2());
  636. list.Add(ultraTextEditor7.Tag.ToString2());
  637. list.Add(ultraTextEditor7.Tag.ToString2());
  638. list.Add(ultraComboEditor7.Value.ToString());
  639. list.Add(ultraComboEditor7.Value.ToString());
  640. list.Add(ultraComboEditor7.Value.ToString());
  641. list.Add(ultraComboEditor8.Value == null ? "" : ultraComboEditor8.Value.ToString());
  642. list.Add(ultraComboEditor9.Value.ToString());
  643. list.Add(ultraComboEditor9.Value.ToString());
  644. list.Add(ultraComboEditor9.Value.ToString());
  645. list.Add(ultraNumericEditor1.Value.ToString());
  646. list.Add(ultraNumericEditor1.Value.ToString());
  647. list.Add(ultraNumericEditor1.Value.ToString());
  648. list.Add(ultraNumericEditor2.Value.ToString());
  649. list.Add(ultraNumericEditor2.Value.ToString());
  650. list.Add(ultraNumericEditor2.Value.ToString());
  651. list.Add(ultraTextEditor8.Tag.ToString2());
  652. list.Add(ultraTextEditor8.Tag.ToString2());
  653. list.Add(ultraTextEditor8.Tag.ToString2());
  654. try
  655. {
  656. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.isExistBl", new object[] { list }, ob);
  657. if (dt.Rows[0][0].ToString() == "0")
  658. {
  659. return false;
  660. }
  661. }
  662. catch { return true; }
  663. return true;
  664. }
  665. private bool PkIsChange()
  666. {
  667. var row = ultraGrid1.ActiveRow;
  668. string gridStr = row.GetValue("PRODUCCODE") + row.GetValue("STD_CODE") + row.GetValue("STEELCODE") + row.GetValue("STD_STYLE")
  669. + row.GetValue("MODEL_CODE") + row.GetValue("MIN_D") + row.GetValue("MIN_H") + row.GetValue("USE_CODE");
  670. string editStr = ultraComboEditor5.Value.ToString2() + ultraTextEditor7.Tag.ToString2() + ultraComboEditor7.Value.ToString2() +
  671. ultraComboEditor8.Value.ToString2() + ultraComboEditor9.Value.ToString2() + ultraNumericEditor1.Value.ToString2() +
  672. ultraNumericEditor2.Value.ToString2() + ultraTextEditor8.Tag.ToString2();
  673. if (gridStr == editStr)
  674. {
  675. return false;
  676. }
  677. else
  678. {
  679. return true;
  680. }
  681. }
  682. private bool QueryIsRef(string blCode)
  683. {
  684. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.queryIsRef",
  685. new object[] { blCode }, ob);
  686. if (dt.Rows[0][0].ToString() != "0")
  687. {
  688. return true;
  689. }
  690. else
  691. {
  692. return false;
  693. }
  694. }
  695. private DataTable QueryMscBlByPk(string blCode)
  696. {
  697. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.queryMscBlByPk",
  698. new object[] { blCode }, ob);
  699. return dt;
  700. }
  701. private bool ValidInput()
  702. {
  703. if (ultraComboEditor5.Items.Count == 0)
  704. {
  705. MessageUtil.ShowWarning("在品名基础数据中未找到[备料管],请维护[备料管]!");
  706. return false;
  707. }
  708. if (ultraComboEditor9.Items.Count == 0)
  709. {
  710. MessageUtil.ShowWarning("在基础数据中未找到[/],请维护[/]!");
  711. return false;
  712. }
  713. if (ultraComboEditor5.SelectedItem == null)
  714. {
  715. MessageBox.Show("请选择品名描述", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  716. return false;
  717. }
  718. if (ultraTextEditor7.Text == "")
  719. {
  720. MessageBox.Show("请选择标准名称", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  721. return false;
  722. }
  723. if (ultraComboEditor7.SelectedItem == null)
  724. {
  725. MessageBox.Show("请选择钢级/牌号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  726. return false;
  727. }
  728. if (this.ultraNumericEditor1.Value == null)
  729. {
  730. MessageBox.Show("请输入外径数值", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  731. return false;
  732. }
  733. //if (ultraComboEditor8.SelectedItem == null)
  734. //{
  735. // MessageBox.Show("请选择标准类别描述", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  736. // return false;
  737. //}
  738. if (ultraComboEditor9.SelectedItem == null)
  739. {
  740. MessageBox.Show("请选择扣型描述", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  741. return false;
  742. }
  743. if (ultraTextEditor8.Text.Trim() == "")
  744. {
  745. MessageUtil.ShowWarning("请选择用途码");
  746. return false;
  747. }
  748. if (numMinL.Value == null)
  749. {
  750. MessageBox.Show("请输入长度下限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  751. numMinL.Focus();
  752. return false;
  753. }
  754. if (numMaxL.Value == null)
  755. {
  756. MessageBox.Show("请输入长度上限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  757. numMinL.Focus();
  758. return false;
  759. }
  760. if (double.Parse(numMaxL.Value.ToString()) < double.Parse(numMinL.Value.ToString()))
  761. {
  762. MessageUtil.ShowWarning("长度上限不能小于长度下限!");
  763. numMaxL.Focus();
  764. return false;
  765. }
  766. string alphacode = " ";
  767. string alpha = " ";
  768. if (ultraTextEditor8.Text.Trim() != "")
  769. {
  770. alphacode = ultraTextEditor8.Tag.ToString2();
  771. alpha = ultraTextEditor8.Text.Trim();
  772. }
  773. if (this.ultraNumericEditor2.Value == null)
  774. {
  775. MessageBox.Show("请输入壁厚数值", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  776. return false;
  777. }
  778. if (Convert.ToDouble(ultraNumericEditor1.Value) < Convert.ToDouble(ultraNumericEditor2.Value))
  779. {
  780. MessageBox.Show("您输入的外径不能小于壁厚!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  781. return false;
  782. }
  783. if (keyJg != "")//说明为接箍的备料弹窗。
  784. {
  785. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.JGRBLCode.getComMscJgByKeyJg",
  786. new object[] { keyJg }, ob);
  787. decimal minD = decimal.Parse(ultraNumericEditor1.Value.ToString2());
  788. decimal minH = decimal.Parse(ultraNumericEditor2.Value.ToString2());
  789. decimal minDCp = decimal.Parse(dt.Rows[0]["MIN_D_JG"].ToString());
  790. decimal maxDCp = decimal.Parse(dt.Rows[0]["MAX_D_JG"].ToString());
  791. if (minD < minDCp)
  792. {
  793. MessageUtil.ShowWarning("备料的外径不能小于接箍料的最小外径!");
  794. return false;
  795. }
  796. if ((minD - 2 * minH) > maxDCp)
  797. {
  798. MessageUtil.ShowWarning("备料的外径减去两倍壁厚不能大于接箍料的最大内径!");
  799. return false;
  800. }
  801. }
  802. if (ultraComboEditor1.Value.ToString2() == "")
  803. {
  804. MessageUtil.ShowWarning("请选择外购坯!");
  805. return false;
  806. }
  807. if (ultraComboEditor2.Value.ToString2() == "")
  808. {
  809. MessageUtil.ShowWarning("请选择外购管!");
  810. return false;
  811. }
  812. mscBlEntity = new ComMscBlEntity();
  813. mscBlEntity.CreateName = UserInfo.GetUserName();
  814. mscBlEntity.UpdateName = UserInfo.GetUserName();
  815. mscBlEntity.DeleteName = UserInfo.GetUserName();
  816. mscBlEntity.Producname = this.ultraComboEditor5.Text;
  817. mscBlEntity.Produccode = this.ultraComboEditor5.Value.ToString();
  818. mscBlEntity.StdCode = this.ultraTextEditor7.Tag.ToString2();
  819. mscBlEntity.StdName = this.ultraTextEditor7.Text;
  820. mscBlEntity.Steelcode = this.ultraComboEditor7.Value.ToString();
  821. mscBlEntity.Steelname = this.ultraComboEditor7.Text;
  822. mscBlEntity.StdStyle = this.ultraComboEditor8.Value == null ? "" : this.ultraComboEditor8.Value.ToString();
  823. mscBlEntity.StdStyleDesc = this.ultraComboEditor8.Text;
  824. mscBlEntity.ModelCode = this.ultraComboEditor9.Value.ToString();
  825. mscBlEntity.ModelDesc = this.ultraComboEditor9.Text;
  826. mscBlEntity.MinD = this.ultraNumericEditor1.Value.ToString();
  827. mscBlEntity.MinH = this.ultraNumericEditor2.Value.ToString();
  828. mscBlEntity.UseCode = alphacode;
  829. mscBlEntity.UseDesc = alpha;
  830. mscBlEntity.Memo = this.ultraTextEditor3.Text.ToString().Trim();
  831. mscBlEntity.MinL = this.numMinL.Value.ToString();
  832. mscBlEntity.MaxL = this.numMaxL.Value.ToString();
  833. mscBlEntity.PscBl = ultraGrid1.ActiveRow == null ? "" : ultraGrid1.GetActiveRowValue("PSC_BL");
  834. mscBlEntity.OutsBilletFl = ultraComboEditor1.Value.ToString2();
  835. mscBlEntity.OutsStlPipeFl = ultraComboEditor2.Value.ToString2();
  836. mscBlEntity.BlLevel = ultraNumericEditor5.Value.ToString2();
  837. pscEntity = new PscEntity();
  838. pscEntity.Autojudge = "0";
  839. pscEntity.NewProcCode = "0";
  840. pscEntity.Produccode = mscBlEntity.Produccode.ToString();
  841. pscEntity.Producname = mscBlEntity.Producname.ToString();
  842. pscEntity.PscDesc = "备料管";
  843. pscEntity.StdCode = mscBlEntity.StdCode.ToString();
  844. pscEntity.StdName = mscBlEntity.StdName.ToString();
  845. pscEntity.StdStyle = mscBlEntity.StdStyle.ToString();
  846. pscEntity.StdStyleDesc = mscBlEntity.StdStyleDesc.ToString();
  847. pscEntity.Steelcode = mscBlEntity.Steelcode.ToString();
  848. pscEntity.Steelname = mscBlEntity.Steelname.ToString();
  849. pscEntity.DepartmentCode = ClsBaseInfo.GetDepartIdBySectionId(CoreUserInfo.UserInfo.GetDeptid(), this.ob);
  850. pscEntity.DepartmentDesc = ClsBaseInfo.GetDepartBySectionId(CoreUserInfo.UserInfo.GetDeptid(), this.ob);
  851. pscEntity.UnitCode = CoreUserInfo.UserInfo.GetDeptid();
  852. pscEntity.UnitDesc = CoreUserInfo.UserInfo.GetDepartment();
  853. //parms.Add(this.ultraComboEditor5.Value.ToString()); //品名代码
  854. //parms.Add(this.ultraComboEditor5.Text.ToString()); //品名描述
  855. //parms.Add(this.ultraComboEditor6.Value.ToString()); //标准代码
  856. //parms.Add(this.ultraComboEditor6.Text.ToString()); //标准描述
  857. //parms.Add(this.ultraComboEditor7.Value.ToString()); //钢级代码
  858. //parms.Add(this.ultraComboEditor7.Text.ToString()); //钢级描述
  859. //parms.Add(this.ultraComboEditor8.Value == null ? "" : this.ultraComboEditor8.Value.ToString()); //标准类别代码
  860. //parms.Add(this.ultraComboEditor8.Text.ToString()); //标准类别描述
  861. //parms.Add(this.ultraComboEditor9.Value.ToString()); //扣型代码
  862. //parms.Add(this.ultraComboEditor9.Text.ToString()); //扣型描述
  863. //parms.Add(this.ultraNumericEditor1.Value.ToString().Trim()); //外径
  864. //parms.Add(this.ultraNumericEditor2.Value.ToString().Trim()); //壁厚
  865. //parms.Add(alphacode); //alpha代码
  866. //parms.Add(alpha); //alpha描述
  867. //parms.Add(this.ultraTextEditor3.Text.ToString().Trim()); //备注
  868. //parms.Add(this.numMinL.Value.ToString());
  869. //parms.Add(this.numMaxL.Value.ToString());
  870. //string departmentCode = ClsBaseInfo.GetDepartIdBySectionId(CoreUserInfo.UserInfo.GetDeptid(), this.ob);
  871. //string departmentDesc = ClsBaseInfo.GetDepartBySectionId(CoreUserInfo.UserInfo.GetDepartment(), this.ob);
  872. //string unitCode = CoreUserInfo.UserInfo.GetDeptid();
  873. //string unitDesc = CoreUserInfo.UserInfo.GetDepartment();
  874. //parms.Add(departmentCode);
  875. //parms.Add(departmentDesc);
  876. //parms.Add(unitCode);
  877. //parms.Add(unitDesc);
  878. return true;
  879. }
  880. private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
  881. {
  882. if (this.ultraCheckEditor1.Checked)
  883. {
  884. this.ultraTextEditor1.ReadOnly = false;
  885. }
  886. else
  887. {
  888. this.ultraTextEditor1.ReadOnly = true;
  889. }
  890. }
  891. private void ultraCheckEditor2_CheckedChanged(object sender, EventArgs e)
  892. {
  893. if (this.ultraCheckEditor2.Checked)
  894. {
  895. this.ultraTextEditor2.ReadOnly = false;
  896. }
  897. else
  898. {
  899. this.ultraTextEditor2.ReadOnly = true;
  900. }
  901. }
  902. private void ultraCheckEditor3_CheckedChanged(object sender, EventArgs e)
  903. {
  904. if (this.ultraCheckEditor3.Checked)
  905. {
  906. this.ultraTextEditor4.ReadOnly = false;
  907. }
  908. else
  909. {
  910. this.ultraTextEditor4.ReadOnly = true;
  911. }
  912. }
  913. private void ultraCheckEditor4_CheckedChanged(object sender, EventArgs e)
  914. {
  915. if (this.ultraCheckEditor4.Checked)
  916. {
  917. this.ultraTextEditor5.ReadOnly = false;
  918. }
  919. else
  920. {
  921. this.ultraTextEditor5.ReadOnly = true;
  922. }
  923. }
  924. private void ultraCheckEditor5_CheckedChanged(object sender, EventArgs e)
  925. {
  926. if (this.ultraCheckEditor5.Checked)
  927. {
  928. this.ultraTextEditor6.ReadOnly = false;
  929. }
  930. else
  931. {
  932. this.ultraTextEditor6.ReadOnly = true;
  933. }
  934. }
  935. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  936. {
  937. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  938. this.ultraComboEditor5.Text = ugr.Cells["PRODUCNAME"].Value.ToString();
  939. this.ultraComboEditor5.Value = ugr.Cells["PRODUCCODE"].Value.ToString();
  940. this.ultraTextEditor7.Tag = ugr.Cells["STD_CODE"].Value.ToString();
  941. this.ultraTextEditor7.Text = ugr.Cells["STD_NAME"].Value.ToString();
  942. this.ultraComboEditor7.Text = ugr.Cells["STEELNAME"].Value.ToString();
  943. this.ultraComboEditor7.Value = ugr.Cells["STEELCODE"].Value.ToString();
  944. this.ultraComboEditor8.Text = ugr.Cells["STD_STYLE_DESC"].Value.ToString();
  945. this.ultraComboEditor8.Value = ugr.Cells["STD_STYLE"].Value.ToString();
  946. this.ultraComboEditor9.Text = ugr.Cells["MODEL_DESC"].Value.ToString();
  947. this.ultraComboEditor9.Value = ugr.Cells["MODEL_CODE"].Value.ToString();
  948. ultraTextEditor8.Text = ugr.Cells["USE_DESC"].Value.ToString();
  949. ultraTextEditor8.Tag = ugr.Cells["USE_CODE"].Value.ToString();
  950. this.ultraNumericEditor1.Text = ugr.Cells["MIN_D"].Value.ToString();
  951. this.ultraNumericEditor2.Text = ugr.Cells["MIN_H"].Value.ToString();
  952. this.ultraTextEditor3.Text = ugr.Cells["MEMO"].Value.ToString();
  953. this.numMinL.Value = ugr.Cells["MIN_L"].Value.ToString();
  954. this.numMaxL.Value = ugr.Cells["MAX_L"].Value.ToString();
  955. this.ultraComboEditor1.Value = ugr.GetValue("OUTS_BILLET_FL");
  956. this.ultraComboEditor2.Value = ugr.GetValue("OUTS_STL_PIPE_FL");
  957. this.ultraNumericEditor5.Value = ugr.GetValue("BL_LEVEL") == "" ? null : ugr.GetValue("BL_LEVEL");
  958. }
  959. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  960. {
  961. ultraGrid1.UpdateData();
  962. }
  963. private void ultraCheckEditor6_CheckedChanged(object sender, EventArgs e)
  964. {
  965. ultraNumericEditor4.ReadOnly = !ultraCheckEditor6.Checked;
  966. }
  967. private void ultraCheckEditor7_CheckedChanged(object sender, EventArgs e)
  968. {
  969. ultraNumericEditor3.ReadOnly = !ultraCheckEditor7.Checked;
  970. }
  971. private void ultraTextEditor7_EditorButtonClick(object sender, EditorButtonEventArgs e)
  972. {
  973. //initJGDropDown(ultraComboEditor6, "com.steering.pss.qcm.BLCodeManage.GetBLStd", "STD_CODE"); //标准
  974. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.GetBLStd",
  975. new object[] { }, ob);
  976. dt.Columns["STD_NAME"].Caption = "标准名称";
  977. BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "STD_NAME", "STD_CODE");
  978. baseInfo.Shown += new EventHandler((a, b) =>
  979. {
  980. var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
  981. c => c.GetValue("STD_CODE") == ultraTextEditor7.Tag.ToString2()).FirstOrDefault();
  982. if (actRow != null) actRow.Activate();
  983. });
  984. if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  985. {
  986. ultraTextEditor7.Tag = baseInfo.ChoicedRow.GetValue("STD_CODE");
  987. ultraTextEditor7.Text = baseInfo.ChoicedRow.GetValue("STD_NAME");
  988. }
  989. }
  990. private void ultraTextEditor7_ValueChanged(object sender, EventArgs e)
  991. {
  992. ultraTextEditor8.Text = "";
  993. }
  994. private void ultraTextEditor8_EditorButtonClick(object sender, EditorButtonEventArgs e)
  995. {
  996. if (ultraTextEditor7.Tag.ToString2() == "")
  997. {
  998. MessageUtil.ShowWarning("请先选择产品标准");
  999. return;
  1000. }
  1001. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.getComBaseStdAlpha",
  1002. new object[] { ultraTextEditor7.Tag.ToString2() }, ob);
  1003. dt.Columns["ALPHA_CODE"].Caption = "用途码";
  1004. dt.Columns["ALPHA_NAME"].Caption = "用途描述";
  1005. dt.Columns["DEPARTMENT_DESC"].Caption = "管理部门";
  1006. dt.Columns["UNIT_DESC"].Caption = "管理科室";
  1007. dt.Columns["MEMO"].Caption = "备注";
  1008. BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "ALPHA_NAME");
  1009. GridHelper.RefreshAndAutoSize(baseInfo.UltraGrid1);
  1010. baseInfo.Shown += new EventHandler((a, b) =>
  1011. {
  1012. var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
  1013. c => c.GetValue("ALPHA_CODE") == ultraTextEditor8.Tag.ToString2()).FirstOrDefault();
  1014. if (actRow != null) actRow.Activate();
  1015. });
  1016. if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  1017. {
  1018. ultraTextEditor8.Tag = baseInfo.ChoicedRow.GetValue("ALPHA_CODE");
  1019. ultraTextEditor8.Text = baseInfo.ChoicedRow.GetValue("ALPHA_NAME");
  1020. }
  1021. }
  1022. private void ultraTextEditor9_EditorButtonClick(object sender, EditorButtonEventArgs e)
  1023. {
  1024. var row = ultraGrid1.ActiveRow;
  1025. string path = row.GetValue("CRAFT_PATH");
  1026. if (e.Button.Key == "Show")
  1027. {
  1028. FormFileDown down = new FormFileDown(ob, path);
  1029. down.DeleteButton.Visible = false;
  1030. down.ShowDialog();
  1031. }
  1032. }
  1033. private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  1034. {
  1035. }
  1036. private void ultraComboEditor5_ValueChanged(object sender, EventArgs e)
  1037. {
  1038. if (ultraComboEditor5.Value.ToString2() == "S000130")
  1039. {
  1040. DataTable dt = (DataTable)ultraComboEditor9.DataSource;
  1041. dt.DefaultView.RowFilter = "";
  1042. ultraComboEditor9.Enabled = true;
  1043. }
  1044. else
  1045. {
  1046. DataTable dt = (DataTable)ultraComboEditor9.DataSource;
  1047. dt.DefaultView.RowFilter = "MODEL_DESC = '/'";
  1048. ultraComboEditor9.Enabled = false;
  1049. if (ultraComboEditor9.Items.Count > 0)
  1050. {
  1051. ultraComboEditor9.SelectedIndex = 0;
  1052. }
  1053. else
  1054. {
  1055. MessageUtil.ShowWarning("在扣型基础数据中未找到[/],请维护[/]!");
  1056. return;
  1057. }
  1058. }
  1059. }
  1060. }
  1061. }