123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629 |
- #region Copyright © 2015 CLIPSOFT Co.,Ltd. All Rights Reserved.
- //
- // All rights are reserved. Reproduction or transmission in whole or in part,
- // in any form or by any means, electronic, mechanical or otherwise, is
- // prohibited without the prior written consent of the copyright owner.
- //
- // Filename:ConsentSelectTabConsentSearch.cs
- //
- #endregion
- using System;
- using System.ComponentModel;
- using System.Drawing;
- using System.Windows.Forms;
- using CLIP.eForm.Consent.UI.ConsentSvcRef;
- using CLIP.eForm.Consent.UI.HospitalSvcRef;
- using ConsentVO = CLIP.eForm.Consent.UI.ConsentSvcRef.ConsentVO;
- namespace CLIP.eForm.Consent.UI {
- /// <summary>
- /// 동의서 찾기 탭 클래스
- /// </summary>
- /// <remarks>
- /// <p>[설계자]</p>
- /// <p> 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)</p>
- /// <p>[원본 작성자]</p>
- /// <p> 클립소프트 기술부 4팀 이창훈 (chlee@clipsoft.co.kr)</p>
- /// <p>[수정 작성자]</p>
- /// <p> 클립소프트 기술부 이인희</p>
- /// <p>----------------------------------------------------------------------------------------</p>
- /// <p>[HISTORY]</p>
- /// <p> 2015-07-30 : 최초작성</p>
- /// <p>----------------------------------------------------------------------------------------</p>
- /// </remarks>
- public partial class ConsentSelectTabConsentSearch : UserControl {
- private ConsentSvcRef.ConsentSvcSoapClient consentWebService = null;
- private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
- private IConsentMain consentMain = null;
- private ConsentCommandCtrl commandControl = null;
- Timer grdClickTimer = new Timer();
- public ConsentSelectTabConsentSearch() {
- InitializeComponent();
- grdClickTimer.Interval = 500;
- grdClickTimer.Tag = "stop";
- grdClickTimer.Tick += grdTimer_Tick;
- }
- private void ConsentSelectTabConsentSearch_Load(object sender, EventArgs e) {
- if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime) {
- return;
- }
- consentMain = ConsentMainControl.GetConsentMainInterface(this);
- commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- consentWebService = WebMethodCommon.GetConsentWebService(consentMain.PluginExecuteInfo["consentSvcUrl"]);
- hospitalWebService = WebMethodCommon.GetHospitalWebService(consentMain.PluginExecuteInfo["hospitalSvcUrl"]);
- InitComboBoxConsentType();
- // 동의서 찾기에서 기본 카테고리를 해당 기관으로 기본적으로 설정되게끔 변경
- //comboBoxConsentType.SelectedValue = string.Format("EMA_{0}", consentMain.ConsentExecuteInfo["dutinstcd"]);
- InitDataGrid();
- }
- /// <summary>
- /// 초기 DataGrid 항목 설정
- /// </summary>
- private void InitDataGrid() {
- this.dataGridViewConsentSelectResult.AllowUserToAddRows = false;
- this.dataGridViewConsentSelectResult.CellDoubleClick += new DataGridViewCellEventHandler(dataGridViewConsentSelectResult_CellDoubleClick);
- // 그리드에 표시될 컬럼 목록
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서명", "formName", true, 250);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 코드", "formCd", true, 100);
- // 그리드에 표시되지 않을 목록
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "서식 ID", "formId", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "서식상태", "consentStateDisp", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "OCRTAG 출력여부", "ocrTagYN", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "출력 매수", "prntCnt", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "울력전용", "prntOnly", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "서식 출력명", "formPrintName", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "의사 전용 서식 여부", "DrOnly", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "기관번호", "instCd", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "진료과코드", "clnDeptCd", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "진료과명", "clnDeptNm", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "내원일", "clnDate", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "주치의", "mainDrId", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "병동코드", "wardCd", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "병실코드", "roomCd", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "수술진단명", "opDiagName", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "수술명", "opName", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "수술예약번호", "opRsrvNo", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 고유코드", "consentMstRid", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "작성자 아이디", "createUserId", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "작성자 이름", "createUserName", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "작성 일시", "createDatetime", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "수정자 아이디", "modifyUserId", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "생성자 이름", "modifyUserName", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "OCRTAG", "ocrTag", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "환자번호", "pid", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "ordtype", "ordType", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "cretNo", "cretNo", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "patientName", "patientName", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "consentState", "consentState", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "certUseYn", "certUseYn", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "userDrFlag", "userDrFlag", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "linkFormCd", "linkFormCd", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "jinjeongCd", "jinjeongCd", false);
- //CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "jinjeongCd", "jinjeongCd", false);
- }
- #region 동의서 카테고리 바인딩
- /// <summary>
- /// 초기 동의서 카테고리 바인딩
- /// </summary>
- private void InitComboBoxConsentType() {
- CategoryForDropdownVO[] arrayData = consentWebService.GetCategoryForDropdown(consentMain.ConsentExecuteInfo["dutinstcd"]);
- CategoryForDropdownVO[] mainCategory = new CategoryForDropdownVO[1];
- CategoryForDropdownVO mainItem = new CategoryForDropdownVO();
- mainItem.CategoryId = "F";
- mainItem.CategoryName = "전체";
- mainCategory[0] = mainItem;
- this.comboBoxConsentType.DisplayMember = "CategoryName";
- this.comboBoxConsentType.ValueMember = "CategoryId";
- this.comboBoxConsentType.DataSource = mainCategory;
- // 서브 카테고리 설정
- InitComboBoxConsentSubType(consentMain.ConsentExecuteInfo["dutinstcd"]);
- }
- class MainCategory {
- String CategoryName;
- String CategoryId;
- public MainCategory(String CategoryName, String CategoryId) {
- this.CategoryName = CategoryName;
- this.CategoryId = CategoryId;
- }
- }
- /// <summary>
- /// comboBoxConsentType 콤보 컨트롤 변경 이벤트
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
- private void comboBoxConsentType_SelectedIndexChanged(object sender, EventArgs e) {
- //SetSubConsentTypeDataToComboBox();
- }
- /// <summary>
- /// 동의서 하위 분류 항목 바인딩
- /// </summary>
- private void SetSubConsentTypeDataToComboBox() {
- string comboBoxConsentTypeValue = comboBoxConsentType.SelectedValue.ToString();
- // 전체 선택
- if (comboBoxConsentTypeValue.Equals("CATE_ALL")) {
- this.comboBoxConsentSubType.DataSource = null;
- this.comboBoxConsentSubType.Enabled = false;
- } else {
- this.comboBoxConsentSubType.Enabled = true;
- InitComboBoxConsentSubType(comboBoxConsentTypeValue);
- }
- }
- /// <summary>
- /// 동의서 하위 분류 조회 및 바인딩
- /// </summary>
- /// <param name="parentValue">The parent value.</param>
- private void InitComboBoxConsentSubType(string parentValue) {
- // 주어진 parentValue 로 GetCategoryForDropdown API 호출
- CategoryForDropdownVO[] arrayData = consentWebService.GetCategoryForDropdown(parentValue);
- this.comboBoxConsentSubType.DisplayMember = "CategoryName";
- this.comboBoxConsentSubType.ValueMember = "CategoryId";
- this.comboBoxConsentSubType.DataSource = arrayData;
- }
- #endregion
- #region 동의서 조회하고 그리드 바인딩
- /// <summary>
- /// textBoxConsentSearchKeyWord 키보드 입력 이벤트
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="KeyEventArgs"/> instance containing the event data.</param>
- private void textBoxConsentSearchKeyWord_KeyDown(object sender, KeyEventArgs e) {
- // 엔터키 입력 시 조회 버튼 클릭 이벤트 수행
- if (e.KeyCode == Keys.Enter) {
- this.buttonConsentSelect.PerformClick();
- }
- }
- /// <summary>
- /// 조회 버튼 클릭 이벤트
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
- private void buttonConsentSelect_Click(object sender, EventArgs e) {
- buttonConsentSelect.Enabled = false;
- Application.DoEvents();
- IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
- ConsentCommandCtrl commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- consentMain.preParamClean();
- GetConsentBySearch();
- buttonConsentSelect.Enabled = true;
- }
- /// <summary>
- /// 동의서 검색
- /// </summary>
- private void GetConsentBySearch() {
- Cursor currentCursor = this.Cursor;
- try {
- this.Cursor = Cursors.WaitCursor;
- string consentType = string.Empty;
- // 부서명이 선택되어 있지 않으면 근무지기관코드로 검색
- if (this.comboBoxConsentSubType.SelectedValue == null) {
- consentType = this.comboBoxConsentType.SelectedValue.ToString();
- }
- // 부서명이 선택되어 있으면 부서명으로 검색
- else {
- consentType = this.comboBoxConsentSubType.SelectedValue.ToString();
- }
- string keyWord = string.Empty;
- keyWord = "%" + this.textBoxConsentSearchKeyWord.Text + "%";
- if ((consentType.Equals("EMA_031") || consentType.Equals("EMA_032")) && keyWord.Trim().Equals("%%")) {
- MessageBox.Show("과 또는 검색어를 입력해주세요.");
- return;
- }
- ConsentVO[] arrayData = consentWebService.GetConsentBySearch(consentType, keyWord, consentMain.ConsentExecuteInfo["dutinstcd"]);
- if (arrayData == null) {
- return;
- }
- this.dataGridViewConsentSelectResult.DataSource = new SortableBindingList<ConsentSvcRef.ConsentVO>(arrayData);
- } catch (Exception ex) {
- throw ex;
- } finally {
- this.Cursor = currentCursor;
- }
- }
- #endregion
- #region 그리드 이벤트
- /// <summary>
- /// dataGridViewConsentSelectResult 그리드 셀 더블클릭 이벤트
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="DataGridViewCellEventArgs"/> instance containing the event data.</param>
- private void dataGridViewConsentSelectResult_CellDoubleClick(object sender, DataGridViewCellEventArgs e) {
- if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- // dbs227, 셀 클릭 시 더블클릭 인식되어 작동되는 경우 오류
- if (e.RowIndex < 0) {
- return;
- }
- ConsentVO vo = GetCurrentConsentSearchVO(e.RowIndex);
- //
- if (!consentMain.checkOperationDocument(vo.formCd)) {
- return;
- }
- string electrVisble = ConsentMainControl.SETTING_DATA["ELECTR_CMP"];
- if (commandControl.CurrentTargetPatient.VisitType.Equals("O")) {
- if (electrVisble.Equals("Y")) {
- commandControl.setCompleteSaveButton(true);
- }
- } else {
- if (electrVisble.Equals("Y") && commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03")) {
- commandControl.setCompleteSaveButton(true);
- } else {
- commandControl.setCompleteSaveButton(false);
- }
- }
- //if (commandControl.CurrentTargetPatient.VisitType.Equals("O")) {
- // commandControl.setCompleteSaveButton(true);
- //} else {
- // if (ConsentMainControl.SETTING_DATA["ELECTR_CMP"].Equals("Y") && commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03")) {
- // commandControl.setCompleteSaveButton(true);
- // } else {
- // commandControl.setCompleteSaveButton(false);
- // }
- //}
- //의사가 아닐경우 확인저장 비활성화
- //if (!commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03")) {
- // commandControl.setCompleteSaveButton(false);
- //}
- if (vo != null) {
- // 선택된 동의서가 현재 보여지고 있는 동의서와 다른 경우, 임시 저장 여부 확인
- if (!consentMain.ConsentExecuteInfo["readOnly"].Equals("Y") &&
- !string.IsNullOrEmpty(commandControl.CurrentTargetPatient.PatientCode) &&
- commandControl.CurrentPreviewConsent != null && !commandControl.CurrentPreviewConsent.formId.Equals(vo.formId.ToString()) &&
- (commandControl.CurrentPreviewConsent.consentState == string.Empty || commandControl.CurrentPreviewConsent.consentState == "TEMP")) {
- // dbs227, 임시저장 팝업 사용 안함
- //DialogResult result = MessageBox.Show(string.Format(Properties.Resources.msg_confirm_tempsave)
- // , string.Format(Properties.Resources.msg_caption_confirm),
- // MessageBoxButtons.YesNo, MessageBoxIcon.Information);
- //if (result == DialogResult.Yes) {
- // consentMain.TempSave();
- //}
- }
- Cursor currentCursor = this.Cursor;
- this.Cursor = Cursors.WaitCursor;
- ExecutePreviewWithSelectedConsent(vo);
- RunConsentDualView();
- commandControl.SetEnableConsentIssueCommands(true);
- this.Cursor = currentCursor;
- }
- }
- private void RunConsentDualView() {
- if (this.consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- if (this.commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- commandControl.RunConsentDualView();
- }
- /// <summary>
- /// dataGridViewConsentSelectResult 그리드 셀 마우스 우클릭 이벤트
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="DataGridViewCellContextMenuStripNeededEventArgs"/> instance containing the event data.</param>
- private void dataGridViewConsentSelectResult_CellContextMenuStripNeeded(object sender, DataGridViewCellContextMenuStripNeededEventArgs e) {
- if (e.RowIndex >= 0 && this.dataGridViewConsentSelectResult.Rows[e.RowIndex].Selected == true) {
- ContextMenuStrip strip = new ContextMenuStrip();
- ToolStripMenuItem setItemAdd = new ToolStripMenuItem();
- setItemAdd.Text = "즐겨찾기 추가";
- strip.Items.Add(setItemAdd);
- setItemAdd.Click += new EventHandler(setItemAdd_Click);
- e.ContextMenuStrip = strip;
- }
- }
- /// <summary>
- /// 선택된 동의서를 개인SET에 등록
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
- private void setItemAdd_Click(object sender, EventArgs e) {
- IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
- ConsentCommandCtrl commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- if (this.dataGridViewConsentSelectResult.SelectedRows.Count != 0) {
- Cursor currentCursor = this.Cursor;
- this.Cursor = Cursors.WaitCursor;
- try {
- ConsentVO vo = GetCurrentConsentSearchVO(this.dataGridViewConsentSelectResult.SelectedRows[0].Index);
- // 동의서 SET에 추가하는 웹서비스 호출
- hospitalWebService.SetUserFormSetList(commandControl.CurrentEndUser.UserNo, vo.formCd, consentMain.ConsentExecuteInfo["dutinstcd"]);
- } catch {
- } finally {
- this.Cursor = currentCursor;
- }
- MessageBox.Show(string.Format(Properties.Resources.msg_consent_set_added)
- , string.Format(Properties.Resources.msg_caption_confirm), MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- #endregion
- #region 동의서 미리보기
- private ConsentVO GetCurrentConsentSearchVO(int rowIndex) {
- ConsentVO vo = null;
- if (rowIndex < 0) {
- return vo;
- }
- vo = this.dataGridViewConsentSelectResult.Rows[rowIndex].DataBoundItem as ConsentVO;
- return vo;
- }
- private void ExecutePreviewWithSelectedConsent(ConsentVO vo) {
- if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- Cursor currentCursor = this.Cursor;
- try {
- this.Cursor = Cursors.WaitCursor;
- commandControl.CurrentPreviewConsent = new PreviewConsent {
- formId = vo.formId.ToString(),
- formCd = vo.formCd.ToString(),
- formName = vo.formName,
- formPrintName = vo.formPrintName,
- prntCnt = vo.prntCnt,
- consentMstRid = "-1",
- consentState = string.Empty,
- consentStateEng = string.Empty,
- inputId = commandControl.CurrentEndUser.UserNo,
- inputNm = commandControl.CurrentEndUser.UserName,
- ReissueConsentMstRid = 0,
- RewriteConsentMstRid = 0,
- ocrtagPrntyn = vo.ocrTagYN,
- userDrFlag = vo.userDrFlag,
- printOnly = vo.prntOnly,
- opDiagName = vo.opDiagName,
- opName = vo.opName,
- ocrCode = "",
- drOnly = vo.DrOnly,
- linkFormCd = vo.linkFormCd
- };
- consentMain.PatientInfoCtrl.SetConsentDocumentName(vo.formName);
- commandControl.PreviewConsent(consentMain);
- } catch (Exception e) {
- MessageBox.Show(this, e.Message);
- consentMain.ClearPreviewConsent(true);
- } finally {
- this.Cursor = currentCursor;
- }
- }
- #endregion
- private void comboBoxConsentType_DrawItem(object sender, DrawItemEventArgs e) {
- ComboBox box = sender as ComboBox;
- if (box is null)
- return;
- e.DrawBackground();
- if (e.Index >= 0) {
- Graphics g = e.Graphics;
- using (Brush brush = ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
- ? new SolidBrush(SystemColors.Highlight)
- : new SolidBrush(e.BackColor)) {
- using (Brush textBrush = new SolidBrush(e.ForeColor)) {
- g.FillRectangle(brush, e.Bounds);
- g.DrawString(((CategoryForDropdownVO[]) box.DataSource)[e.Index].CategoryName,
- e.Font,
- textBrush,
- (float) e.Bounds.X,
- (float) (e.Bounds.Y) + 2.34F);
- }
- }
- }
- e.DrawFocusRectangle();
- }
- private void comboBoxConsentType_MeasureItem(object sender, MeasureItemEventArgs e) {
- e.ItemHeight = 20;
- }
- private void comboBoxConsentSubType_DrawItem(object sender, DrawItemEventArgs e) {
- ComboBox box = sender as ComboBox;
- if (box is null)
- return;
- e.DrawBackground();
- if (e.Index >= 0) {
- Graphics g = e.Graphics;
- using (Brush brush = ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
- ? new SolidBrush(SystemColors.Highlight)
- : new SolidBrush(e.BackColor)) {
- using (Brush textBrush = new SolidBrush(e.ForeColor)) {
- g.FillRectangle(brush, e.Bounds);
- g.DrawString(((CategoryForDropdownVO[]) box.DataSource)[e.Index].CategoryName,
- e.Font,
- textBrush,
- (float) e.Bounds.X,
- (float) (e.Bounds.Y) + 2.34F);
- }
- }
- }
- e.DrawFocusRectangle();
- }
- private void comboBoxConsentSubType_MeasureItem(object sender, MeasureItemEventArgs e) {
- e.ItemHeight = 20;
- }
- private void dataGridViewConsentSelectResult_Click(object sender, EventArgs e)
- {
- if (grdClickTimer.Tag.ToString().Equals("run"))
- {
- grdTimer_Tick(null, null);
- dataGridViewConsentSelectResult_DoubleClickProcessor(dataGridViewConsentSelectResult.SelectedRows[0].Index);
- }
- else
- {
- grdClickTimer.Start();
- grdClickTimer.Tag = "run";
- }
- }
- private void grdTimer_Tick(object sender, EventArgs e)
- {
- grdClickTimer.Stop();
- grdClickTimer.Tag = "stop";
- }
- /// <summary>
- /// dataGridViewConsentSelectResult 그리드 셀 더블클릭 이벤트(더블클릭이 안먹히는 경우에 들어갈 이벤트핸들러)
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="DataGridViewCellEventArgs"/> instance containing the event data.</param>
- private void dataGridViewConsentSelectResult_DoubleClickProcessor(int row)
- {
- if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- // dbs227, 셀 클릭 시 더블클릭 인식되어 작동되는 경우 오류
- if (row < 0)
- {
- return;
- }
- ConsentVO vo = GetCurrentConsentSearchVO(row);
- //
- if (!consentMain.checkOperationDocument(vo.formCd))
- {
- return;
- }
- string electrVisble = ConsentMainControl.SETTING_DATA["ELECTR_CMP"];
- if (commandControl.CurrentTargetPatient.VisitType.Equals("O"))
- {
- if (electrVisble.Equals("Y"))
- {
- commandControl.setCompleteSaveButton(true);
- }
- }
- else
- {
- if (electrVisble.Equals("Y") && commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03"))
- {
- commandControl.setCompleteSaveButton(true);
- }
- else
- {
- commandControl.setCompleteSaveButton(false);
- }
- }
- //if (commandControl.CurrentTargetPatient.VisitType.Equals("O")) {
- // commandControl.setCompleteSaveButton(true);
- //} else {
- // if (ConsentMainControl.SETTING_DATA["ELECTR_CMP"].Equals("Y") && commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03")) {
- // commandControl.setCompleteSaveButton(true);
- // } else {
- // commandControl.setCompleteSaveButton(false);
- // }
- //}
- //의사가 아닐경우 확인저장 비활성화
- //if (!commandControl.CurrentEndUser.JobKindCd.Substring(0, 2).Equals("03")) {
- // commandControl.setCompleteSaveButton(false);
- //}
- if (vo != null)
- {
- // 선택된 동의서가 현재 보여지고 있는 동의서와 다른 경우, 임시 저장 여부 확인
- if (!consentMain.ConsentExecuteInfo["readOnly"].Equals("Y") &&
- !string.IsNullOrEmpty(commandControl.CurrentTargetPatient.PatientCode) &&
- commandControl.CurrentPreviewConsent != null && !commandControl.CurrentPreviewConsent.formId.Equals(vo.formId.ToString()) &&
- (commandControl.CurrentPreviewConsent.consentState == string.Empty || commandControl.CurrentPreviewConsent.consentState == "TEMP"))
- {
- // dbs227, 임시저장 팝업 사용 안함
- //DialogResult result = MessageBox.Show(string.Format(Properties.Resources.msg_confirm_tempsave)
- // , string.Format(Properties.Resources.msg_caption_confirm),
- // MessageBoxButtons.YesNo, MessageBoxIcon.Information);
- //if (result == DialogResult.Yes) {
- // consentMain.TempSave();
- //}
- }
- Cursor currentCursor = this.Cursor;
- this.Cursor = Cursors.WaitCursor;
- ExecutePreviewWithSelectedConsent(vo);
- RunConsentDualView();
- commandControl.SetEnableConsentIssueCommands(true);
- this.Cursor = currentCursor;
- }
- }
- }
- }
|