/// [설계자]
/// 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)
/// [원본 작성자]
/// 클립소프트 기술부 4팀 이창훈 (chlee@clipsoft.co.kr)
/// [수정 작성자]
/// 클립소프트 기술부 이인희
/// ----------------------------------------------------------------------------------------
/// [HISTORY]
/// 2015-07-30 : 최초작성
/// ----------------------------------------------------------------------------------------
///
public partial class ConsentSelectTabConsentSearch : UserControl
{
private ConsentSvcRef.ConsentSvcSoapClient consentWebService = null;
private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
private IConsentMain consentMain = null;
private ConsentCommandCtrl commandControl = null;
public ConsentSelectTabConsentSearch()
{
InitializeComponent();
}
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();
InitDataGrid();
}
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, "동의서 종류", "FullCategoryName", true, 150);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 고유코드", "FormGuid", false);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 고유RID", "FormRid", false);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "전자서명 여부", "EsignYn", false);
}
#region 동의서 카테고리 바인딩
private void InitComboBoxConsentType()
{
CategoryForDropdownVO[] arrayData = consentWebService.GetCategoryForDropdown("1");
this.comboBoxConsentType.DisplayMember = "CategoryName";
this.comboBoxConsentType.ValueMember = "CategoryId";
this.comboBoxConsentType.DataSource = arrayData;
}
private void comboBoxConsentType_SelectedIndexChanged(object sender, EventArgs e)
{
SetSubConentTypeDataToComboBox();
}
private void SetSubConentTypeDataToComboBox()
{
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);
}
}
private void InitComboBoxConsentSubType(string parentValue)
{
CategoryForDropdownVO[] arrayData = consentWebService.GetCategoryForDropdown(parentValue);
this.comboBoxConsentSubType.DisplayMember = "CategoryName";
this.comboBoxConsentSubType.ValueMember = "CategoryId";
this.comboBoxConsentSubType.DataSource = arrayData;
}
#endregion
#region 동의서 조회하고 그리드 바인딩
private void textBoxConsentSearchKeyWord_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.buttonConsentSelect.PerformClick();
}
}
private void buttonConsentSelect_Click(object sender, EventArgs e)
{
IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
ConsentCommandCtrl commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
consentMain.preParamClean();
GetConsentBySearch();
}
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 + "%";
ConsentBySearchVO[] arrayData = consentWebService.GetConsentBySearch(consentType, keyWord);
if (arrayData == null)
{
return;
}
this.dataGridViewConsentSelectResult.DataSource = new SortableBindingList