123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- using System;
- using System.Windows.Forms;
- using System.ComponentModel;
- namespace CLIP.eForm.Consent.Dfh.UI
- {
- /// <summary>
- /// 동의서 목록 클래스
- /// </summary>
- /// <remarks>
- /// <p>[설계자]</p>
- /// <p> 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)</p>
- /// <p>[원본 작성자]</p>
- /// <p> 클립소프트 기술부 이창훈 (chlee@clipsoft.co.kr)</p>
- /// <p>[수정 작성자]</p>
- /// <p> 클립소프트 기술부 이인희</p>
- /// <p>----------------------------------------------------------------------------------------</p>
- /// <p>[HISTORY]</p>
- /// <p> 2016-06-21 : 최초작성</p>
- /// <p>----------------------------------------------------------------------------------------</p>
- /// </remarks>
- public partial class ConsentListCtrl : ConsentListCtrlBase
- {
- private IConsentMain consentMain = null;
- private ConsentCommandCtrl commandControl = null;
- public ConsentListCtrl()
- {
- InitializeComponent();
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime)
- {
- return;
- }
- consentMain = ConsentMainControl.GetConsentMainInterface(this);
- commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- consentMain.OnLoadPartControls += ConsentMain_OnLoadPartControls;
- }
- //시작하면 어느탭부터 보여줄지
- private void ConsentMain_OnLoadPartControls(object sender, EventArgs e)
- {
- if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime)
- {
- return;
- }
-
- if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- string tempvalue = "tabPageUnfinished";
- SetConsentListSplitPanelVisibility(consentMain);
-
- if (commandControl.CurrentEndUser != null) {
- if (!commandControl.CurrentEndUser.DeptCode.Substring(0,5).Equals("20108")
- && consentMain.ConsentExecuteInfo["printAct"] != null
- && !consentMain.ConsentExecuteInfo["printAct"].Equals("Y"))
- {
- tempvalue = "tabPageConsentSet";
- }
- }
- this.tabControlConsentSelect.SelectedTab = this.tabControlConsentSelect.TabPages[tempvalue];
- }
- // 동의서목록 탭 보이기 여부
- private static void SetConsentListSplitPanelVisibility(IConsentMain consentMain)
- {
- if (!(string.IsNullOrEmpty(consentMain.ConsentExecuteInfo["useListView"])) && consentMain.ConsentExecuteInfo["useListView"].Equals("Y"))
- {
- consentMain.SetConsentListSplitPanelVisibility(true);
- }
- else
- {
- consentMain.SetConsentListSplitPanelVisibility(false);
- }
- }
- private void tabControlConsentSelect_SelectedIndexChanged(object sender, EventArgs e)
- {
- // 탭이 선택될때 재조회해서 그리드 바인딩
- if (tabControlConsentSelect.SelectedIndex == 0)
- {
- if (this.tabControlConsentSelect.TabPages["tabPageAll"].Controls.Count > 0)
- {
- ConsentSelectTabPageAll consentSelectTabPageAll = this.tabControlConsentSelect.TabPages["tabPageAll"].Controls[0] as ConsentSelectTabPageAll;
- consentSelectTabPageAll.BindDataGridRows();
- }
- }
- else if (tabControlConsentSelect.SelectedIndex == 1)
- {
- if (this.tabControlConsentSelect.TabPages["tabPageUnfinished"].Controls.Count > 0)
- {
- ConsentSelectTabPageUnfinished consentSelectTabPageUnfinished = this.tabControlConsentSelect.TabPages["tabPageUnfinished"].Controls[0] as ConsentSelectTabPageUnfinished;
- consentSelectTabPageUnfinished.BindDataGridRows(-1);
- }
- }
- else if (tabControlConsentSelect.SelectedIndex == 2)
- {
- if (this.tabControlConsentSelect.TabPages["tabPageConsentSet"].Controls.Count > 0)
- {
- ConsentSelectTabPageConsentSet consentSelectTabPageConsentSet = this.tabControlConsentSelect.TabPages["tabPageConsentSet"].Controls[0] as ConsentSelectTabPageConsentSet;
- consentSelectTabPageConsentSet.InitConsentSetTreeView();
- }
- }
- //if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- //consentMain.ClearConsent();
- }
- //환자목록에서 더블클릭했을 경우, 선택된 환자 정보로 상단정보를 재조회한다.
- public override void OnRefeashPartControls()
- {
- if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- consentMain.ReInitializeViewer();
- //pageMove_tabPageConsentUnfinished(consentMain); //미작성 탭을 기본으로 선택
- SetConsentListSplitPanelVisibility(consentMain);
- }
- // 동의서 목록 재조회 (미작성 동의서 삭제, 임시저장용 재조회, 인쇄출력용 재조회, 저장용(저장후 닫힘이 아닌 경우)
- public override void InquiryConsentData(int consentMstRid)
- {
- if (consentMstRid > 0)
- {
- this.tabControlConsentSelect.SelectedIndex = 1;
- ConsentSelectTabPageUnfinished consentSelectTabPageUnfinished = this.tabControlConsentSelect.TabPages["tabPageUnfinished"].Controls[0] as ConsentSelectTabPageUnfinished;
- consentSelectTabPageUnfinished.SelectAllUnfinishedConsents(consentMstRid);
- }
- else
- {
- // 즐겨찾기에서 출력했을 경우 이력탭으로 조회되지 않고 그대로 남아있도록 처리
- if (!(consentMstRid == -2 && tabControlConsentSelect.SelectedIndex == 2))
- {
- //동의서 출력후 아무곳으로도 이동되지 않도록
- //this.tabControlConsentSelect.SelectedIndex = 0;
-
- //ConsentSelectTabPageAll consentSelectTabPageAll = this.tabControlConsentSelect.TabPages["tabPageAll"].Controls[0] as ConsentSelectTabPageAll;
- //consentSelectTabPageAll.BindDataGridRows();
- }
- }
- base.InquiryConsentData(-1);
- }
- // 미작성 탭으로 이동
- public override void pageMove_tabPageConsentUnfinished(IConsentMain consentMain)
- {
- if (this.tabControlConsentSelect.TabPages["tabPageUnfinished"].Controls.Count > 0)
- {
- this.tabControlConsentSelect.SelectedTab = this.tabControlConsentSelect.TabPages["tabPageUnfinished"];
- ConsentSelectTabPageUnfinished consentSelectTabPageUnfinished = this.tabControlConsentSelect.TabPages["tabPageUnfinished"].Controls[0] as ConsentSelectTabPageUnfinished;
- consentSelectTabPageUnfinished.BindDataGridRows(-1);
- }
- ConsentSelectTabPageAll consentSelectTabPageAll = this.tabControlConsentSelect.TabPages["tabPageAll"].Controls[0] as ConsentSelectTabPageAll;
- consentSelectTabPageAll.clearSearchStartDate();
- }
- }
- }
|