FrmBuyerSend.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Core.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Core.Mes.Client.Comm.Tool;
  14. using System.Collections;
  15. namespace Core.StlMes.Client.SaleBase
  16. {
  17. public partial class FrmBuyerSend : FrmBase
  18. {
  19. OpeBase ob = new OpeBase();
  20. bool blValidating = false; // 验证状态返回 LX
  21. string customer_no = "";//客户编码
  22. public string Customer_no
  23. {
  24. get { return customer_no; }
  25. set { customer_no = value; }
  26. }
  27. string sale_org = "";//销售组织
  28. public string Sale_org
  29. {
  30. get { return sale_org; }
  31. set { sale_org = value; }
  32. }
  33. string custm_use = "";//用途类型
  34. public string Custm_use
  35. {
  36. get { return custm_use; }
  37. set { custm_use = value; }
  38. }
  39. string region_no = "";//省市区域
  40. public string Region_no
  41. {
  42. get { return region_no; }
  43. set { region_no = value; }
  44. }
  45. string strOperator = "";//登录名称
  46. public string StrOperator
  47. {
  48. get { return strOperator; }
  49. set { strOperator = value; }
  50. }
  51. //收货单位扩展信息。
  52. private DataTable _dtBuyerSend;
  53. public FrmBuyerSend(OpeBase ops)
  54. {
  55. this.ob = ops;
  56. InitializeComponent();
  57. ExceptionHelper.RegistException();
  58. }
  59. private void ultraToolbarsSend_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  60. {
  61. ultraGridOrder.UpdateData();
  62. //customer_no, sale_org, custm_use, region_no, address, consignee, phone, zip_code, fax, memo
  63. switch (e.Tool.Key)
  64. {
  65. case "Save":
  66. if (_dtBuyerSend.Rows.Count > 0)
  67. {
  68. if (_dtBuyerSend.Rows[0]["SALE_ORG"].ToString() != UserInfo.SaleOrg)
  69. {
  70. MessageUtil.ShowWarning("该条记录不是您所在的销售组织创建,无法进行修改!");
  71. return;
  72. }
  73. }
  74. ultraExpandableGroupBox1.Focus();
  75. if (blValidating == true)
  76. return;
  77. int countTable = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerSend.GetQueryBuyerSend",
  78. new Object[] { customer_no, sale_org, custm_use }, this.ob).Rows.Count;
  79. //保存 地址address,收货人名称consignee,电话phone,邮编zip_code,传真Fax,备注memo
  80. string address = this.editorAddress.Text.Trim();
  81. string consignee = this.editorConsignee.Text.Trim();
  82. string phone = this.editorPhone.Text.Trim();
  83. string zipcode = this.editorZipcode.Text.Trim();
  84. string fax = this.editorFax.Text.Trim();
  85. string memo = this.editorMemo.Text.Trim();
  86. if (string.IsNullOrEmpty(address))
  87. {
  88. MessageUtil.ShowWarning("地址不能为空!");
  89. return;
  90. }
  91. if (string.IsNullOrEmpty(consignee) && sale_org != "100102")
  92. {
  93. MessageUtil.ShowWarning("收货人名称不能为空!");
  94. return;
  95. }
  96. //if (string.IsNullOrEmpty(phone))
  97. //{
  98. // MessageUtil.ShowTips("电话不能为空!");
  99. // return;
  100. //}
  101. //if (string.IsNullOrEmpty(zipcode))
  102. //{
  103. // MessageUtil.ShowTips("邮编不能为空!");
  104. // return;
  105. //}
  106. //if (string.IsNullOrEmpty(fax))
  107. //{
  108. // MessageUtil.ShowTips("传真不能为空!");
  109. // return;
  110. //}
  111. ArrayList parmCustmUse = new ArrayList();
  112. parmCustmUse.Add(customer_no);
  113. parmCustmUse.Add(sale_org);
  114. parmCustmUse.Add(custm_use);
  115. parmCustmUse.Add(strOperator);
  116. ArrayList parmRcvUnit = new ArrayList();
  117. parmRcvUnit.Add(custm_use);
  118. parmRcvUnit.Add(region_no);
  119. parmRcvUnit.Add(address);
  120. parmRcvUnit.Add(consignee);
  121. parmRcvUnit.Add(phone);
  122. parmRcvUnit.Add(zipcode);
  123. parmRcvUnit.Add(fax);
  124. parmRcvUnit.Add(memo);
  125. parmRcvUnit.Add(strOperator);
  126. parmRcvUnit.Add(customer_no);
  127. parmRcvUnit.Add(sale_org);
  128. ArrayList listDeleteFreight = new ArrayList();
  129. ArrayList listFreight = new ArrayList();
  130. foreach (UltraGridRow ugr in this.ultraGridOrder.Rows)
  131. {
  132. if (ugr.Cells["CD"].Value.ToString().ToLower() == "true")
  133. {
  134. if (ugr.Cells["TRANS_TYP"].Value.ToString() == "")
  135. {
  136. MessageUtil.ShowWarning("请选择运输方式!");
  137. ugr.Cells["TRANS_TYP"].Activate();
  138. return;
  139. }
  140. else if (cmbTrainType.IsItemInList(ugr.Cells["TRANS_TYP"].Value.ToString()) == false)
  141. {
  142. MessageUtil.ShowWarning("输入的运输方式不存在,请选择运输方式!");
  143. ugr.Cells["TRANS_TYP"].Activate();
  144. return;
  145. }
  146. else
  147. {
  148. if (ugr.Cells["ADDRESS"].Value.ToString() == "")
  149. {
  150. MessageUtil.ShowWarning("请输入货运地址!");
  151. ugr.Cells["ADDRESS"].Activate();
  152. return;
  153. }
  154. //火运
  155. if (ugr.GetValue("TRANS_TYP") == "110502")
  156. {
  157. if (ugr.Cells["STATION_NO"].Value.ToString() == "")
  158. {
  159. MessageUtil.ShowWarning("请选择到站!");
  160. ugr.Cells["STATION_NO"].Activate();
  161. return;
  162. }
  163. else if (cmbStationName.IsItemInList(ugr.Cells["STATION_NO"].Value.ToString()) == false)
  164. {
  165. MessageUtil.ShowWarning("输入的到站不存在,请选择到站!");
  166. ugr.Cells["STATION_NO"].Activate();
  167. return;
  168. }
  169. if (ugr.Cells["SPCL_LN_NO"].Value.ToString() == "")
  170. {
  171. MessageUtil.ShowWarning("请选择专用线!");
  172. ugr.Cells["SPCL_LN_NO"].Activate();
  173. return;
  174. }
  175. else if (cmbCollege.IsItemInList(ugr.Cells["SPCL_LN_NO"].Value.ToString()) == false)
  176. {
  177. MessageUtil.ShowWarning("输入的专线不存在,请选择专线!");
  178. ugr.Cells["SPCL_LN_NO"].Activate();
  179. return;
  180. }
  181. }
  182. //船舶
  183. if (ugr.GetValue("TRANS_TYP") == "110503")
  184. {
  185. if (ugr.Cells["PORT_NO"].Value.ToString() == "")
  186. {
  187. MessageUtil.ShowWarning("请选择港口/码头!");
  188. ugr.Cells["PORT_NO"].Activate();
  189. return;
  190. }
  191. else if (ultraComPort.IsItemInList(ugr.Cells["PORT_NO"].Value.ToString()) == false)
  192. {
  193. MessageUtil.ShowWarning("输入的港口/码头不存在,请选择港口/码头!");
  194. ugr.Cells["PORT_NO"].Activate();
  195. return;
  196. }
  197. }
  198. //航运
  199. if (ugr.GetValue("TRANS_TYP") == "110504")
  200. {
  201. if (ugr.Cells["SPCL_LN_NO"].Value.ToString() == "")
  202. {
  203. MessageUtil.ShowWarning("请选择专用线!");
  204. ugr.Cells["SPCL_LN_NO"].Activate();
  205. return;
  206. }
  207. else if (cmbCollege.IsItemInList(ugr.Cells["SPCL_LN_NO"].Value.ToString()) == false)
  208. {
  209. MessageUtil.ShowWarning("输入的专线不存在,请选择专线!");
  210. ugr.Cells["SPCL_LN_NO"].Activate();
  211. return;
  212. }
  213. }
  214. }
  215. /*customer_no, freight_no, address, station_no, spcl_ln_no,
  216. trans_typ, memo, create_name, create_time */
  217. listDeleteFreight.Add(ugr.Cells["FREIGHT_NO"].Value.ToString());
  218. ArrayList parm = new ArrayList();
  219. parm.Add(customer_no);
  220. parm.Add(sale_org);
  221. parm.Add(customer_no);
  222. parm.Add(customer_no);
  223. parm.Add(ugr.Cells["ADDRESS"].Value.ToString());
  224. parm.Add(ugr.Cells["STATION_NO"].Value.ToString());
  225. parm.Add(ugr.Cells["SPCL_LN_NO"].Value.ToString());
  226. parm.Add(ugr.Cells["TRANS_TYP"].Value.ToString());
  227. parm.Add(ugr.Cells["MEMO"].Value.ToString());
  228. parm.Add(strOperator);
  229. parm.Add(ugr.Cells["PORT_NO"].Value.ToString());
  230. parm.Add(ugr.Cells["PORT_NO"].Text.ToString());
  231. listFreight.Add(parm);
  232. }
  233. else
  234. {
  235. if (ugr.Cells["FREIGHT_NO"].Value.ToString().Length > 0)
  236. listDeleteFreight.Add(ugr.Cells["FREIGHT_NO"].Value.ToString());
  237. }
  238. }
  239. if (MessageUtil.ShowYesNoAndQuestion("是否确认保存?") == DialogResult.No) return;
  240. ServerHelper.SetData("com.steering.pss.sale.base.CoreBuyerSend.saveBuyerSend",
  241. new object[] { parmCustmUse, parmRcvUnit, listDeleteFreight, listFreight }, ob);
  242. MessageUtil.ShowTips("保存成功!");
  243. this.Close();
  244. break;
  245. case "Esc":
  246. this.Close();
  247. break;
  248. }
  249. }
  250. /// <summary>
  251. /// 专用线
  252. /// </summary>
  253. private void bindCmbCollege()
  254. {
  255. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreTransitLine.GetSpclNo", null, this.ob);
  256. cmbCollege.DataSource = dt;
  257. cmbCollege.DisplayMember = "SPCL_LN_NM";
  258. cmbCollege.ValueMember = "SPCL_LN_NO";
  259. ClsBaseInfo.SetComboItemHeight(cmbCollege);
  260. if (cmbCollege.Items.Count > 0) cmbCollege.SelectedIndex = 0;
  261. }
  262. /// <summary>
  263. /// 铁路到站
  264. /// </summary>
  265. private void bindCmbStation()
  266. {
  267. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.base.CoreSpeclLine.GetStation", null, this.ob);
  268. cmbStationName.DataSource = dt;
  269. cmbStationName.DisplayMember = "STATION_NM";
  270. cmbStationName.ValueMember = "STATION_NO";
  271. ClsBaseInfo.SetComboItemHeight(cmbStationName);
  272. if (cmbStationName.Items.Count > 0) cmbStationName.SelectedIndex = 0;
  273. }
  274. /// <summary>
  275. /// 运输方式
  276. /// </summary>
  277. private void bindYsfs()
  278. {
  279. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreTransitLine.GetYsfs", null, this.ob);
  280. cmbTrainType.DataSource = dt;
  281. cmbTrainType.DisplayMember = "BASENAME";
  282. cmbTrainType.ValueMember = "BASECODE";
  283. ClsBaseInfo.SetComboItemHeight(cmbTrainType);
  284. if (cmbTrainType.Items.Count > 0) cmbTrainType.SelectedIndex = 0;
  285. }
  286. /// <summary>
  287. /// 获取港口/码头
  288. /// </summary>
  289. private void bindCmPort()
  290. {
  291. DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreTransitLine.GetPort", null, this.ob);
  292. ultraComPort.DataSource = dt;
  293. ultraComPort.DisplayMember = "BASENAME";
  294. ultraComPort.ValueMember = "BASECODE";
  295. ClsBaseInfo.SetComboItemHeight(ultraComPort);
  296. if (ultraComPort.Items.Count > 0) ultraComPort.SelectedIndex = 0;
  297. }
  298. private void FrmBuyerSend_Load(object sender, EventArgs e)
  299. {
  300. //到站
  301. bindCmbStation();
  302. //专用线
  303. bindCmbCollege();
  304. //运输方式
  305. bindYsfs();
  306. //港口/码头
  307. bindCmPort();
  308. DataTable table = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerSend.GetQueryBuyerSend",
  309. new Object[] { customer_no, sale_org, custm_use }, this.ob);
  310. _dtBuyerSend = table;
  311. if (table.Rows.Count > 0)
  312. {
  313. //主界面点击修改查询该条数据加载到对应控件文本内。
  314. //customer_no, sale_org, custm_use, region_no, address, consignee, phone, zip_code, fax, memo
  315. this.editorAddress.Text = table.Rows[0]["ADDRESS"].ToString();
  316. this.editorConsignee.Text = table.Rows[0]["CONSIGNEE"].ToString();
  317. this.editorPhone.Text = table.Rows[0]["PHONE"].ToString();
  318. this.editorZipcode.Text = table.Rows[0]["ZIP_CODE"].ToString();
  319. this.editorFax.Text = table.Rows[0]["FAX"].ToString();
  320. this.editorMemo.Text = table.Rows[0]["MEMO"].ToString();
  321. }
  322. else
  323. {
  324. table = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueyPubuleCustomer", new Object[] { customer_no, sale_org }, this.ob);
  325. if (table.Rows.Count > 0)
  326. {
  327. this.editorPhone.Text = table.Rows[0]["PHONE"].ToString();
  328. this.editorFax.Text = table.Rows[0]["FAX"].ToString();
  329. this.editorZipcode.Text = table.Rows[0]["ZIP_CODE"].ToString();
  330. this.editorConsignee.Text = table.Rows[0]["CONSIGNEE"].ToString();
  331. this.editorAddress.Text = table.Rows[0]["ADDRESS"].ToString();
  332. }
  333. }
  334. table = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryFreight", new Object[] { customer_no, sale_org }, this.ob);
  335. if (table.Rows.Count > 0)
  336. {
  337. //赋值给Datatable运货地址
  338. GridHelper.CopyDataToDatatable(ref table, ref this.dataTableFREIGHT, true);
  339. foreach (UltraGridRow ugr in this.ultraGridOrder.Rows)
  340. {
  341. ugr.Cells["CD"].Value = true;
  342. }
  343. ultraGridOrder.UpdateData();
  344. }
  345. }
  346. private void ultraGridOrder_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  347. {
  348. }
  349. private void editorConsignee_Validating(object sender, CancelEventArgs e)
  350. {
  351. blValidating = false;
  352. if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(editorConsignee.Text) > 20)
  353. {
  354. MessageBox.Show("录入收货人【中文名不能大于10个字符/英文名不能大于20个字符】数据验证失败,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  355. blValidating = true;
  356. e.Cancel = true;
  357. }
  358. }
  359. private void editorAddress_Validating(object sender, CancelEventArgs e)
  360. {
  361. blValidating = false;
  362. if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(editorAddress.Text) > 1000)
  363. {
  364. MessageBox.Show("录入地址数据验证失败【中文地址不能大于500个字符/英文地址不能大于1000个字符】,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  365. blValidating = true;
  366. e.Cancel = true;
  367. }
  368. }
  369. private void editorPhone_Validating(object sender, CancelEventArgs e)
  370. {
  371. blValidating = false;
  372. if (Core.Mes.Client.Comm.Globals.IsChinese(editorPhone.Text))
  373. {
  374. MessageBox.Show("录入电话号码数据验证失败【电话号码不能为中文】,请按国内/国际电话规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  375. blValidating = true;
  376. e.Cancel = true;
  377. }
  378. else
  379. {
  380. if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(editorPhone.Text) > 20)
  381. {
  382. MessageBox.Show("录入电话号码数据验证失败【不能大于20个字符】,请按国内/国际电话规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  383. blValidating = true;
  384. e.Cancel = true;
  385. }
  386. }
  387. }
  388. private void editorZipcode_Validating(object sender, CancelEventArgs e)
  389. {
  390. blValidating = false;
  391. if (Core.Mes.Client.Comm.Globals.IsChinese(editorZipcode.Text))
  392. {
  393. MessageBox.Show("录入邮编数据验证失败【邮编不能为中文】,请按国内/国际邮编规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  394. blValidating = true;
  395. e.Cancel = true;
  396. }
  397. else
  398. {
  399. if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(editorZipcode.Text) > 20)
  400. {
  401. MessageBox.Show("录入邮编数据验证失败【不能大于20个字符】,请按国内/国际邮编规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  402. blValidating = true;
  403. e.Cancel = true;
  404. }
  405. }
  406. }
  407. private void editorFax_Validating(object sender, CancelEventArgs e)
  408. {
  409. blValidating = false;
  410. if (Core.Mes.Client.Comm.Globals.IsChinese(editorFax.Text))
  411. {
  412. MessageBox.Show("录入传真号码数据验证失败【传真号码不能为中文】,请按国内/国际传真号码规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  413. blValidating = true;
  414. e.Cancel = true;
  415. }
  416. else
  417. {
  418. if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(editorFax.Text) > 20)
  419. {
  420. MessageBox.Show("录入传真号码数据验证失败【不能大于20个字符】,请按国内/国际传真号码规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  421. blValidating = true;
  422. e.Cancel = true;
  423. }
  424. }
  425. }
  426. private void editorMemo_Validating(object sender, CancelEventArgs e)
  427. {
  428. blValidating = false;
  429. if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(editorMemo.Text) > 200)
  430. {
  431. MessageBox.Show("录入备注【中文名不能大于100个字符/英文名不能大于200个字符】数据验证失败,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  432. blValidating = true;
  433. e.Cancel = true;
  434. }
  435. }
  436. private void ultraGridOrder_CellChange(object sender, CellEventArgs e)
  437. {
  438. UltraGridRow ultrow = e.Cell.Row;
  439. ultraGridOrder.UpdateData();
  440. if (ultrow.GetValue("CD") == "False")
  441. {
  442. if (ultrow.Cells["FREIGHT_NO"].Value != null && ultrow.Cells["FREIGHT_NO"].Value.ToString().Length > 0)
  443. {
  444. if (MessageBox.Show("是否确认要删除所选货运地址?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  445. {
  446. ultrow.Cells["CD"].Value = true;
  447. return;
  448. }
  449. }
  450. }
  451. ControlGrid2Edit(e.Cell.Row);
  452. ControlGridEditByTransitTyp(e.Cell);
  453. SetColor(e.Cell.Row);
  454. ultraGridOrder.UpdateData();
  455. }
  456. /// <summary>
  457. /// 设置GRID是否可编辑
  458. /// </summary>
  459. /// <param name="row"></param>
  460. private void ControlGrid2Edit(UltraGridRow row)
  461. {
  462. if (row.GetValue("CD") == "True")
  463. {
  464. foreach (UltraGridCell cell in row.Cells)
  465. {
  466. cell.Activation = Activation.AllowEdit;
  467. }
  468. }
  469. else
  470. {
  471. foreach (UltraGridCell cell in row.Cells)
  472. {
  473. if (cell.Column.Key == "CD") continue;
  474. cell.Activation = Activation.ActivateOnly;
  475. }
  476. }
  477. }
  478. /// <summary>
  479. /// 根据运输方式设置是否可编辑
  480. /// </summary>
  481. /// <param name="cell"></param>
  482. private void ControlGridEditByTransitTyp(UltraGridCell cell)
  483. {
  484. UltraGridRow row = cell.Row;
  485. if (row.GetValue("CD") == "False") return;
  486. switch (row.GetValue("TRANS_TYP"))
  487. {
  488. case "110501":
  489. row.Cells["ADDRESS"].Activation = Activation.AllowEdit; //地址
  490. row.Cells["STATION_NO"].Activation = Activation.ActivateOnly;//到站
  491. row.Cells["PORT_NO"].Activation = Activation.ActivateOnly;//码头
  492. row.Cells["SPCL_LN_NO"].Activation = Activation.ActivateOnly;//专线
  493. row.Cells["STATION_NO"].Value = "";
  494. row.Cells["PORT_NO"].Value = "";
  495. row.Cells["STATION_NO"].Value = "";
  496. break;
  497. case "110502":
  498. row.Cells["ADDRESS"].Activation = Activation.AllowEdit;
  499. row.Cells["STATION_NO"].Activation = Activation.AllowEdit;
  500. row.Cells["PORT_NO"].Activation = Activation.ActivateOnly;
  501. row.Cells["SPCL_LN_NO"].Activation = Activation.AllowEdit;
  502. //row.Cells["Destination"].Value = "";
  503. row.Cells["PORT_NO"].Value = "";
  504. //row.Cells["SpclLnNo"].Value = "";
  505. break;
  506. case "110503":
  507. row.Cells["ADDRESS"].Activation = Activation.AllowEdit;
  508. row.Cells["STATION_NO"].Activation = Activation.ActivateOnly;
  509. row.Cells["PORT_NO"].Activation = Activation.AllowEdit;
  510. row.Cells["SPCL_LN_NO"].Activation = Activation.ActivateOnly;
  511. //row.Cells["Destination"].Value = "";
  512. row.Cells["STATION_NO"].Value = "";
  513. row.Cells["SPCL_LN_NO"].Value = "";
  514. break;
  515. case "110504":
  516. row.Cells["ADDRESS"].Activation = Activation.AllowEdit;
  517. row.Cells["STATION_NO"].Activation = Activation.ActivateOnly;
  518. row.Cells["PORT_NO"].Activation = Activation.ActivateOnly;
  519. row.Cells["SPCL_LN_NO"].Activation = Activation.AllowEdit;
  520. //row.Cells["Destination"].Value = "";
  521. row.Cells["STATION_NO"].Value = "";
  522. row.Cells["PORT_NO"].Value = "";
  523. break;
  524. }
  525. }
  526. /// <summary>
  527. /// 设置对应的颜色
  528. /// </summary>
  529. /// <param name="row"></param>
  530. private void SetColor(UltraGridRow row)
  531. {
  532. switch (row.GetValue("TRANS_TYP"))
  533. {
  534. case "110501":
  535. row.Cells["ADDRESS"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  536. row.Cells["STATION_NO"].Appearance.BackColor = Color.White;
  537. row.Cells["PORT_NO"].Appearance.BackColor = Color.White;
  538. row.Cells["SPCL_LN_NO"].Appearance.BackColor = Color.White;
  539. break;
  540. case "110502":
  541. row.Cells["ADDRESS"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  542. row.Cells["STATION_NO"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  543. row.Cells["PORT_NO"].Appearance.BackColor = Color.White;
  544. row.Cells["SPCL_LN_NO"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  545. break;
  546. case "110503":
  547. row.Cells["ADDRESS"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  548. row.Cells["STATION_NO"].Appearance.BackColor = Color.White;
  549. row.Cells["PORT_NO"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  550. row.Cells["SPCL_LN_NO"].Appearance.BackColor = Color.White;
  551. break;
  552. case "110504":
  553. row.Cells["ADDRESS"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  554. row.Cells["STATION_NO"].Appearance.BackColor = Color.White;
  555. row.Cells["PORT_NO"].Appearance.BackColor = Color.White;
  556. row.Cells["SPCL_LN_NO"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  557. break;
  558. }
  559. }
  560. }
  561. }