frmPop_BID_FUNCTION.cs 38 KB

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