ConsentSelectTabPageAll.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. #region Copyright © 2015 CLIPSOFT Co.,Ltd. All Rights Reserved.
  2. //
  3. // All rights are reserved. Reproduction or transmission in whole or in part,
  4. // in any form or by any means, electronic, mechanical or otherwise, is
  5. // prohibited without the prior written consent of the copyright owner.
  6. //
  7. // Filename:ConsentSelectTabPageAll.cs
  8. //
  9. #endregion
  10. using System;
  11. using System.Collections.Generic;
  12. using System.ComponentModel;
  13. using System.Windows.Forms;
  14. using System.Configuration;
  15. using CLIP.eForm.Consent.Dfh.UI.ConsentSvcRef;
  16. using ClipSoft.eForm.Base.Dialog;
  17. namespace CLIP.eForm.Consent.Dfh.UI
  18. {
  19. /// <summary>
  20. /// 동의서 전체목록 탭 클래스
  21. /// </summary>
  22. /// <remarks>
  23. /// <p>[설계자]</p>
  24. /// <p> 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)</p>
  25. /// <p>[원본 작성자]</p>
  26. /// <p> 클립소프트 기술부 4팀 이창훈 (chlee@clipsoft.co.kr)</p>
  27. /// <p>[수정 작성자]</p>
  28. /// <p> 클립소프트 기술부 이인희</p>
  29. /// <p>----------------------------------------------------------------------------------------</p>
  30. /// <p>[HISTORY]</p>
  31. /// <p> 2016-07-01 : 최초작성</p>
  32. /// <p>----------------------------------------------------------------------------------------</p>
  33. /// </remarks>
  34. public partial class ConsentSelectTabPageAll : UserControl
  35. {
  36. private ConsentSvcRef.ConsentSvcSoapClient consentWebService = null;
  37. private IConsentMain consentMain = null;
  38. private ConsentCommandCtrl commandControl = null;
  39. private string searchStartDate = string.Empty;
  40. public ConsentSelectTabPageAll()
  41. {
  42. InitializeComponent();
  43. }
  44. private void ConsentSelectTabPageAll_Load(object sender, EventArgs e)
  45. {
  46. Boolean isInWpfDesignerMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
  47. Boolean isInFormsDesignerMode = (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv");
  48. if (isInWpfDesignerMode || isInFormsDesignerMode)
  49. {
  50. // is in any designer mode
  51. return;
  52. }
  53. if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime)
  54. {
  55. return;
  56. }
  57. consentMain = ConsentMainControl.GetConsentMainInterface(this);
  58. commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  59. consentWebService = WebMethodCommon.GetConsentWebService(consentMain.PluginExecuteInfo["consentSvcUrl"]);
  60. this.dateTimePickerEndDate.Value = DateTime.Now;
  61. InitDataGrid();
  62. BindDataGridRows();
  63. }
  64. private void InitDataGrid()
  65. {
  66. this.dataGridViewConsentSelectResult.MultiSelect = false;
  67. this.dataGridViewConsentSelectResult.AutoGenerateColumns = false;
  68. this.dataGridViewConsentSelectResult.AllowUserToAddRows = false;
  69. this.dataGridViewConsentSelectResult.CellDoubleClick += new DataGridViewCellEventHandler(dataGridViewConsentSelectResult_CellMouseDoubleClick);
  70. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서명", "ConsentName", true, 250);
  71. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "상태", "ConsentStateDisp", true, 60);
  72. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "처방명", "OrderNm", true, 100);
  73. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "내원/입원일", "ClnDate", true, 100);
  74. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "진료과", "ClnDeptNm", true, 100);
  75. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "처방의", "CosignDcName", true, 80);
  76. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "병동", "Ward", true, 100);
  77. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "작성일시", "CreateDateTime", true, 120);
  78. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "작성자", "CreateUserName", true, 80);
  79. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "생성번호", "Cretno", false);
  80. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "상태코드", "ConsentState", false);
  81. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "처방구분코드", "OrderNo", false);
  82. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 고유코드", "FormGuid", false);
  83. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 고유RID", "FormRid", false);
  84. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 작성 마스터 RID", "ConsentMstRid", false);
  85. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "처방코드", "OrderCd", false);
  86. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "OCR코드", "OcrNumber", false);
  87. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "병실", "RoomCd", false);
  88. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서코드", "FormCd", false);
  89. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "내원구분", "VisitType", false);
  90. }
  91. #region 검색 조건에 따른 환자의 동의서 조회
  92. public void BindDataGridRows()
  93. {
  94. try
  95. {
  96. if (this.consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  97. if (this.commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  98. if (this.consentWebService == null) this.consentWebService = WebMethodCommon.GetConsentWebService(consentMain.PluginExecuteInfo["consentSvcUrl"]);
  99. if (commandControl.CurrentTargetPatient != null && !string.IsNullOrEmpty(commandControl.CurrentTargetPatient.PatientCode))
  100. {
  101. // 프린터 모드가 아닐 경우
  102. if (!(consentMain.ConsentExecuteInfo.ContainsKey("printAct")
  103. && !string.IsNullOrEmpty(consentMain.ConsentExecuteInfo["printAct"])
  104. && consentMain.ConsentExecuteInfo["printAct"].Equals("Y")
  105. )
  106. //&& !this.consentMain.printSaveStatus
  107. )
  108. {
  109. if (this.dateTimePickerStartDate.Value > this.dateTimePickerEndDate.Value)
  110. {
  111. this.dateTimePickerStartDate.Value = DateTime.Today - TimeSpan.FromDays(1);
  112. this.dateTimePickerEndDate.Value = DateTime.Today;
  113. }
  114. if (string.IsNullOrEmpty(searchStartDate))
  115. {
  116. if (commandControl.CurrentTargetPatient != null && !string.IsNullOrEmpty(commandControl.CurrentTargetPatient.clnDate))
  117. {
  118. searchStartDate = string.Format("{0}-{1}-{2}", commandControl.CurrentTargetPatient.clnDate.Substring(0, 4), commandControl.CurrentTargetPatient.clnDate.Substring(4, 2), commandControl.CurrentTargetPatient.clnDate.Substring(6, 2));
  119. }
  120. else
  121. {
  122. searchStartDate = consentMain.PluginExecuteInfo["ConsentSearchStartDate"];
  123. }
  124. }
  125. this.dateTimePickerStartDate.Value = Convert.ToDateTime(searchStartDate);
  126. string patientCode = commandControl.CurrentTargetPatient.PatientCode;
  127. string sDate = this.dateTimePickerStartDate.Value.ToShortDateString().Replace("-", "");
  128. string eDate = this.dateTimePickerEndDate.Value.ToShortDateString().Replace("-", "");
  129. string consentState = GetCheckConsentState();
  130. ConsentVO[] resultData = consentWebService.GetConsentList(patientCode, sDate, eDate, consentState, string.Empty);
  131. if (resultData == null)
  132. {
  133. return;
  134. }
  135. this.dataGridViewConsentSelectResult.DataSource = new SortableBindingList<ConsentVO>(resultData);
  136. ConsentVO vo = GetCurrentConsentVO(0);
  137. if (vo != null)
  138. {
  139. ExecutePreviewWithSelectedConsent(vo);
  140. }
  141. }
  142. }
  143. }
  144. catch(Exception ex)
  145. {
  146. MessageBox.Show(this, ex.Message);
  147. }
  148. }
  149. //"ALL" or "'UNFINISHED','TEMP'"
  150. private string GetCheckConsentState()
  151. {
  152. string consentState = "";
  153. if (this.checkBoxAll.Checked)
  154. {
  155. consentState = "ALL";
  156. }
  157. else
  158. {
  159. if (this.checkBoxUnfinished.Checked)
  160. consentState += ((consentState.Length > 0) ? "," : "") + "'" + this.checkBoxUnfinished.Tag + "'";
  161. if (this.checkBoxTemp.Checked)
  162. consentState += ((consentState.Length > 0) ? "," : "") + "'" + this.checkBoxTemp.Tag + "'";
  163. if (this.checkBoxElectronicCmp.Checked)
  164. consentState += ((consentState.Length > 0) ? "," : "") + "'" + this.checkBoxElectronicCmp.Tag + "'";
  165. if (this.checkBoxCertifyCmp.Checked)
  166. consentState += ((consentState.Length > 0) ? "," : "") + "'" + this.checkBoxCertifyCmp.Tag + "'";
  167. if (this.checkBoxPaperOut.Checked)
  168. consentState += ((consentState.Length > 0) ? "," : "") + "'" + this.checkBoxPaperOut.Tag + "'";
  169. if (this.checkBoxVerbal.Checked)
  170. consentState += ((consentState.Length > 0) ? "," : "") + "'" + this.checkBoxVerbal.Tag + "'";
  171. }
  172. return consentState;
  173. }
  174. #endregion
  175. #region ConsentState 확인
  176. private static bool IsConsentStateTempSave(ConsentVO vo)
  177. {
  178. if (vo.ConsentState.ToUpper().Equals("TEMP") || vo.ConsentState.ToUpper().Equals("VERBAL"))
  179. {
  180. return true;
  181. }
  182. return false;
  183. }
  184. private static bool IsConsentStatePrintOut(ConsentVO vo)
  185. {
  186. return vo.ConsentState.ToUpper().Equals("PAPER_OUT");
  187. }
  188. private static bool IsConsentStateElectronicComplete(ConsentVO vo)
  189. {
  190. return vo.ConsentState.ToUpper().Equals("ELECTR_CMP");
  191. }
  192. private static bool IsConsentStateCertifyComplete(ConsentVO vo)
  193. {
  194. return vo.ConsentState.ToUpper().Equals("CERTIFY_CMP");
  195. }
  196. private static bool IsConsentStateUnfinished(ConsentVO vo)
  197. {
  198. return vo.ConsentState.ToUpper().Equals("UNFINISHED");
  199. }
  200. private static bool IsConsentStateFnuPrintOut(ConsentVO vo)
  201. {
  202. return vo.ConsentState.ToUpper().Equals("FNU_PRINT");
  203. }
  204. #endregion
  205. #region 체크박스 이벤트
  206. private void checkBoxAll_CheckedChanged(object sender, EventArgs e)
  207. {
  208. if (this.checkBoxAll.Checked == true)
  209. {
  210. this.checkBoxUnfinished.Checked = false;
  211. this.checkBoxTemp.Checked = false;
  212. this.checkBoxElectronicCmp.Checked = false;
  213. this.checkBoxCertifyCmp.Checked = false;
  214. this.checkBoxPaperOut.Checked = false;
  215. }
  216. }
  217. private void checkBoxUnfinished_CheckedChanged(object sender, EventArgs e)
  218. {
  219. if (this.checkBoxUnfinished.Checked == true && this.checkBoxAll.Checked == true)
  220. {
  221. this.checkBoxAll.Checked = false;
  222. }
  223. }
  224. private void checkBoxTemp_CheckedChanged(object sender, EventArgs e)
  225. {
  226. if (this.checkBoxTemp.Checked == true && this.checkBoxAll.Checked == true)
  227. {
  228. this.checkBoxAll.Checked = false;
  229. }
  230. }
  231. private void checkBoxElectronicCmp_CheckedChanged(object sender, EventArgs e)
  232. {
  233. if (this.checkBoxElectronicCmp.Checked == true && this.checkBoxAll.Checked == true)
  234. {
  235. this.checkBoxAll.Checked = false;
  236. }
  237. }
  238. private void checkBoxCertifyCmp_CheckedChanged(object sender, EventArgs e)
  239. {
  240. if (this.checkBoxCertifyCmp.Checked == true && this.checkBoxAll.Checked == true)
  241. {
  242. this.checkBoxAll.Checked = false;
  243. }
  244. }
  245. private void checkBoxPaperOut_CheckedChanged(object sender, EventArgs e)
  246. {
  247. if (this.checkBoxPaperOut.Checked == true && this.checkBoxAll.Checked == true)
  248. {
  249. this.checkBoxAll.Checked = false;
  250. }
  251. }
  252. #endregion
  253. # region 조회버튼 클릭 이벤트
  254. private void buttonConsentSelect_Click(object sender, EventArgs e)
  255. {
  256. string checkState = GetCheckConsentState();
  257. if (checkState.Length > 0)
  258. {
  259. Cursor currentCursor = this.Cursor;
  260. if (!string.IsNullOrEmpty(searchStartDate))
  261. {
  262. searchStartDate = this.dateTimePickerStartDate.Value.ToShortDateString();
  263. }
  264. try
  265. {
  266. this.Cursor = Cursors.WaitCursor;
  267. BindDataGridRows();
  268. }
  269. catch (Exception ex)
  270. {
  271. throw ex;
  272. }
  273. finally
  274. {
  275. this.Cursor = currentCursor;
  276. }
  277. }
  278. else
  279. {
  280. MessageBox.Show(string.Format(Properties.Resources.msg_unfinished_check)
  281. , string.Format(Properties.Resources.msg_caption_confirm),
  282. MessageBoxButtons.OK, MessageBoxIcon.Information);
  283. }
  284. }
  285. #endregion
  286. #region 동의서 미리보기
  287. //선택된 Row의 ConsentVO 객체를 반환한다.
  288. private ConsentVO GetCurrentConsentVO(int rowIndex)
  289. {
  290. ConsentVO vo = null;
  291. if (rowIndex < 0)
  292. {
  293. return vo;
  294. }
  295. if (dataGridViewConsentSelectResult != null && dataGridViewConsentSelectResult.Rows.Count > 0)
  296. {
  297. //this.dataGridViewConsentSelectResult.Rows[rowIndex].Selected = true;
  298. //this.dataGridViewConsentSelectResult.CurrentCell = this.dataGridViewConsentSelectResult.Rows[rowIndex].Cells[0];
  299. vo = this.dataGridViewConsentSelectResult.Rows[rowIndex].DataBoundItem as ConsentVO;
  300. }
  301. return vo;
  302. }
  303. //선택된 ConsentVO 객체를 미리보기 실행한다.
  304. private void ExecutePreviewWithSelectedConsent(ConsentVO vo)
  305. {
  306. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  307. if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  308. Cursor currentCursor = this.Cursor;
  309. this.Cursor = Cursors.WaitCursor;
  310. Dictionary<string, string> globalParams = Common.CreateGlobalParamsDictionary();
  311. commandControl.CurrentPreviewConsent = new PreviewConsent();
  312. commandControl.CurrentPreviewConsent.FormRid = vo.FormRid.ToString();
  313. commandControl.CurrentPreviewConsent.FormGuid = vo.FormGuid;
  314. commandControl.CurrentPreviewConsent.FormCd = vo.FormCd.ToString();
  315. commandControl.CurrentPreviewConsent.FormName = vo.ConsentName;
  316. commandControl.CurrentPreviewConsent.PrntCnt = vo.PrntCnt;
  317. commandControl.CurrentPreviewConsent.ConsentMstRid = vo.ConsentMstRid.ToString();
  318. commandControl.CurrentPreviewConsent.ConsentState = vo.ConsentState;
  319. commandControl.CurrentPreviewConsent.OrderNo = vo.OrderNo;
  320. commandControl.CurrentPreviewConsent.Ocrcode = vo.OcrNumber;
  321. commandControl.CurrentPreviewConsent.InputId = vo.CreateUserId;
  322. commandControl.CurrentPreviewConsent.InputNm = vo.CreateUserName;
  323. commandControl.CurrentPreviewConsent.ReissueConsentMstRid = (IsConsentStatePrintOut(vo)) ? vo.ConsentMstRid : 0;
  324. commandControl.CurrentPreviewConsent.RewriteConsentMstRid = (!IsConsentStateUnfinished(vo)) ? vo.ConsentMstRid : 0;
  325. commandControl.CurrentPreviewConsent.VisitType = vo.VisitType;
  326. //commandControl.CurrentPreviewConsent.FormName = vo.;//서식 이름 이걸로 쓰도록 수정
  327. consentMain.PatientInfoCtrl.SetConsentDocumentName(vo.ConsentName);
  328. if (IsConsentStateTempSave(vo)) //임시저장
  329. {
  330. commandControl.ShowTempSaveConsent(consentMain);//consent_data에 데이터가 있을때만
  331. }
  332. else if (IsConsentStatePrintOut(vo)) //출력
  333. {
  334. if (this.dataGridViewConsentSelectResult.SelectedRows.Count > 0 &&
  335. this.dataGridViewConsentSelectResult.SelectedRows[0].Tag != null &&
  336. this.dataGridViewConsentSelectResult.SelectedRows[0].Tag.Equals("reissueTarget"))
  337. {
  338. //재출력 하는 경우
  339. commandControl.CurrentPreviewConsent.ReissueConsentMstRid = vo.ConsentMstRid;
  340. commandControl.CurrentPreviewConsent.RewriteConsentMstRid = 0;
  341. CheckClnDateInfo(vo);
  342. commandControl.PreviewConsent(consentMain);
  343. }
  344. else
  345. {
  346. CheckClnDateInfo(vo);
  347. commandControl.PreviewConsent(consentMain);
  348. //MessageBox.Show(string.Format(Properties.Resources.msg_completed_printed_click)
  349. // , string.Format(Properties.Resources.msg_caption_confirm), MessageBoxButtons.OK, MessageBoxIcon.Information);
  350. }
  351. }
  352. else if (IsConsentStateElectronicComplete(vo) || IsConsentStateCertifyComplete(vo)) //서명완료
  353. {
  354. commandControl.ShowCompleteConsent(consentMain);//이미지 호출하는 함수
  355. }
  356. else if (IsConsentStateUnfinished(vo)) //미작성
  357. {
  358. CheckClnDateInfo(vo);
  359. commandControl.PreviewConsent(consentMain);//consent_data에 데이터가 없을때 사용하는 함수
  360. }
  361. else if (IsConsentStateFnuPrintOut(vo)) //FNU 출력
  362. {
  363. MessageBoxDlg.Show(true, string.Format(Properties.Resources.msg_fnu_printed)
  364. , string.Format(Properties.Resources.msg_caption_confirm)
  365. , MessageBoxButtons.OK, MessageBoxIcon.Information);
  366. }
  367. this.Cursor = currentCursor;
  368. }
  369. //동의서의 처방일자와 생성번호 등의 정보가 현재 정보와 일치하지 않은 경우, 미리보기를 위해서 데이터를 재조회한다.
  370. private void CheckClnDateInfo(ConsentVO vo)
  371. {
  372. bool bSame = true;
  373. if (!vo.ClnDate.Replace("-", "").Equals(commandControl.CurrentTargetPatient.clnDate.Replace("-", "")))
  374. bSame = false;
  375. if (!vo.Cretno.ToString().Equals(commandControl.CurrentTargetPatient.cretno))
  376. bSame = false;
  377. if (!vo.ClnDeptCd.Equals(commandControl.CurrentTargetPatient.clnDeptCode))
  378. bSame = false;
  379. if (!vo.VisitType.Equals(commandControl.CurrentTargetPatient.VisitType))
  380. bSame = false;
  381. if (bSame == false)
  382. {
  383. //동의서 맵핑 정보를 상단의 선택된 진료일과 작성자 정보로 한다.
  384. consentMain.PatientInfoCtrl.SetPatientByConsentInfo(vo.ClnDate.Replace("-", ""),
  385. vo.VisitType,
  386. vo.ClnDeptCd,
  387. vo.Cretno.ToString());
  388. }
  389. }
  390. #endregion
  391. #region 그리드 이벤트
  392. /*
  393. private void dataGridViewConsentSelectResult_CellClick(object sender, DataGridViewCellEventArgs e)
  394. {
  395. ConsentVO vo = GetCurrentConsentVO(e.RowIndex);
  396. if (vo != null)
  397. {
  398. IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
  399. consentMain.preParamClean();
  400. ExecutePreviewWithSelectedConsent(vo);
  401. }
  402. }
  403. */
  404. private void dataGridViewConsentSelectResult_CellContextMenuStripNeeded(object sender, DataGridViewCellContextMenuStripNeededEventArgs e)
  405. {
  406. if (e.RowIndex > 0 && this.dataGridViewConsentSelectResult.Rows[e.RowIndex].Selected == true)
  407. {
  408. ConsentVO vo = GetCurrentConsentVO(e.RowIndex);
  409. if (vo.ConsentState.Equals("UNFINISHED") || vo.ConsentState.Equals("PAPER_OUT"))
  410. {
  411. ContextMenuStrip strip = new ContextMenuStrip();
  412. //if (vo.ConsentState.Equals("UNFINISHED"))
  413. //{
  414. // ToolStripMenuItem deleteRecord = new ToolStripMenuItem();
  415. // deleteRecord.Text = "삭제";
  416. // strip.Items.Add(deleteRecord);
  417. // deleteRecord.Click += new EventHandler(deleteRecord_Click);
  418. //}
  419. //else
  420. if (vo.ConsentState.Equals("PAPER_OUT"))
  421. {
  422. ToolStripMenuItem reprintRecord = new ToolStripMenuItem();
  423. reprintRecord.Text = "재출력";
  424. strip.Items.Add(reprintRecord);
  425. reprintRecord.Click += new EventHandler(reprintRecord_Click);
  426. }
  427. e.ContextMenuStrip = strip;
  428. }
  429. }
  430. }
  431. private void dataGridViewConsentSelectResult_CellMouseDoubleClick(object sender, DataGridViewCellEventArgs e)
  432. {
  433. ConsentVO vo = GetCurrentConsentVO(e.RowIndex);
  434. if (vo != null)
  435. {
  436. IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
  437. consentMain.preParamClean();
  438. ExecutePreviewWithSelectedConsent(vo);
  439. if (!vo.ConsentState.Equals("PAPER_OUT") && !vo.ConsentState.Equals("FNU_PRINT") && !vo.ConsentState.Equals("ELECTR_CMP") && !vo.ConsentState.Equals("CERTIFY_CMP"))
  440. {
  441. RunConsentDualView();
  442. }
  443. }
  444. /*
  445. ConsentVO vo = GetCurrentConsentVO(e.RowIndex);
  446. if (vo != null)
  447. {
  448. if (vo.ConsentState.ToLower().Equals("electr_cmp") || vo.ConsentState.ToLower().Equals("certify_cmp") || vo.ConsentState.ToLower().Equals("paper_out"))
  449. {
  450. }
  451. else
  452. {
  453. //미작성, 임서저장 상태일때 마우스 더블클릭을 하면 양면으로 동의서 보여줌
  454. RunConsentDualView();
  455. }
  456. }
  457. */
  458. }
  459. private void RunConsentDualView()
  460. {
  461. if (this.consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  462. if (this.commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  463. commandControl.RunConsentDualView();
  464. }
  465. private void deleteRecord_Click(object sender, EventArgs e)
  466. {
  467. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  468. if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  469. bool bDel = true;
  470. ReasonForUseN reasonForUseN = new ReasonForUseN(bDel);
  471. if (reasonForUseN.ShowDialog() == DialogResult.OK)
  472. {
  473. string reason = reasonForUseN.GetReasonForUseN();
  474. reasonForUseN.Close();
  475. if (this.dataGridViewConsentSelectResult.SelectedRows.Count != 0)
  476. {
  477. Cursor currentCursor = this.Cursor;
  478. try
  479. {
  480. this.Cursor = Cursors.WaitCursor;
  481. //동의서 삭제 처리를 위해서 재발행MstID에 값을 넣는다.
  482. ConsentVO vo = GetCurrentConsentVO(this.dataGridViewConsentSelectResult.SelectedRows[0].Index);
  483. commandControl.CurrentPreviewConsent.ReissueConsentMstRid = vo.ConsentMstRid;
  484. consentMain.ConsentCommandCtrl.DeleteRecordOfDeleteConsent(reason);
  485. consentMain.ConsentListCtrl.InquiryConsentData(-1);
  486. this.Cursor = currentCursor;
  487. MessageBox.Show(string.Format(Properties.Resources.msg_consent_record_deleted)
  488. , string.Format(Properties.Resources.msg_caption_confirm),
  489. MessageBoxButtons.OK, MessageBoxIcon.Information);
  490. }
  491. catch (Exception ex)
  492. {
  493. this.Cursor = currentCursor;
  494. throw ex;
  495. }
  496. finally
  497. {
  498. }
  499. }
  500. }
  501. }
  502. private void reprintRecord_Click(object sender, EventArgs e)
  503. {
  504. ConsentVO vo = GetCurrentConsentVO(this.dataGridViewConsentSelectResult.SelectedRows[0].Index);
  505. if (vo != null)
  506. {
  507. this.dataGridViewConsentSelectResult.SelectedRows[0].Tag = "reissueTarget"; // 재출력 대상 마킹
  508. ExecutePreviewWithSelectedConsent(vo);
  509. this.dataGridViewConsentSelectResult.SelectedRows[0].Tag = null;
  510. //재출력을 하는 경우, 바로 출력이 되도록 한다.
  511. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  512. if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  513. commandControl.PrintConsentDocument();
  514. }
  515. }
  516. #endregion
  517. public void clearSearchStartDate()
  518. {
  519. searchStartDate = string.Empty;
  520. }
  521. }
  522. }