ConsentSelectTabConsentSearch.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  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:ConsentSelectTabConsentSearch.cs
  8. //
  9. #endregion
  10. using System;
  11. using System.ComponentModel;
  12. using System.Drawing;
  13. using System.Windows.Forms;
  14. using CLIP.eForm.Consent.UI.ConsentSvcRef;
  15. using CLIP.eForm.Consent.UI.HospitalSvcRef;
  16. using ConsentFormListVO = CLIP.eForm.Consent.UI.ConsentSvcRef.ConsentFormListVO;
  17. namespace CLIP.eForm.Consent.UI {
  18. /// <summary>
  19. /// 동의서 찾기 탭 클래스
  20. /// </summary>
  21. /// <remarks>
  22. /// <p>[설계자]</p>
  23. /// <p> 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)</p>
  24. /// <p>[원본 작성자]</p>
  25. /// <p> 클립소프트 기술부 4팀 이창훈 (chlee@clipsoft.co.kr)</p>
  26. /// <p>[수정 작성자]</p>
  27. /// <p> 클립소프트 기술부 이인희</p>
  28. /// <p>----------------------------------------------------------------------------------------</p>
  29. /// <p>[HISTORY]</p>
  30. /// <p> 2015-07-30 : 최초작성</p>
  31. /// <p>----------------------------------------------------------------------------------------</p>
  32. /// </remarks>
  33. public partial class ConsentSelectTabConsentSearch : UserControl {
  34. private ConsentSvcRef.ConsentSvcSoapClient consentWebService = null;
  35. private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
  36. private IConsentMain consentMain = null;
  37. private ConsentCommandCtrl commandControl = null;
  38. Timer grdClickTimer = new Timer();
  39. public ConsentSelectTabConsentSearch() {
  40. InitializeComponent();
  41. grdClickTimer.Interval = 500;
  42. grdClickTimer.Tag = "stop";
  43. grdClickTimer.Tick += grdTimer_Tick;
  44. }
  45. private void ConsentSelectTabConsentSearch_Load(object sender, EventArgs e) {
  46. if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime) {
  47. return;
  48. }
  49. consentMain = ConsentMainControl.GetConsentMainInterface(this);
  50. commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  51. consentWebService = WebMethodCommon.GetConsentWebService(consentMain.PluginExecuteInfo["consentSvcUrl"]);
  52. hospitalWebService = WebMethodCommon.GetHospitalWebService(consentMain.PluginExecuteInfo["hospitalSvcUrl"]);
  53. InitComboBoxConsentType();
  54. // 동의서 찾기에서 기본 카테고리를 해당 기관으로 기본적으로 설정되게끔 변경
  55. //comboBoxConsentType.SelectedValue = string.Format("EMA_{0}", consentMain.ConsentExecuteInfo["dutinstcd"]);
  56. InitDataGrid();
  57. }
  58. /// <summary>
  59. /// 초기 DataGrid 항목 설정
  60. /// </summary>
  61. private void InitDataGrid() {
  62. this.dataGridViewConsentSelectResult.AllowUserToAddRows = false;
  63. this.dataGridViewConsentSelectResult.CellDoubleClick += new DataGridViewCellEventHandler(dataGridViewConsentSelectResult_CellDoubleClick);
  64. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서명", "formName", true, 250);
  65. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 코드", "formCd", true, 100);
  66. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 고유코드", "consentMstRid", false);
  67. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "생성자 아이디", "createUserId", false);
  68. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "생성자 아이디", "createUserName", false);
  69. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "생성자 아이디", "createDatetime", false);
  70. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "OCRTAG", "ocrTag", false);
  71. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "환자번호", "pid", false);
  72. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "내원일", "inDd", false);
  73. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "ordtype", "ordType", false);
  74. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "ordDeptCd", "ordDeptCd", false);
  75. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "cretNo", "cretNo", false);
  76. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "opRsrvNo", "opRsrvNo", false);
  77. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "patientName", "patientName", false);
  78. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "consentState", "consentState", false);
  79. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "consentStateEng", "consentStateEng", false);
  80. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "formGuid", "formGuid", false);
  81. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "formRid", "formRid", false);
  82. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "printOnly", "printOnly", false);
  83. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "printCnt", "printCnt", false);
  84. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "ocrTagPrntYn", "ocrTagPrntYn", false);
  85. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "formPrntNm", "formPrntNm", false);
  86. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "certUseYn", "certUseYn", false);
  87. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "opDiagNm", "opDiagNm", false);
  88. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "opNm", "opNm", false);
  89. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "userDrFlag", "userDrFlag", false);
  90. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "linkFormCd", "linkFormCd", false);
  91. CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "jinjeongCd", "jinjeongCd", false);
  92. //CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "jinjeongCd", "jinjeongCd", false);
  93. }
  94. #region 동의서 카테고리 바인딩
  95. /// <summary>
  96. /// 초기 동의서 카테고리 바인딩
  97. /// </summary>
  98. private void InitComboBoxConsentType() {
  99. CategoryForDropdownVO[] arrayData = consentWebService.GetCategoryForDropdown(consentMain.ConsentExecuteInfo["dutinstcd"]);
  100. CategoryForDropdownVO[] mainCategory = new CategoryForDropdownVO[1];
  101. CategoryForDropdownVO mainItem = new CategoryForDropdownVO();
  102. mainItem.CategoryId = "F";
  103. mainItem.CategoryName = "전체";
  104. mainCategory[0] = mainItem;
  105. this.comboBoxConsentType.DisplayMember = "CategoryName";
  106. this.comboBoxConsentType.ValueMember = "CategoryId";
  107. this.comboBoxConsentType.DataSource = mainCategory;
  108. // 서브 카테고리 설정
  109. InitComboBoxConsentSubType(consentMain.ConsentExecuteInfo["dutinstcd"]);
  110. }
  111. class MainCategory {
  112. String CategoryName;
  113. String CategoryId;
  114. public MainCategory(String CategoryName, String CategoryId) {
  115. this.CategoryName = CategoryName;
  116. this.CategoryId = CategoryId;
  117. }
  118. }
  119. /// <summary>
  120. /// comboBoxConsentType 콤보 컨트롤 변경 이벤트
  121. /// </summary>
  122. /// <param name="sender">The source of the event.</param>
  123. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  124. private void comboBoxConsentType_SelectedIndexChanged(object sender, EventArgs e) {
  125. //SetSubConsentTypeDataToComboBox();
  126. }
  127. /// <summary>
  128. /// 동의서 하위 분류 항목 바인딩
  129. /// </summary>
  130. private void SetSubConsentTypeDataToComboBox() {
  131. string comboBoxConsentTypeValue = comboBoxConsentType.SelectedValue.ToString();
  132. // 전체 선택
  133. if (comboBoxConsentTypeValue.Equals("CATE_ALL")) {
  134. this.comboBoxConsentSubType.DataSource = null;
  135. this.comboBoxConsentSubType.Enabled = false;
  136. } else {
  137. this.comboBoxConsentSubType.Enabled = true;
  138. InitComboBoxConsentSubType(comboBoxConsentTypeValue);
  139. }
  140. }
  141. /// <summary>
  142. /// 동의서 하위 분류 조회 및 바인딩
  143. /// </summary>
  144. /// <param name="parentValue">The parent value.</param>
  145. private void InitComboBoxConsentSubType(string parentValue) {
  146. // 주어진 parentValue 로 GetCategoryForDropdown API 호출
  147. CategoryForDropdownVO[] arrayData = consentWebService.GetCategoryForDropdown(parentValue);
  148. this.comboBoxConsentSubType.DisplayMember = "CategoryName";
  149. this.comboBoxConsentSubType.ValueMember = "CategoryId";
  150. this.comboBoxConsentSubType.DataSource = arrayData;
  151. }
  152. #endregion
  153. #region 동의서 조회하고 그리드 바인딩
  154. /// <summary>
  155. /// textBoxConsentSearchKeyWord 키보드 입력 이벤트
  156. /// </summary>
  157. /// <param name="sender">The source of the event.</param>
  158. /// <param name="e">The <see cref="KeyEventArgs"/> instance containing the event data.</param>
  159. private void textBoxConsentSearchKeyWord_KeyDown(object sender, KeyEventArgs e) {
  160. // 엔터키 입력 시 조회 버튼 클릭 이벤트 수행
  161. if (e.KeyCode == Keys.Enter) {
  162. this.buttonConsentSelect.PerformClick();
  163. }
  164. }
  165. /// <summary>
  166. /// 조회 버튼 클릭 이벤트
  167. /// </summary>
  168. /// <param name="sender">The source of the event.</param>
  169. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  170. private void buttonConsentSelect_Click(object sender, EventArgs e) {
  171. buttonConsentSelect.Enabled = false;
  172. Application.DoEvents();
  173. IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
  174. ConsentCommandCtrl commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  175. consentMain.preParamClean();
  176. GetConsentBySearch();
  177. buttonConsentSelect.Enabled = true;
  178. }
  179. /// <summary>
  180. /// 동의서 검색
  181. /// </summary>
  182. private void GetConsentBySearch() {
  183. Cursor currentCursor = this.Cursor;
  184. try {
  185. this.Cursor = Cursors.WaitCursor;
  186. string consentType = string.Empty;
  187. // 부서명이 선택되어 있지 않으면 근무지기관코드로 검색
  188. if (this.comboBoxConsentSubType.SelectedValue == null) {
  189. consentType = this.comboBoxConsentType.SelectedValue.ToString();
  190. }
  191. // 부서명이 선택되어 있으면 부서명으로 검색
  192. else {
  193. consentType = this.comboBoxConsentSubType.SelectedValue.ToString();
  194. }
  195. string keyWord = string.Empty;
  196. keyWord = "%" + this.textBoxConsentSearchKeyWord.Text + "%";
  197. if ((consentType.Equals("EMA_031") || consentType.Equals("EMA_032")) && keyWord.Trim().Equals("%%")) {
  198. MessageBox.Show("과 또는 검색어를 입력해주세요.");
  199. return;
  200. }
  201. //ConsentFormListVO[] arrayData = consentWebService.GetConsentBySearch(consentType, keyWord, consentMain.ConsentExecuteInfo["dutinstcd"]);
  202. ConsentVO[] arrayData = consentWebService.GetConsentBySearch("4", keyWord, "031");
  203. if (arrayData == null) {
  204. return;
  205. }
  206. this.dataGridViewConsentSelectResult.DataSource = new SortableBindingList<ConsentSvcRef.ConsentVO>(arrayData);
  207. } catch (Exception ex) {
  208. throw ex;
  209. } finally {
  210. this.Cursor = currentCursor;
  211. }
  212. }
  213. #endregion
  214. #region 그리드 이벤트
  215. /// <summary>
  216. /// dataGridViewConsentSelectResult 그리드 셀 더블클릭 이벤트
  217. /// </summary>
  218. /// <param name="sender">The source of the event.</param>
  219. /// <param name="e">The <see cref="DataGridViewCellEventArgs"/> instance containing the event data.</param>
  220. private void dataGridViewConsentSelectResult_CellDoubleClick(object sender, DataGridViewCellEventArgs e) {
  221. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  222. if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  223. // dbs227, 셀 클릭 시 더블클릭 인식되어 작동되는 경우 오류
  224. if (e.RowIndex < 0) {
  225. return;
  226. }
  227. ConsentFormListVO vo = GetCurrentConsentSearchVO(e.RowIndex);
  228. //
  229. if (!consentMain.checkOperationDocument(vo.formCd)) {
  230. return;
  231. }
  232. string electrVisble = ConsentMainControl.SETTING_DATA["ELECTR_CMP"];
  233. if (commandControl.CurrentTargetPatient.VisitType.Equals("O")) {
  234. if (electrVisble.Equals("Y")) {
  235. commandControl.setCompleteSaveButton(true);
  236. }
  237. } else {
  238. if (electrVisble.Equals("Y") && commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03")) {
  239. commandControl.setCompleteSaveButton(true);
  240. } else {
  241. commandControl.setCompleteSaveButton(false);
  242. }
  243. }
  244. //if (commandControl.CurrentTargetPatient.VisitType.Equals("O")) {
  245. // commandControl.setCompleteSaveButton(true);
  246. //} else {
  247. // if (ConsentMainControl.SETTING_DATA["ELECTR_CMP"].Equals("Y") && commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03")) {
  248. // commandControl.setCompleteSaveButton(true);
  249. // } else {
  250. // commandControl.setCompleteSaveButton(false);
  251. // }
  252. //}
  253. //의사가 아닐경우 확인저장 비활성화
  254. //if (!commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03")) {
  255. // commandControl.setCompleteSaveButton(false);
  256. //}
  257. if (vo != null) {
  258. // 선택된 동의서가 현재 보여지고 있는 동의서와 다른 경우, 임시 저장 여부 확인
  259. if (!consentMain.ConsentExecuteInfo["readOnly"].Equals("Y") &&
  260. !string.IsNullOrEmpty(commandControl.CurrentTargetPatient.PatientCode) &&
  261. commandControl.CurrentPreviewConsent != null && !commandControl.CurrentPreviewConsent.formRid.Equals(vo.formRid.ToString()) &&
  262. (commandControl.CurrentPreviewConsent.consentState == string.Empty || commandControl.CurrentPreviewConsent.consentState == "TEMP")) {
  263. // dbs227, 임시저장 팝업 사용 안함
  264. //DialogResult result = MessageBox.Show(string.Format(Properties.Resources.msg_confirm_tempsave)
  265. // , string.Format(Properties.Resources.msg_caption_confirm),
  266. // MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  267. //if (result == DialogResult.Yes) {
  268. // consentMain.TempSave();
  269. //}
  270. }
  271. Cursor currentCursor = this.Cursor;
  272. this.Cursor = Cursors.WaitCursor;
  273. ExecutePreviewWithSelectedConsent(vo);
  274. RunConsentDualView();
  275. commandControl.SetEnableConsentIssueCommands(true);
  276. this.Cursor = currentCursor;
  277. }
  278. }
  279. private void RunConsentDualView() {
  280. if (this.consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  281. if (this.commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  282. commandControl.RunConsentDualView();
  283. }
  284. /// <summary>
  285. /// dataGridViewConsentSelectResult 그리드 셀 마우스 우클릭 이벤트
  286. /// </summary>
  287. /// <param name="sender">The source of the event.</param>
  288. /// <param name="e">The <see cref="DataGridViewCellContextMenuStripNeededEventArgs"/> instance containing the event data.</param>
  289. private void dataGridViewConsentSelectResult_CellContextMenuStripNeeded(object sender, DataGridViewCellContextMenuStripNeededEventArgs e) {
  290. if (e.RowIndex >= 0 && this.dataGridViewConsentSelectResult.Rows[e.RowIndex].Selected == true) {
  291. ContextMenuStrip strip = new ContextMenuStrip();
  292. ToolStripMenuItem setItemAdd = new ToolStripMenuItem();
  293. setItemAdd.Text = "즐겨찾기 추가";
  294. strip.Items.Add(setItemAdd);
  295. setItemAdd.Click += new EventHandler(setItemAdd_Click);
  296. e.ContextMenuStrip = strip;
  297. }
  298. }
  299. /// <summary>
  300. /// 선택된 동의서를 개인SET에 등록
  301. /// </summary>
  302. /// <param name="sender">The source of the event.</param>
  303. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  304. private void setItemAdd_Click(object sender, EventArgs e) {
  305. IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
  306. ConsentCommandCtrl commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  307. if (this.dataGridViewConsentSelectResult.SelectedRows.Count != 0) {
  308. Cursor currentCursor = this.Cursor;
  309. this.Cursor = Cursors.WaitCursor;
  310. try {
  311. ConsentFormListVO vo = GetCurrentConsentSearchVO(this.dataGridViewConsentSelectResult.SelectedRows[0].Index);
  312. // 동의서 SET에 추가하는 웹서비스 호출
  313. hospitalWebService.SetUserFormSetList(commandControl.CurrentEndUser.UserNo, vo.formCd, consentMain.ConsentExecuteInfo["dutinstcd"]);
  314. } catch {
  315. } finally {
  316. this.Cursor = currentCursor;
  317. }
  318. MessageBox.Show(string.Format(Properties.Resources.msg_consent_set_added)
  319. , string.Format(Properties.Resources.msg_caption_confirm), MessageBoxButtons.OK, MessageBoxIcon.Information);
  320. }
  321. }
  322. #endregion
  323. #region 동의서 미리보기
  324. private ConsentFormListVO GetCurrentConsentSearchVO(int rowIndex) {
  325. ConsentFormListVO vo = null;
  326. if (rowIndex < 0) {
  327. return vo;
  328. }
  329. vo = this.dataGridViewConsentSelectResult.Rows[rowIndex].DataBoundItem as ConsentFormListVO;
  330. return vo;
  331. }
  332. private void ExecutePreviewWithSelectedConsent(ConsentFormListVO vo) {
  333. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  334. if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  335. Cursor currentCursor = this.Cursor;
  336. try {
  337. this.Cursor = Cursors.WaitCursor;
  338. commandControl.CurrentPreviewConsent = new PreviewConsent {
  339. formRid = vo.formRid.ToString(),
  340. formGuid = vo.formGuid,
  341. formCd = vo.formCd.ToString(),
  342. FormName = vo.formName,
  343. formPrintName = vo.formPrntNm,
  344. prntCnt = vo.printCnt,
  345. consentMstRid = "-1",
  346. consentState = string.Empty,
  347. consentStateEngnm = string.Empty,
  348. inputId = commandControl.CurrentEndUser.UserNo,
  349. inputNm = commandControl.CurrentEndUser.UserName,
  350. ReissueConsentMstRid = 0,
  351. RewriteConsentMstRid = 0,
  352. ocrtagPrntyn = vo.ocrTagPrntYn,
  353. userDrFlag = vo.userDrFlag,
  354. printOnly = vo.printOnly,
  355. opDiagName = vo.opDiagNm,
  356. opName = vo.opNm,
  357. ocrCode = "",
  358. drOnly = vo.DrOnly,
  359. linkFormCd = vo.linkFormCd
  360. };
  361. consentMain.PatientInfoCtrl.SetConsentDocumentName(vo.formName);
  362. commandControl.PreviewConsent(consentMain);
  363. } catch (Exception e) {
  364. MessageBox.Show(this, e.Message);
  365. consentMain.ClearPreviewConsent(true);
  366. } finally {
  367. this.Cursor = currentCursor;
  368. }
  369. }
  370. #endregion
  371. private void comboBoxConsentType_DrawItem(object sender, DrawItemEventArgs e) {
  372. ComboBox box = sender as ComboBox;
  373. if (box is null)
  374. return;
  375. e.DrawBackground();
  376. if (e.Index >= 0) {
  377. Graphics g = e.Graphics;
  378. using (Brush brush = ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
  379. ? new SolidBrush(SystemColors.Highlight)
  380. : new SolidBrush(e.BackColor)) {
  381. using (Brush textBrush = new SolidBrush(e.ForeColor)) {
  382. g.FillRectangle(brush, e.Bounds);
  383. g.DrawString(((CategoryForDropdownVO[]) box.DataSource)[e.Index].CategoryName,
  384. e.Font,
  385. textBrush,
  386. (float) e.Bounds.X,
  387. (float) (e.Bounds.Y) + 2.34F);
  388. }
  389. }
  390. }
  391. e.DrawFocusRectangle();
  392. }
  393. private void comboBoxConsentType_MeasureItem(object sender, MeasureItemEventArgs e) {
  394. e.ItemHeight = 20;
  395. }
  396. private void comboBoxConsentSubType_DrawItem(object sender, DrawItemEventArgs e) {
  397. ComboBox box = sender as ComboBox;
  398. if (box is null)
  399. return;
  400. e.DrawBackground();
  401. if (e.Index >= 0) {
  402. Graphics g = e.Graphics;
  403. using (Brush brush = ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
  404. ? new SolidBrush(SystemColors.Highlight)
  405. : new SolidBrush(e.BackColor)) {
  406. using (Brush textBrush = new SolidBrush(e.ForeColor)) {
  407. g.FillRectangle(brush, e.Bounds);
  408. g.DrawString(((CategoryForDropdownVO[]) box.DataSource)[e.Index].CategoryName,
  409. e.Font,
  410. textBrush,
  411. (float) e.Bounds.X,
  412. (float) (e.Bounds.Y) + 2.34F);
  413. }
  414. }
  415. }
  416. e.DrawFocusRectangle();
  417. }
  418. private void comboBoxConsentSubType_MeasureItem(object sender, MeasureItemEventArgs e) {
  419. e.ItemHeight = 20;
  420. }
  421. private void dataGridViewConsentSelectResult_Click(object sender, EventArgs e)
  422. {
  423. if (grdClickTimer.Tag.ToString().Equals("run"))
  424. {
  425. grdTimer_Tick(null, null);
  426. dataGridViewConsentSelectResult_DoubleClickProcessor(dataGridViewConsentSelectResult.SelectedRows[0].Index);
  427. }
  428. else
  429. {
  430. grdClickTimer.Start();
  431. grdClickTimer.Tag = "run";
  432. }
  433. }
  434. private void grdTimer_Tick(object sender, EventArgs e)
  435. {
  436. grdClickTimer.Stop();
  437. grdClickTimer.Tag = "stop";
  438. }
  439. /// <summary>
  440. /// dataGridViewConsentSelectResult 그리드 셀 더블클릭 이벤트(더블클릭이 안먹히는 경우에 들어갈 이벤트핸들러)
  441. /// </summary>
  442. /// <param name="sender">The source of the event.</param>
  443. /// <param name="e">The <see cref="DataGridViewCellEventArgs"/> instance containing the event data.</param>
  444. private void dataGridViewConsentSelectResult_DoubleClickProcessor(int row)
  445. {
  446. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  447. if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  448. // dbs227, 셀 클릭 시 더블클릭 인식되어 작동되는 경우 오류
  449. if (row < 0)
  450. {
  451. return;
  452. }
  453. ConsentFormListVO vo = GetCurrentConsentSearchVO(row);
  454. //
  455. if (!consentMain.checkOperationDocument(vo.formCd))
  456. {
  457. return;
  458. }
  459. string electrVisble = ConsentMainControl.SETTING_DATA["ELECTR_CMP"];
  460. if (commandControl.CurrentTargetPatient.VisitType.Equals("O"))
  461. {
  462. if (electrVisble.Equals("Y"))
  463. {
  464. commandControl.setCompleteSaveButton(true);
  465. }
  466. }
  467. else
  468. {
  469. if (electrVisble.Equals("Y") && commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03"))
  470. {
  471. commandControl.setCompleteSaveButton(true);
  472. }
  473. else
  474. {
  475. commandControl.setCompleteSaveButton(false);
  476. }
  477. }
  478. //if (commandControl.CurrentTargetPatient.VisitType.Equals("O")) {
  479. // commandControl.setCompleteSaveButton(true);
  480. //} else {
  481. // if (ConsentMainControl.SETTING_DATA["ELECTR_CMP"].Equals("Y") && commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03")) {
  482. // commandControl.setCompleteSaveButton(true);
  483. // } else {
  484. // commandControl.setCompleteSaveButton(false);
  485. // }
  486. //}
  487. //의사가 아닐경우 확인저장 비활성화
  488. //if (!commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03")) {
  489. // commandControl.setCompleteSaveButton(false);
  490. //}
  491. if (vo != null)
  492. {
  493. // 선택된 동의서가 현재 보여지고 있는 동의서와 다른 경우, 임시 저장 여부 확인
  494. if (!consentMain.ConsentExecuteInfo["readOnly"].Equals("Y") &&
  495. !string.IsNullOrEmpty(commandControl.CurrentTargetPatient.PatientCode) &&
  496. commandControl.CurrentPreviewConsent != null && !commandControl.CurrentPreviewConsent.formRid.Equals(vo.formRid.ToString()) &&
  497. (commandControl.CurrentPreviewConsent.consentState == string.Empty || commandControl.CurrentPreviewConsent.consentState == "TEMP"))
  498. {
  499. // dbs227, 임시저장 팝업 사용 안함
  500. //DialogResult result = MessageBox.Show(string.Format(Properties.Resources.msg_confirm_tempsave)
  501. // , string.Format(Properties.Resources.msg_caption_confirm),
  502. // MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  503. //if (result == DialogResult.Yes) {
  504. // consentMain.TempSave();
  505. //}
  506. }
  507. Cursor currentCursor = this.Cursor;
  508. this.Cursor = Cursors.WaitCursor;
  509. ExecutePreviewWithSelectedConsent(vo);
  510. RunConsentDualView();
  511. commandControl.SetEnableConsentIssueCommands(true);
  512. this.Cursor = currentCursor;
  513. }
  514. }
  515. }
  516. }