frmBID_FUNCTION.cs 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231
  1. using System;
  2. using System.Collections.Generic;
  3. using com.hnshituo.pur.vo;
  4. using Core.Mes.Client.Comm.Control;
  5. using Core.Mes.Client.Comm.Tool;
  6. using Infragistics.Win.UltraWinGrid;
  7. using Pur.Entity;
  8. using Pur.Entity.configureEntity;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Windows.Forms;
  17. using Pur.ck;
  18. using CoreFS.CA06;
  19. using Pur.Pop_upWindow;
  20. using System.Collections;
  21. using Core.Mes.Client.Comm.Server;
  22. using Infragistics.Win.UltraWinEditors;
  23. using Pur.require_plan;
  24. using Pur.configure;
  25. namespace Pur.pur_plan
  26. {
  27. public partial class frmBID_FUNCTION : FrmPmsBase
  28. {
  29. string fileName = "";
  30. public string strSelName = "";
  31. public string strSelId = "";
  32. public frmBID_FUNCTION()
  33. {
  34. InitializeComponent();
  35. }
  36. /// <summary>
  37. /// 维护界面toolbar
  38. /// </summary>
  39. /// <param name="sender"></param>
  40. /// <param name="ToolbarKey"></param>
  41. public override void ToolBar_Click(object sender, string ToolbarKey)
  42. {
  43. switch (ToolbarKey)
  44. {
  45. case "doQuery":
  46. QureyBasePriceM("");
  47. break;
  48. case "doAdd":
  49. AddBasePriceM();
  50. break;
  51. case "doEffect":
  52. doEffect();//提报
  53. break;
  54. case "doRevokeEffect":
  55. doRevokeEffect();//撤销提报
  56. break;
  57. case "doSure":
  58. doSure1();//主管部长审核
  59. break;
  60. case "doSure1":
  61. doSure();//业务科长审核
  62. break;
  63. case "Save"://修改分配方案
  64. doUpdateBidFunctionM();
  65. break;
  66. case "SaveEvaRemark"://修改评标人员意见
  67. SaveEvaRemark();
  68. break;
  69. case "doDelete":
  70. DeleteBasePriceM();
  71. break;
  72. case "doExcel":
  73. //doExcel();
  74. break;
  75. case "Close":
  76. this.Close();
  77. break;
  78. }
  79. }
  80. /// <summary>
  81. /// 弹窗按钮控件
  82. /// </summary>
  83. /// <param name="sender"></param>
  84. /// <param name="e"></param>
  85. private void barsManagerButon_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  86. {
  87. switch (e.Tool.Key.ToString())
  88. {
  89. case "SelectSupp":
  90. {
  91. SelectFunction();
  92. }
  93. break;
  94. case "ESC":
  95. {
  96. this.Close();
  97. }
  98. break;
  99. }
  100. }
  101. private void SelectFunction()
  102. {
  103. strSelName = ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString();
  104. strSelId = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  105. }
  106. private void frmBID_FUNCTION_Load(object sender, EventArgs e)
  107. {
  108. splitContainer1.SplitterDistance = splitContainer1.Height / 2;
  109. //评标人员角色
  110. DataTable dt1 = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { "1224" }, this.ob);
  111. dt1.DefaultView.RowFilter = "Validflag='1'";
  112. dt1 = dt1.DefaultView.ToTable();
  113. cmb_EVA_ROLE_NAME.DataSource = dt1;
  114. cmb_EVA_ROLE_NAME.DisplayMember = "BASENAME";
  115. cmb_EVA_ROLE_NAME.ValueMember = "BASECODE";
  116. }
  117. /// <summary>
  118. /// 查询分配方案
  119. /// </summary>
  120. private void QureyBasePriceM(String strId)
  121. {
  122. try
  123. {
  124. this.Cursor = Cursors.WaitCursor;
  125. clearTab();
  126. PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
  127. //权限控制
  128. pm.ValidDataPurviewIds = this.ValidDataPurviewIds;
  129. //判断当前拥有此页面功能的角色是否启用数据权限,//0未启用
  130. //string QstrDataFlag = this.execute<string>("com.hnshituo.pur.utils.service.UtilsService", "getRoleDataFlag", new object[] { UserInfo.GetUserID(), "Pur.pur_plan.frmTaskMana_MC" });
  131. pm.Name = Qname.Text.Trim();
  132. pm.Validflag = "1";
  133. if (txt_status.SelectedIndex != -1)
  134. {
  135. pm.Flag = txt_status.Value.ToString().Trim();
  136. }
  137. DataTable re = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doQureyBidFunctionM", new object[] { pm });
  138. GridHelper.CopyDataToDatatable(re, dataTable1, true);
  139. comm.RefreshAndAutoSizeExceptColumns(ultraGrid1);
  140. if (!String.IsNullOrEmpty(strId))
  141. {
  142. PublicTools.publicPms.doActiveSelRow(ultraGrid1, "id", strId);
  143. }
  144. }
  145. finally
  146. {
  147. this.Cursor = Cursors.Default;
  148. }
  149. }
  150. /// <summary>
  151. /// 查询评审人员
  152. /// </summary>
  153. /// <param name="strId"></param>
  154. private void doQueryEva()
  155. {
  156. dataTable4.Clear();
  157. PurBidFunctionEvasEntity pc = new PurBidFunctionEvasEntity();
  158. string strId = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  159. pc.VersionNo = strId;
  160. pc.Validflag = "1";
  161. DataTable re = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionEvasService", "find", new object[] { pc,0,0 });
  162. GridHelper.CopyDataToDatatable(re, dataTable4, true);
  163. GridHelper.RefreshAndAutoSize(ultraGrid3);
  164. }
  165. /// <summary>
  166. /// 查询行
  167. /// </summary>
  168. /// <param name="strId"></param>
  169. /// <param name="strItemCode"></param>
  170. private void doQueryBasePriceC(String strId)
  171. {
  172. dataTable2.Clear();
  173. PurBidFunctionCEntity pc = new PurBidFunctionCEntity();
  174. pc.VersionNo = strId;
  175. pc.Validflag = "1";
  176. DataTable re = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionCService", "doQureyBidFunctionC", new object[] { pc });
  177. if (re.Rows.Count>0)
  178. {
  179. re.DefaultView.Sort = "ID asc";
  180. re = re.DefaultView.ToTable();
  181. }
  182. GridHelper.CopyDataToDatatable(re, dataTable2, true);
  183. comm.RefreshAndAutoSizeExceptColumns(ultraGrid2);
  184. }
  185. // 加载附件
  186. private void getOrderAppend(string strOrderId, string p)
  187. {
  188. fujian.Clear();
  189. OrderAppend append = new OrderAppend();
  190. append.OrderId = strOrderId;
  191. append.Validflag = "1";
  192. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.order.service.OrderAppendService", "find", new object[] { append, 0, 0 });
  193. GridHelper.CopyDataToDatatable(dt, dataTable6, true);
  194. GridHelper.RefreshAndAutoSize(ultraGrid4);
  195. if (!String.IsNullOrEmpty(p))
  196. {
  197. PublicTools.publicPms.doActiveSelRow(ultraGrid4, "CERTPATH", p);
  198. }
  199. }
  200. /// <summary>
  201. /// 添加
  202. /// </summary>
  203. private void AddBasePriceM()
  204. {
  205. PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
  206. if (String.IsNullOrEmpty(edtName.Text.Trim()))
  207. {
  208. MessageUtil.ShowTips("方案名称不能为空");
  209. edtName.Focus();
  210. return;
  211. }
  212. //if (String.IsNullOrEmpty(txt_remark.Text.Trim()))
  213. //{
  214. // MessageUtil.ShowTips("请填写申请部门意见");
  215. // txt_remark.Focus();
  216. // return;
  217. //}
  218. pm.Remark = txt_remark.Text.Trim();
  219. pm.Name = edtName.Text.Trim();
  220. pm.BuyerUnitCode =UserInfo.GetDeptid();
  221. pm.BuyerUnitDesc = this.UserInfo.GetDepartment();
  222. if (MessageUtil.ShowYesNoAndQuestion("确定新增?") != DialogResult.Yes)
  223. {
  224. return;
  225. }
  226. string strId = this.execute<string>("com.hnshituo.pur.utils.service.UtilsService", "getOddNumber_yymm", new object[] { "PUR_BID_FUNCTION_M", "ID", "FA", "4" });
  227. pm.Id = strId;
  228. pm.Flag = "0";
  229. pm.Validflag = "1";
  230. pm.Status = "1";
  231. pm.CreateName = UserInfo.GetUserName();
  232. pm.CreateTime = System.DateTime.Now;
  233. pm.CreateUserid = UserInfo.GetUserID();
  234. //DataTable re1 = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doQureyBidFunctionM", new object[] { pm });
  235. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doInsert", new object[] { pm });
  236. if (re.Resultcode == 0)
  237. {
  238. MessageBox.Show("新增成功", "提示");
  239. QureyBasePriceM(re.Resultmsg);
  240. }
  241. else
  242. {
  243. MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
  244. return;
  245. }
  246. }
  247. /// <summary>
  248. /// 提报
  249. /// </summary>
  250. private void doEffect()
  251. {
  252. if (ultraGrid1.ActiveRow==null)
  253. {
  254. MessageBox.Show("请选择方案", "提示");
  255. return;
  256. }
  257. string strStatus=getTaskStatusNum();
  258. if (strStatus != "1" && strStatus!="4")
  259. {
  260. MessageBox.Show("方案必须为待提报或者审批不通过状态才能提报", "提示");
  261. return;
  262. }
  263. PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
  264. pm.Status = "2";
  265. pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  266. if (MessageUtil.ShowYesNoAndQuestion("确定提报招标方案【" + ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString() + "】?") != DialogResult.Yes)
  267. {
  268. return;
  269. }
  270. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
  271. if (re.Resultcode == 0)
  272. {
  273. MessageBox.Show("提报成功", "提示");
  274. QureyBasePriceM(re.Resultmsg);
  275. }
  276. else
  277. {
  278. MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
  279. return;
  280. }
  281. }
  282. /// <summary>
  283. /// 撤销提报
  284. /// </summary>
  285. private void doRevokeEffect()
  286. {
  287. if (ultraGrid1.ActiveRow == null)
  288. {
  289. MessageBox.Show("请选择方案", "提示");
  290. return;
  291. }
  292. if (getTaskStatusNum() != "2")
  293. {
  294. MessageBox.Show("当前状态不为业务科长审批,不能撤销", "提示");
  295. return;
  296. }
  297. PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
  298. pm.Status = "1";
  299. pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  300. if (MessageUtil.ShowYesNoAndQuestion("确定撤销提报招标方案【" + ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString() + "】?") != DialogResult.Yes)
  301. {
  302. return;
  303. }
  304. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
  305. if (re.Resultcode == 0)
  306. {
  307. MessageBox.Show("撤销成功", "提示");
  308. QureyBasePriceM("");
  309. }
  310. else
  311. {
  312. MessageBox.Show("撤销失败:" + re.Resultmsg, "提示");
  313. return;
  314. }
  315. }
  316. /// <summary>
  317. /// 修改分配方案
  318. /// </summary>
  319. private void doUpdateBidFunctionM()
  320. {
  321. if (ultraGrid1.ActiveRow == null)
  322. {
  323. MessageBox.Show("请选择方案", "提示");
  324. return;
  325. }
  326. string strStatus = getTaskStatusNum();
  327. if (strStatus != "1" && strStatus != "4")
  328. {
  329. MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
  330. return;
  331. }
  332. PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
  333. pm.Remark = txt_remark.Text;
  334. pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  335. if (MessageUtil.ShowYesNoAndQuestion("确定修改招标方案【" + ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString() + "】?") != DialogResult.Yes)
  336. {
  337. return;
  338. }
  339. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
  340. if (re.Resultcode == 0)
  341. {
  342. MessageBox.Show("修改成功", "提示");
  343. QureyBasePriceM(pm.Id);
  344. }
  345. else
  346. {
  347. MessageBox.Show("修改失败:" + re.Resultmsg, "提示");
  348. return;
  349. }
  350. }
  351. /// <summary>
  352. /// 保存评标人员意见
  353. /// </summary>
  354. private void SaveEvaRemark()
  355. {
  356. if (ultraGrid1.ActiveRow == null)
  357. {
  358. MessageBox.Show("请选择方案", "提示");
  359. return;
  360. }
  361. string strStatus = getTaskStatusNum();
  362. if (strStatus != "1" && strStatus != "4")
  363. {
  364. MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
  365. return;
  366. }
  367. ultraGrid3.UpdateData();
  368. if (MessageUtil.ShowYesNoAndQuestion("确定修改评标人员意见?") != DialogResult.Yes)
  369. {
  370. return;
  371. }
  372. foreach (UltraGridRow row in ultraGrid3.Rows)
  373. {
  374. PurBidFunctionEvasEntity pm = new PurBidFunctionEvasEntity();
  375. pm.EvaMsg = row.Cells["EVAMSG"].Value.ToString();
  376. pm.EvaId = row.Cells["EVAID"].Value.ToString();
  377. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionEvasService", "doUpdate", new object[] { pm });
  378. if (re.Resultcode == 0)
  379. {
  380. //QureyBasePriceM(re.Resultmsg);
  381. }
  382. else
  383. {
  384. MessageBox.Show("保存失败:" + re.Resultmsg, "提示");
  385. return;
  386. }
  387. }
  388. MessageBox.Show("保存成功", "提示");
  389. doQueryEva();
  390. }
  391. /// <summary>
  392. /// 删除
  393. /// </summary>
  394. private void DeleteBasePriceM()
  395. {
  396. if (ultraGrid1.ActiveRow == null)
  397. {
  398. MessageBox.Show("请选择方案", "提示");
  399. return;
  400. }
  401. string strStatus = getTaskStatusNum();
  402. if (strStatus != "1" && strStatus != "4")
  403. {
  404. MessageBox.Show("方案必须为待提报或者审批不通过状态才能删除", "提示");
  405. return;
  406. }
  407. PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
  408. pm.Validflag = "0";
  409. pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  410. if (MessageUtil.ShowYesNoAndQuestion("确定删除招标方案【" + ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString() + "】?") != DialogResult.Yes)
  411. {
  412. return;
  413. }
  414. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
  415. if (re.Resultcode == 0)
  416. {
  417. MessageBox.Show("删除成功", "提示");
  418. QureyBasePriceM(re.Resultmsg);
  419. }
  420. else
  421. {
  422. MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
  423. return;
  424. }
  425. }
  426. /// <summary>
  427. /// 提报
  428. /// </summary>
  429. private void doSure()
  430. {
  431. if (ultraGrid1.ActiveRow == null)
  432. {
  433. MessageBox.Show("请选择方案", "提示");
  434. return;
  435. }
  436. if (getTaskStatusNum() != "2")
  437. {
  438. MessageBox.Show("当前状态不为业务科长审批", "提示");
  439. return;
  440. }
  441. string strTips = "";
  442. PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
  443. pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  444. frmExamineShow Fex = new frmExamineShow();
  445. Fex.ShowDialog();
  446. if (Fex.Status == "2")//审批通过
  447. {
  448. pm.Status = "5";//去掉审批环节,提报后直接改状态为审批通过
  449. strTips = "通过";
  450. }
  451. else if (Fex.Status == "1")//审批不通过
  452. {
  453. pm.Status = "4";//去掉审批环节,提报后直接改状态为审批通过
  454. strTips = "不通过";
  455. pm.Examinemessage="业务科长审批不通过【"+Fex.ExamineMessage+"】";
  456. }
  457. else
  458. { return; }
  459. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
  460. if (re.Resultcode != 0)
  461. {
  462. MessageUtil.ShowTips("审批失败 " + re.Resultmsg);
  463. return;
  464. }
  465. MessageUtil.ShowTips("审批结果:" + strTips);
  466. QureyBasePriceM(pm.Id);
  467. }
  468. /// <summary>
  469. /// 提报
  470. /// </summary>
  471. private void doSure1()
  472. {
  473. if (ultraGrid1.ActiveRow == null)
  474. {
  475. MessageBox.Show("请选择方案", "提示");
  476. return;
  477. }
  478. if (getTaskStatusNum() != "5")
  479. {
  480. MessageBox.Show("当前状态不为主管部长审批", "提示");
  481. return;
  482. }
  483. string strTips = "";
  484. PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
  485. pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  486. frmExamineShow Fex = new frmExamineShow();
  487. Fex.ShowDialog();
  488. if (Fex.Status == "2")//审批通过
  489. {
  490. pm.Status = "3";//去掉审批环节,提报后直接改状态为审批通过
  491. strTips = "通过";
  492. }
  493. else if (Fex.Status == "1")//审批不通过
  494. {
  495. pm.Status = "4";//去掉审批环节,提报后直接改状态为审批通过
  496. pm.Examinemessage = "主管部长审批不通过【" + Fex.ExamineMessage + "】";
  497. strTips = "不通过";
  498. }
  499. else
  500. { return; }
  501. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
  502. if (re.Resultcode != 0)
  503. {
  504. MessageUtil.ShowTips("审批失败 " + re.Resultmsg);
  505. return;
  506. }
  507. MessageUtil.ShowTips("审批结果:" + strTips);
  508. QureyBasePriceM(pm.Id);
  509. }
  510. /// <summary>
  511. /// 清空编辑区
  512. /// </summary>
  513. private void clearTab()
  514. {
  515. dataTable1.Rows.Clear();
  516. dataTable2.Rows.Clear();
  517. dataTable4.Rows.Clear();
  518. dataTable6.Rows.Clear();
  519. edtName.Clear();
  520. //txt_effectTime.Value = DateTime.Now;
  521. txt_remark.Clear();
  522. }
  523. private void ultraGrid1_AfterRowActivate(object sender, System.EventArgs e)
  524. {
  525. if (ultraGrid1.ActiveRow == null)
  526. {
  527. return;
  528. }
  529. String strId = ultraGrid1.ActiveRow.Cells["id"].Value.ToString();
  530. if (String.IsNullOrEmpty(strId))
  531. {
  532. return;
  533. }
  534. PurBidFunctionMEntity pp = this.execute<PurBidFunctionMEntity>("com.hnshituo.pur.purplan.service.BidFunctionMService", "findById", new object[] { strId });
  535. //判断当前激活行是否为空
  536. edtName.Text = pp.Name;
  537. txt_remark.Text = pp.Remark == null ? null : pp.Remark.Replace("\n", "\r\n");
  538. doQueryEva();
  539. doQueryBasePriceC(strId);
  540. getOrderAppend(strId, "");
  541. }
  542. private void ultraButton1_Click(object sender, System.EventArgs e)
  543. {
  544. if (ultraGrid1.ActiveRow == null)
  545. {
  546. MessageBox.Show("请选择方案", "提示");
  547. return;
  548. }
  549. string strStatus = getTaskStatusNum();
  550. if (strStatus != "1" && strStatus != "4")
  551. {
  552. MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
  553. return;
  554. }
  555. if (string.IsNullOrEmpty(txt_EVA_ORG_ID.Text))
  556. {
  557. MessageUtil.ShowTips("请选择人员");
  558. return;
  559. }
  560. if (string.IsNullOrEmpty(cmb_EVA_ROLE_NAME.Text))
  561. {
  562. MessageUtil.ShowTips("请选择角色");
  563. return;
  564. }
  565. if (dataTable4.Rows.Contains(txt_EVA_USERID.Text))
  566. {
  567. MessageUtil.ShowTips("已经存在同一个人员,不要重复添加");
  568. return;
  569. }
  570. else
  571. {
  572. ArrayList al_Eva = new ArrayList();
  573. PurBidFunctionEvasEntity TaskEvaUsersEntity = new PurBidFunctionEvasEntity();
  574. string strTaskName = this.execute<string>("com.hnshituo.pur.utils.service.UtilsService", "getOddNumber_yymm", new object[] { "PUR_BID_FUNCTION_EVAS", "EVA_ID", "GNEVA", "3" });
  575. TaskEvaUsersEntity.EvaId = strTaskName;
  576. TaskEvaUsersEntity.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  577. TaskEvaUsersEntity.Validflag = "1";
  578. TaskEvaUsersEntity.CreateName = UserInfo.GetUserName();
  579. TaskEvaUsersEntity.CreateUserid = UserInfo.GetUserID();
  580. TaskEvaUsersEntity.CreateTime = System.DateTime.Now;
  581. TaskEvaUsersEntity.EvaRoleId = cmb_EVA_ROLE_NAME.Value.ToString();//角色Id
  582. TaskEvaUsersEntity.EvaRoleName = cmb_EVA_ROLE_NAME.Text.ToString();//角色名称
  583. TaskEvaUsersEntity.EvaUserId = txt_EVA_USERID.Text;//用户Id
  584. TaskEvaUsersEntity.EvaUserName = txt_EVA_USERNAME.Text;//用户名称
  585. TaskEvaUsersEntity.EvaOrgId = txt_EVA_ORG_ID.Text;//科室Id
  586. TaskEvaUsersEntity.EvaOrgName = txt_EVA_ORG_NAME.Text;//科室名称
  587. al_Eva.Add(TaskEvaUsersEntity);
  588. for (int i = 0; i < al_Eva.Count; i++)
  589. {
  590. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionEvasService", "doInsert", new object[] { TaskEvaUsersEntity });
  591. if (re.Resultcode != 0)
  592. {
  593. MessageUtil.ShowTips("插入失败 " + re.Resultmsg);
  594. return;
  595. }
  596. }
  597. MessageUtil.ShowTips("添加成功!");
  598. doQueryEva();
  599. //清空控件
  600. txt_EVA_ORG_ID.Text = null;
  601. txt_EVA_ORG_NAME.Text = null;
  602. txt_EVA_USERID.Text = null;
  603. txt_EVA_USERNAME.Text = null;
  604. cmb_EVA_ROLE_NAME.Value = null;
  605. }
  606. ultraGrid3.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
  607. }
  608. private void btnSelEvaGroup_Click(object sender, System.EventArgs e)
  609. {
  610. if (ultraGrid1.ActiveRow == null)
  611. {
  612. MessageBox.Show("请选择方案", "提示");
  613. return;
  614. }
  615. string strStatus = getTaskStatusNum();
  616. if (strStatus != "1" && strStatus != "4")
  617. {
  618. MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
  619. return;
  620. }
  621. frmPopSelEvaGroup frm = new frmPopSelEvaGroup(this.ob);
  622. frm.ShowDialog();
  623. ArrayList al_Eva = new ArrayList();
  624. if (frm.dtEvaGroup != null)
  625. {
  626. DataTable dt = frm.dtEvaGroup;
  627. //string strTaskName = this.execute<string>("com.hnshituo.pur.utils.service.UtilsService", "getOddNumber_yymm", new object[] { "PUR_BID_FUNCTION_EVAS", "EVA_ID", "GNEVA", "3" });
  628. //添加评标人员
  629. foreach (DataRow dr in dt.Rows)
  630. {
  631. if (!dataTable4.Rows.Contains(dr["EVAUSERID"]))
  632. {
  633. PurBidFunctionEvasEntity TaskEvaUsersEntity = new PurBidFunctionEvasEntity();
  634. //TaskEvaUsersEntity.EvaId = strTaskName;
  635. TaskEvaUsersEntity.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  636. TaskEvaUsersEntity.Validflag = "1";
  637. TaskEvaUsersEntity.CreateName = UserInfo.GetUserName();
  638. TaskEvaUsersEntity.CreateUserid = UserInfo.GetUserID();
  639. TaskEvaUsersEntity.CreateTime = System.DateTime.Now;
  640. TaskEvaUsersEntity.EvaRoleId = dr["EVAROLEID"].ToString();//评审角色编号
  641. TaskEvaUsersEntity.EvaRoleName = dr["EVAROLENAME"].ToString();//评审角色
  642. TaskEvaUsersEntity.EvaOrgId = dr["EVAORGID"].ToString();//评审人部门编号
  643. TaskEvaUsersEntity.EvaOrgName = dr["EVAORGNAME"].ToString();//评审人部门
  644. TaskEvaUsersEntity.EvaUserName = dr["EVAUSERNAME"].ToString();//评审人
  645. TaskEvaUsersEntity.EvaUserId = dr["EVAUSERID"].ToString();//评审人
  646. al_Eva.Add(TaskEvaUsersEntity);
  647. }
  648. }
  649. }
  650. if (al_Eva.Count == 0)
  651. {
  652. return;
  653. }
  654. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionEvasService", "doInsertBFEvas", new object[] { al_Eva });
  655. if (re.Resultcode != 0)
  656. {
  657. MessageUtil.ShowTips("插入失败 " + re.Resultmsg);
  658. return;
  659. }
  660. MessageUtil.ShowTips("添加成功!");
  661. doQueryEva();
  662. //清空控件
  663. txt_EVA_ORG_ID.Text = null;
  664. txt_EVA_ORG_NAME.Text = null;
  665. txt_EVA_USERID.Text = null;
  666. txt_EVA_USERNAME.Text = null;
  667. cmb_EVA_ROLE_NAME.Value = null;
  668. }
  669. /// <summary>
  670. /// 删除评标人员
  671. /// </summary>
  672. /// <param name="sender"></param>
  673. /// <param name="e"></param>
  674. private void ultraButton2_Click(object sender, System.EventArgs e)
  675. {
  676. if (ultraGrid1.ActiveRow == null)
  677. {
  678. MessageBox.Show("请选择方案", "提示");
  679. return;
  680. }
  681. string strStatus = getTaskStatusNum();
  682. if (strStatus != "1" && strStatus != "4")
  683. {
  684. MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
  685. return;
  686. }
  687. PurBidFunctionEvasEntity TaskEvaUsersEntity = new PurBidFunctionEvasEntity();
  688. TaskEvaUsersEntity.EvaId = ultraGrid3.ActiveRow.Cells["EvaId"].Value.ToString();
  689. TaskEvaUsersEntity.Validflag = "0";
  690. if (MessageUtil.ShowYesNoAndQuestion("确定删除人员" + ultraGrid3.ActiveRow.Cells["EVAUSERNAME"].Value.ToString() + "?") != DialogResult.Yes)
  691. {
  692. return;
  693. }
  694. CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionEvasService", "doUpdate", new object[] { TaskEvaUsersEntity });
  695. if (re.Resultcode != 0)
  696. {
  697. MessageUtil.ShowTips("删除失败 " + re.Resultmsg);
  698. return;
  699. }
  700. MessageUtil.ShowTips("删除成功!");
  701. doQueryEva();
  702. }
  703. private void txt_certPath_EditorButtonClick(object sender, EditorButtonEventArgs e)
  704. {
  705. try
  706. {
  707. if (e.Button.Key.ToLower().Equals("insert"))
  708. {
  709. OpenFileDialog file = new OpenFileDialog();
  710. file.Multiselect = false;
  711. DialogResult drStat;
  712. drStat = file.ShowDialog();
  713. if (drStat == DialogResult.OK)
  714. {
  715. fileName = file.FileName;
  716. string filena = System.IO.Path.GetFileName(fileName);
  717. txt_certPath.Text = filena;
  718. }
  719. }
  720. }
  721. catch (Exception ex)
  722. {
  723. MessageUtil.ShowTips("操作失败:" + ex);
  724. }
  725. }
  726. private void ultraButton3_Click(object sender, System.EventArgs e)
  727. {
  728. if (ultraGrid1.ActiveRow == null)
  729. {
  730. MessageBox.Show("请选择方案", "提示");
  731. return;
  732. }
  733. string strStatus = getTaskStatusNum();
  734. if (strStatus != "1" && strStatus != "4")
  735. {
  736. MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
  737. return;
  738. }
  739. if (ultraGrid1.ActiveRow == null)
  740. {
  741. MessageUtil.ShowTips("未选择方案");
  742. return;
  743. }
  744. string strId = ultraGrid1.ActiveRow.GetValue("id");
  745. if (String.IsNullOrEmpty(strId))
  746. {
  747. MessageUtil.ShowTips("方案ID为空");
  748. return;
  749. }
  750. String filena = txt_certPath.Text.ToString().Trim();
  751. if (String.IsNullOrEmpty(filena) || String.IsNullOrEmpty(fileName))
  752. {
  753. MessageUtil.ShowTips("请选择待上传文件");
  754. return;
  755. }
  756. OrderAppend sat = new OrderAppend();
  757. sat.OrderId = strId;
  758. String filePathNew = "Pms/CERT/" + strId + "/";
  759. sat.CertPath = filena;
  760. sat.CertPathOld = filePathNew + filena;
  761. sat.CreateUserid = UserInfo.GetUserID();
  762. sat.CreateName = UserInfo.GetUserName();
  763. sat.CreateTime = DateTime.Now;
  764. sat.Validflag = "1";
  765. sat.CertDesc = txt_CERTDESC.Text.Trim();
  766. if (GetCraftFileCraftNoCnt(filena, strId) > 0)
  767. {
  768. MessageUtil.ShowTips("方案已存在该附件文件:" + filena);
  769. return;
  770. }
  771. List<FileBean> list = new List<FileBean>();
  772. FileBean bean = new FileBean();
  773. bean = new FileBean();
  774. bean.setFileName(filena);
  775. bean.setPathName(filePathNew);
  776. bean.setFile(FileHelper.FileToArray(fileName));
  777. list.Add(bean);
  778. bool isSuccess = Core.Mes.Client.Comm.Server.FileHelper.Upload(list);
  779. if (isSuccess)
  780. {
  781. //开始写数据库
  782. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.order.service.OrderAppendService", "insert_append", new object[] { sat });
  783. if (crt.Resultcode != 0)
  784. {
  785. MessageUtil.ShowTips("上传失败:" + crt.Resultmsg);
  786. }
  787. else
  788. {
  789. MessageUtil.ShowTips("上传成功");
  790. ClearTab5();
  791. }
  792. }
  793. else
  794. {
  795. MessageBox.Show("上传失败");
  796. }
  797. //刷新界面并激活当前行
  798. getOrderAppend(sat.OrderId, sat.CertPath);
  799. }
  800. /// <summary>
  801. /// 判断是否之前已提交相同的文件
  802. /// </summary>
  803. /// <param name="craftNo"></param>
  804. /// <returns></returns>
  805. private int GetCraftFileCraftNoCnt(string CERT_PATH, string orderId)
  806. {
  807. OrderAppend sat = new OrderAppend();
  808. sat.CertPath = CERT_PATH;
  809. sat.OrderId = orderId;
  810. sat.Validflag = "1";
  811. int dt = this.execute<int>("com.hnshituo.pur.order.service.OrderAppendService", "count", new object[] { sat });
  812. return dt;
  813. }
  814. private void ClearTab5()
  815. {
  816. txt_certPath.Clear();
  817. txt_CERTDESC.Clear();
  818. fileName = "";
  819. }
  820. private void ultraButton4_Click(object sender, System.EventArgs e)
  821. {
  822. if (ultraGrid1.ActiveRow == null)
  823. {
  824. MessageBox.Show("请选择方案", "提示");
  825. return;
  826. }
  827. string strStatus = getTaskStatusNum();
  828. if (strStatus != "1" && strStatus != "4")
  829. {
  830. MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
  831. return;
  832. }
  833. UltraGridRow uge = ultraGrid1.ActiveRow;
  834. if (uge == null)
  835. {
  836. MessageUtil.ShowTips("请选择方案!");
  837. return;
  838. }
  839. String strId = uge.Cells["id"].Value.ToString().Trim();
  840. if (String.IsNullOrEmpty(strId))
  841. {
  842. MessageUtil.ShowTips("该方案ID为空!");
  843. return;
  844. }
  845. UltraGridRow rowAppend = ultraGrid4.ActiveRow;
  846. if (rowAppend == null)
  847. {
  848. MessageUtil.ShowTips("请选择需删除的附件!");
  849. return;
  850. }
  851. String strAppendID = rowAppend.Cells["ID"].Value.ToString().Trim();
  852. String strcertPath = rowAppend.Cells["CERTPATH"].Value.ToString().Trim();
  853. String strCertPathOld = rowAppend.Cells["CERTPATHOLD"].Value.ToString().Trim();
  854. if (String.IsNullOrEmpty(strAppendID))
  855. {
  856. MessageUtil.ShowTips("该价格政策附件编号为空!");
  857. return;
  858. }
  859. if (String.IsNullOrEmpty(strCertPathOld))
  860. {
  861. MessageUtil.ShowTips("未获取到任务单附件地址信息!");
  862. return;
  863. }
  864. //验证任务单头是否可以增删改
  865. if (testOrderAppendStatus(strAppendID, 1) == false)
  866. {
  867. return;
  868. }
  869. OrderAppend append = new OrderAppend();
  870. append.Id = strAppendID;
  871. append.Validflag = "0";
  872. append.DeleteName = UserInfo.GetUserName();
  873. append.DeleteTime = DateTime.Now;
  874. append.DeleteUserid = UserInfo.GetUserID();
  875. if (MessageUtil.ShowYesNoAndQuestion("确定删除附件:" + strcertPath + "?") != DialogResult.Yes)
  876. {
  877. return;
  878. }
  879. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.order.service.OrderAppendService", "delete_append", new object[] { append });
  880. if (crt.Resultcode != 0)
  881. {
  882. MessageUtil.ShowTips("删除失败!" + crt.Resultmsg);
  883. return;
  884. }
  885. else
  886. {
  887. bool isSuccess = Core.Mes.Client.Comm.Server.FileHelper.Delete(strCertPathOld);
  888. if (isSuccess)
  889. {
  890. MessageUtil.ShowTips("删除成功");
  891. }
  892. else
  893. {
  894. MessageBox.Show("删除成功");
  895. }
  896. }
  897. getOrderAppend(strId, "");
  898. }
  899. /// <summary>
  900. /// 验证价格政策输入数据的有效性
  901. /// </summary>
  902. /// <returns></returns>
  903. private bool testOrderAppendStatus(String strId, int p)// 验证合同附件
  904. {
  905. OrderAppend append = this.execute<OrderAppend>("com.hnshituo.pur.order.service.OrderAppendService", "findById", new object[] { strId });
  906. if (append == null)
  907. {
  908. MessageUtil.ShowTips("未发现价格政策附件:" + strId + "信息记录,可能已作废");
  909. return false;
  910. }
  911. if (append.Validflag != "1")
  912. {
  913. MessageUtil.ShowTips("价格政策附件:" + strId + "信息记录可能已作废");
  914. return false;
  915. }
  916. if (append.CreateUserid != UserInfo.GetUserID())
  917. {
  918. MessageUtil.ShowTips("非本人上传价格政策附件无权限进行增删改");
  919. return false;
  920. }
  921. if (p == 1)
  922. {
  923. }
  924. else
  925. {
  926. MessageUtil.ShowTips("未知参数:" + p + "");
  927. return false;
  928. }
  929. return true;
  930. }
  931. private void craftImg_EditorButtonClick(object sender, EditorButtonEventArgs e)
  932. {
  933. try
  934. {
  935. UltraGridRow row = ultraGrid4.ActiveRow;
  936. string filePathOld = row.GetValue("certPathOld");
  937. if (e.Button.Key.ToLower().Equals("select"))
  938. {
  939. FrmPopFileShow down = new FrmPopFileShow(this.ob, filePathOld);
  940. down.DeleteButton.Visible = false;
  941. down.ShowDialog();
  942. }
  943. }
  944. catch (Exception ex)
  945. {
  946. MessageUtil.ShowTips("操作失败:" + ex);
  947. }
  948. }
  949. /// <summary>
  950. /// 获取最大排名+1
  951. /// </summary>
  952. /// <returns></returns>
  953. private int OrderNum()
  954. {
  955. PurBidFunctionCEntity pc = new PurBidFunctionCEntity();
  956. pc.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  957. pc.Validflag = "1";
  958. int num = this.execute<int>("com.hnshituo.pur.purplan.service.BidFunctionCService", "count", new object[] { pc });
  959. num = num + 1;
  960. return num;
  961. }
  962. //新增排名
  963. private void ultraButton5_Click(object sender, System.EventArgs e)
  964. {
  965. if (ultraGrid1.ActiveRow == null)
  966. {
  967. MessageBox.Show("请选择方案", "提示");
  968. return;
  969. }
  970. string strStatus = getTaskStatusNum();
  971. if (strStatus != "1" && strStatus != "4")
  972. {
  973. MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
  974. return;
  975. }
  976. //判定总分配比例不能超过100
  977. PurBidFunctionCEntity pc1 = new PurBidFunctionCEntity();
  978. pc1.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  979. pc1.Validflag = "1";
  980. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionCService", "find", new object[] { pc1,0,0 });
  981. double numAssignValue = 0;
  982. foreach(DataRow dr in dt.Rows)
  983. {
  984. double d = double.Parse(dr["AssignValue"].ToString());
  985. numAssignValue += d;
  986. }
  987. int num = OrderNum();
  988. PurBidFunctionCEntity pc = new PurBidFunctionCEntity();
  989. string strId = this.execute<string>("com.hnshituo.pur.utils.service.UtilsService", "getOddNumber_yymm", new object[] { "PUR_BID_FUNCTION_C", "ID", "GZ", "4" });
  990. pc.Id = strId;
  991. pc.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  992. pc.Validflag = "1";
  993. pc.CreateName = UserInfo.GetUserName();
  994. pc.CreateTime = System.DateTime.Now;
  995. pc.CreateUserid = UserInfo.GetUserID();
  996. pc.Remark = txtRemark_BidFunctionC.Text;
  997. pc.AssignName = num.ToString();
  998. if (ultraNumericEditor1.Value == null )
  999. {
  1000. MessageUtil.ShowTips("请输入>0的排名比例");
  1001. return;
  1002. }
  1003. else
  1004. {
  1005. numAssignValue += double.Parse(ultraNumericEditor1.Value.ToString());
  1006. pc.AssignValue = ultraNumericEditor1.Value.ToString();
  1007. if(numAssignValue>100)
  1008. {
  1009. MessageUtil.ShowTips("所有的名次比例总和不能>100%");
  1010. return;
  1011. }
  1012. }
  1013. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionCService", "doInsert", new object[] { pc });
  1014. if (crt.Resultcode != 0)
  1015. {
  1016. MessageUtil.ShowTips("插入失败:" + crt.Resultmsg);
  1017. }
  1018. else
  1019. {
  1020. MessageUtil.ShowTips("插入成功");
  1021. }
  1022. doQueryBasePriceC(pc.VersionNo);
  1023. }
  1024. private void ultraButton7_Click(object sender, System.EventArgs e)
  1025. {
  1026. if (ultraGrid1.ActiveRow == null)
  1027. {
  1028. MessageBox.Show("请选择方案", "提示");
  1029. return;
  1030. }
  1031. string strStatus = getTaskStatusNum();
  1032. if (strStatus != "1" && strStatus != "4")
  1033. {
  1034. MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
  1035. return;
  1036. }
  1037. //判定总分配比例不能超过100
  1038. PurBidFunctionCEntity pc = new PurBidFunctionCEntity();
  1039. pc.Id = ultraGrid2.ActiveRow.Cells["Id"].Value.ToString();
  1040. pc.Remark = txtRemark_BidFunctionC.Text;
  1041. pc.UpdateName = UserInfo.GetUserName();
  1042. pc.UpdateUserid = UserInfo.GetUserID();
  1043. if (ultraNumericEditor1.Value == null)
  1044. {
  1045. MessageUtil.ShowTips("请输入排名比例");
  1046. return;
  1047. }
  1048. else
  1049. {
  1050. pc.AssignValue = ultraNumericEditor1.Value.ToString();
  1051. PurBidFunctionCEntity pc1 = new PurBidFunctionCEntity();
  1052. pc1.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
  1053. pc1.Validflag = "1";
  1054. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionCService", "find", new object[] { pc1, 0, 0 });
  1055. double numAssignValue = 0;
  1056. foreach (DataRow dr in dt.Rows)
  1057. {
  1058. if (ultraGrid2.ActiveRow.Cells["Id"].Value.ToString() == dr["id"].ToString())
  1059. {
  1060. double d = double.Parse(ultraNumericEditor1.Value.ToString());
  1061. numAssignValue += d;
  1062. }
  1063. else
  1064. {
  1065. double d = double.Parse(dr["AssignValue"].ToString());
  1066. numAssignValue += d;
  1067. }
  1068. }
  1069. if (numAssignValue > 100)
  1070. {
  1071. MessageUtil.ShowTips("所有的名次比例总和不能>100%");
  1072. return;
  1073. }
  1074. }
  1075. if (MessageUtil.ShowYesNoAndQuestion("确定修改" + ultraGrid2.ActiveRow.Cells["ASSIGNNAME"].Value.ToString() + "的比例为"+pc.AssignValue+"?") != DialogResult.Yes)
  1076. {
  1077. return;
  1078. }
  1079. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionCService", "doUpdate", new object[] { pc });
  1080. if (crt.Resultcode != 0)
  1081. {
  1082. MessageUtil.ShowTips("修改失败:" + crt.Resultmsg);
  1083. }
  1084. else
  1085. {
  1086. MessageUtil.ShowTips("修改成功");
  1087. }
  1088. doQueryBasePriceC(ultraGrid1.ActiveRow.Cells["ID"].Value.ToString());
  1089. }
  1090. private void ultraButton6_Click(object sender, System.EventArgs e)
  1091. {
  1092. if (ultraGrid1.ActiveRow == null)
  1093. {
  1094. MessageBox.Show("请选择方案", "提示");
  1095. return;
  1096. }
  1097. string strStatus = getTaskStatusNum();
  1098. if (strStatus != "1" && strStatus != "4")
  1099. {
  1100. MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
  1101. return;
  1102. }
  1103. PurBidFunctionCEntity pc = new PurBidFunctionCEntity();
  1104. pc.Validflag = "1";
  1105. pc.VersionNo = ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
  1106. pc.AssignName = (OrderNum() - 1).ToString();
  1107. DataTable dt=this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionCService", "find", new object[] { pc, 0, 0 });
  1108. if (dt.Rows.Count<1)
  1109. {
  1110. MessageUtil.ShowTips("删除失败:未找到可删除的排名");
  1111. return;
  1112. }
  1113. pc.Id = dt.Rows[0]["ID"].ToString();
  1114. if (MessageUtil.ShowYesNoAndQuestion("确定删除第" + dt.Rows[0]["ASSIGNNAME"].ToString() + "名分配规则?") != DialogResult.Yes)
  1115. {
  1116. return;
  1117. }
  1118. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionCService", "doDelete", new object[] { pc });
  1119. if (crt.Resultcode != 0)
  1120. {
  1121. MessageUtil.ShowTips("删除失败:" + crt.Resultmsg);
  1122. }
  1123. else
  1124. {
  1125. MessageUtil.ShowTips("删除成功");
  1126. }
  1127. doQueryBasePriceC(ultraGrid1.ActiveRow.Cells["ID"].Value.ToString());
  1128. }
  1129. private void txt_EVA_USERNAME_EditorButtonClick(object sender, EditorButtonEventArgs e)
  1130. {
  1131. SetectManByDept frm = new SetectManByDept(this.ob, this.UserInfo.GetDeptid());
  1132. frm.ShowDialog();
  1133. txt_EVA_ORG_ID.Text = frm.StrDeptId;
  1134. txt_EVA_ORG_NAME.Text = frm.StrDeptName;
  1135. txt_EVA_USERID.Text = frm.StrUserID;
  1136. txt_EVA_USERNAME.Text = frm.StrUserName;
  1137. }
  1138. private void ultraGrid2_Click(object sender, System.EventArgs e)
  1139. {
  1140. this.ultraTabControl1.SelectedTab = this.ultraTabControl1.Tabs["1"];
  1141. }
  1142. private void ultraGrid1_Click(object sender, System.EventArgs e)
  1143. {
  1144. this.ultraTabControl1.SelectedTab = this.ultraTabControl1.Tabs["0"];
  1145. }
  1146. private void ultraGrid3_Click(object sender, System.EventArgs e)
  1147. {
  1148. this.ultraTabControl1.SelectedTab = this.ultraTabControl1.Tabs["2"];
  1149. }
  1150. private void ultraGrid4_Click(object sender, System.EventArgs e)
  1151. {
  1152. this.ultraTabControl1.SelectedTab = this.ultraTabControl1.Tabs["3"];
  1153. }
  1154. public string getTaskStatusNum()
  1155. {
  1156. string strTaskStatus = "";
  1157. PurBidFunctionMEntity M_PurTaskM = new PurBidFunctionMEntity();
  1158. M_PurTaskM = this.execute<PurBidFunctionMEntity>("com.hnshituo.pur.purplan.service.BidFunctionMService", "findById", new object[] { ultraGrid1.ActiveRow.Cells["ID"].Value.ToString() });
  1159. if (M_PurTaskM != null)
  1160. {
  1161. strTaskStatus = M_PurTaskM.Status;
  1162. }
  1163. return strTaskStatus;
  1164. }
  1165. }
  1166. }