ConsentListCtrl.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. using System;
  2. using System.ComponentModel;
  3. namespace CLIP.eForm.Consent.UI {
  4. /// <summary>
  5. /// 동의서 목록 클래스
  6. /// </summary>
  7. /// <remarks>
  8. /// <p>[설계자]</p>
  9. /// <p> 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)</p>
  10. /// <p>[원본 작성자]</p>
  11. /// <p> 클립소프트 기술부 이창훈 (chlee@clipsoft.co.kr)</p>
  12. /// <p>[수정 작성자]</p>
  13. /// <p> 클립소프트 기술부 이인희</p>
  14. /// <p>----------------------------------------------------------------------------------------</p>
  15. /// <p>[HISTORY]</p>
  16. /// <p> 2016-06-21 : 최초작성</p>
  17. /// <p>----------------------------------------------------------------------------------------</p>
  18. /// </remarks>
  19. public partial class ConsentListCtrl : ConsentListCtrlBase {
  20. private IConsentMain consentMain = null;
  21. private ConsentCommandCtrl commandControl = null;
  22. public ConsentListCtrl() {
  23. InitializeComponent();
  24. }
  25. protected override void OnLoad(EventArgs e) {
  26. base.OnLoad(e);
  27. if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime) {
  28. return;
  29. }
  30. consentMain = ConsentMainControl.GetConsentMainInterface(this);
  31. commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  32. consentMain.OnLoadPartControls += ConsentMain_OnLoadPartControls;
  33. // dbs227, 임시 탭 삭제
  34. // knuh dependency
  35. tabControlConsentSelect.TabPages.RemoveAt(1);
  36. }
  37. private void ConsentMain_OnLoadPartControls(object sender, EventArgs e) {
  38. if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime) {
  39. return;
  40. }
  41. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  42. if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
  43. // Ku2.0 연동 시에는 이벤트 태우지 않음
  44. if (consentMain.ConsentExecuteInfo["printYN"].Equals("Y")) {
  45. return;
  46. }
  47. SetConsentListSplitPanelVisibility(consentMain);
  48. // dbs227, 기본탭 변경
  49. this.tabControlConsentSelect.SelectedTab = this.tabControlConsentSelect.TabPages["tabPageAll"];
  50. //this.tabControlConsentSelect.SelectedTab = this.tabControlConsentSelect.TabPages["tabPageUnfinished"];
  51. }
  52. /// <summary>
  53. /// 동의서목록 탭 보이기 여부
  54. /// </summary>
  55. /// <param name="consentMain">The consent main.</param>
  56. private static void SetConsentListSplitPanelVisibility(IConsentMain consentMain) {
  57. if (!(string.IsNullOrEmpty(consentMain.ConsentExecuteInfo["enableConsentList"])) && consentMain.ConsentExecuteInfo["enableConsentList"].Equals("Y")) {
  58. consentMain.SetConsentListSplitPanelVisibility(true);
  59. } else {
  60. consentMain.SetConsentListSplitPanelVisibility(false);
  61. }
  62. }
  63. /// <summary>
  64. /// tabControlConsentSelect 컨트롤의 SelectedIndexChanged 이벤트 핸들러
  65. /// </summary>
  66. /// <param name="sender">The source of the event.</param>
  67. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  68. private void tabControlConsentSelect_SelectedIndexChanged(object sender, EventArgs e) {
  69. // 탭이 선택될때 재조회해서 그리드 바인딩
  70. if (tabControlConsentSelect.SelectedIndex == 0) {
  71. if (this.tabControlConsentSelect.TabPages["tabPageAll"].Controls.Count > 0) {
  72. ConsentSelectTabPageAll consentSelectTabPageAll = this.tabControlConsentSelect.TabPages["tabPageAll"].Controls[0] as ConsentSelectTabPageAll;
  73. consentSelectTabPageAll.InitDataGrid();
  74. consentSelectTabPageAll.BindDataGridRows();
  75. }
  76. }
  77. // if (tabControlConsentSelect.SelectedIndex == 1) {
  78. // if (this.tabControlConsentSelect.TabPages["tabPageUnfinished"].Controls.Count > 0) {
  79. // ConsentSelectTabPageUnfinished consentSelectTabPageUnfinished = this.tabControlConsentSelect.TabPages["tabPageUnfinished"].Controls[0] as ConsentSelectTabPageUnfinished;
  80. //consentSelectTabPageUnfinished.BindDataGridRows(-1);
  81. //}
  82. //} else
  83. // 즐겨찾기 탭 선택 시 즐겨찾기 목록 갱신한다.
  84. if (tabControlConsentSelect.SelectedIndex == 1) {
  85. if (this.tabControlConsentSelect.TabPages["tabPageConsentSet"].Controls.Count > 0) {
  86. ConsentSelectTabPageConsentSet consentSelectTabPageConsentSet = this.tabControlConsentSelect.TabPages["tabPageConsentSet"].Controls[0] as ConsentSelectTabPageConsentSet;
  87. consentSelectTabPageConsentSet.InitConsentSetTreeView();
  88. }
  89. }
  90. consentMain.ReInitializeViewer();
  91. //consentMain.ClearConsent();
  92. //if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  93. //consentMain.ClearConsent();
  94. }
  95. //환자목록에서 더블클릭했을 경우, 선택된 환자 정보로 상단정보를 재조회한다.
  96. public override void OnRefeashPartControls() {
  97. if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
  98. consentMain.ReInitializeViewer();
  99. // dbs227, 임시 탭 삭제
  100. // knuh dependency
  101. //pageMove_tabPageConsentUnfinished(consentMain); //미작성 탭을 기본으로 선택
  102. SetConsentListSplitPanelVisibility(consentMain);
  103. }
  104. // 동의서 목록 재조회 (미작성 동의서 삭제, 임시저장용 재조회, 인쇄출력용 재조회, 저장용(저장후 닫힘이 아닌 경우))
  105. public override void InquiryConsentData(int consentMstRid) {
  106. if (consentMstRid > 0) {
  107. // dbs227 임시 탭 삭제
  108. // knuh dependency
  109. this.tabControlConsentSelect.SelectedIndex = 0;
  110. ConsentSelectTabPageAll consentSelectTabPageAll = this.tabControlConsentSelect.TabPages["tabPageAll"].Controls[0] as ConsentSelectTabPageAll;
  111. consentSelectTabPageAll.BindDataGridRows();
  112. // -- 기존 루틴
  113. //this.tabControlConsentSelect.SelectedIndex = 1;
  114. //ConsentSelectTabPageUnfinished consentSelectTabPageUnfinished = this.tabControlConsentSelect.TabPages["tabPageUnfinished"].Controls[0] as ConsentSelectTabPageUnfinished;
  115. //consentSelectTabPageUnfinished.SelectAllUnfinishedConsents(consentMstRid);
  116. } else {
  117. if (this.tabControlConsentSelect.SelectedIndex != 0) {
  118. this.tabControlConsentSelect.SelectedIndex = 0;
  119. } else {
  120. ConsentSelectTabPageAll consentSelectTabPageAll = this.tabControlConsentSelect.TabPages["tabPageAll"].Controls[0] as ConsentSelectTabPageAll;
  121. consentSelectTabPageAll.InitDataGrid();
  122. consentSelectTabPageAll.BindDataGridRows();
  123. }
  124. }
  125. // 기저 클래스의 매서드는 아무 동작을 하지 않는다
  126. base.InquiryConsentData(-1);
  127. }
  128. /// <summary>
  129. /// 발행리스트 탭 갱신, dbs227, 경대병원 dependency
  130. /// </summary>
  131. public override void consentSelectTabPageAllRefresh() {
  132. ConsentSelectTabPageAll consentSelectTabPageAll = this.tabControlConsentSelect.TabPages["tabPageAll"].Controls[0] as ConsentSelectTabPageAll;
  133. consentSelectTabPageAll.BindDataGridRows();
  134. }
  135. // 미작성 탭으로 이동
  136. public override void pageMove_tabPageConsentUnfinished(IConsentMain consentMain) {
  137. if (this.tabControlConsentSelect.TabPages["tabPageUnfinished"].Controls.Count > 0) {
  138. this.tabControlConsentSelect.SelectedTab = this.tabControlConsentSelect.TabPages["tabPageUnfinished"];
  139. ConsentSelectTabPageUnfinished consentSelectTabPageUnfinished = this.tabControlConsentSelect.TabPages["tabPageUnfinished"].Controls[0] as ConsentSelectTabPageUnfinished;
  140. consentSelectTabPageUnfinished.BindDataGridRows(-1);
  141. }
  142. ConsentSelectTabPageAll consentSelectTabPageAll = this.tabControlConsentSelect.TabPages["tabPageAll"].Controls[0] as ConsentSelectTabPageAll;
  143. consentSelectTabPageAll.clearSearchStartDate();
  144. }
  145. }
  146. }