private void FindData(SAPbouiCOM.Form oForm) { //ADD YOUR ACTION CODE HERE ... SAPbouiCOM.Grid oGrid; string strDocEntry = string.Empty; string strPAPERTP = string.Empty; string strCENTCD_FR = string.Empty; string strCENTCD_TO = string.Empty; //string strPERSON = string.Empty; try { oForm.Freeze(true); oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0400T_HRD"); strDocEntry = oDB_M.GetValue("DocEntry", 0).Trim(); strDocEntry = (strDocEntry == "" ? "0" : strDocEntry); oUDS = oForm.DataSources.UserDataSources; strPAPERTP = oUDS.Item("cboPAPERTP").ValueEx; strCENTCD_FR = oUDS.Item("edtCENTCD1").ValueEx; strCENTCD_TO = oUDS.Item("edtCENTCD2").ValueEx; //strPERSON = oUDS.Item("edtPERSON").ValueEx; StringBuilder sb = new StringBuilder(); //조회 sb.AppendLine(" SELECT CONVERT(VARCHAR(10), ROW_NUMBER() OVER(ORDER BY LineId)) AS SEQ "); sb.AppendLine(" , LineId "); sb.AppendLine(" , U_PAPERTP "); sb.AppendLine(" , U_CENTCD "); sb.AppendLine(" , U_CENTNM "); sb.AppendLine(" , U_BASEPAY "); sb.AppendLine(" , U_BEFOPAY "); sb.AppendLine(" , U_BEFOETC "); sb.AppendLine(" , U_PAYADJT "); sb.AppendLine(" , U_ETCADJT "); sb.AppendLine(" , U_SPOTPAY "); sb.AppendLine(" , U_SPOTETC "); sb.AppendLine(" , U_PAPEAMT "); sb.AppendLine(" , U_SAVEAMT "); sb.AppendLine(" , U_PRICE "); sb.AppendLine(" , '' AS STATUS "); sb.AppendLine(" FROM [@KIS_SO04001_HRD] "); sb.AppendLine(" WHERE DocEntry = {0} "); if (string.IsNullOrEmpty(strCENTCD_FR) == false && string.IsNullOrEmpty(strCENTCD_TO) == false) sb.AppendLine(" AND U_CENTCD BETWEEN '{1}' AND '{2}' "); if (string.IsNullOrEmpty(strPAPERTP) == false) sb.AppendLine(" AND U_PAPERTP = '{3}' "); B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oForm.DataSources.DataTables.Item("grd").ExecuteQuery(string.Format(sb.ToString(), strDocEntry, strCENTCD_FR, strCENTCD_TO, strPAPERTP)); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제 if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("U_CENTCD", 0).ToString() == null || oGrid.DataTable.GetValue("U_CENTCD", 0).ToString() == "")) { FN.SetGridTitle(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable)); } else { FN.SetGrdColumnNumber(ref oGrid, "", GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight), "", ""); //1. 지종 FN.SetComboBoxValidValues(oGrid, "U_PAPERTP", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO01' ", FN.Enum_WholeTp.m_Nothing); // 지국 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "U_CENTCD", BoLinkedObject.lf_BusinessPartner); FN.BindGrid(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , "" , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight)); //FN.SetColoumnColor(oForm, "grd3", "#E0ECF8", "ETAX_YN,DTINO,DTSTAT"); //그리드 BG 기본색(#E6E6FA) FN.SetSumField(ref oGrid, "U_BASEPAY,U_BEFOPAY,U_BEFOETC,U_SPOTPAY,U_SPOTETC,U_PAYADJT,U_ETCADJT,U_PAPEAMT,U_SAVEAMT"); oGrid.RowHeaders.Width = 0; oGrid.AutoResizeColumns(); } if (oForm.Mode != BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_OK_MODE; SetItemEnabled(oForm); } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_btnFind_AFItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oForm.Refresh(); } }
private void FindData(SAPbouiCOM.Form oForm) { //ADD YOUR ACTION CODE HERE ... SAPbouiCOM.Grid oGrid; string strDocEntry = string.Empty; string strCENTCD_FR = string.Empty; string strCENTCD_TO = string.Empty; string strAREA = string.Empty; try { oForm.Freeze(true); oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0310T_HRD"); strDocEntry = oDB_M.GetValue("DocEntry", 0).Trim(); strDocEntry = (strDocEntry == "" ? "0" : strDocEntry); oUDS = oForm.DataSources.UserDataSources; strCENTCD_FR = oUDS.Item("edtCENTCD1").ValueEx; strCENTCD_TO = oUDS.Item("edtCENTCD2").ValueEx; strAREA = oUDS.Item("cboAREA").ValueEx; //조회 string xSQL = string.Format(" EXEC KIS_SP_SO0310F1_HRD @pDOCENTRY = {0}, @pAREA = '{1}', @pCENTCD_FR = '{2}', @pCENTCD_TO = '{3}' ", strDocEntry, strAREA, strCENTCD_FR, strCENTCD_TO); B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oForm.DataSources.DataTables.Item("grd").ExecuteQuery(xSQL); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제 if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("U_CENTCD", 0).ToString() == null || oGrid.DataTable.GetValue("U_CENTCD", 0).ToString() == "")) { FN.SetGridTitle(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable)); } else { FN.SetGrdColumnNumber(ref oGrid, "", GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight), "", ""); FN.SetGridCheckBox(ref oGrid, "U_CHK", true); //SAPbouiCOM.Column oColumn = oGrid.Columns.Item("U_CHK").AffectsFormMode = false; ; //oColumn.AffectsFormMode = false; //1. 지역 FN.SetComboBoxValidValues(oGrid, "U_AREA", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO90' ", FN.Enum_WholeTp.m_Nothing); //1. 계산서발행구분 FN.SetComboBoxValidValues(oGrid, "U_BILLGBN", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO15' ", FN.Enum_WholeTp.m_Nothing); // 지국 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "U_CENTCD", BoLinkedObject.lf_BusinessPartner); // 선수금 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "U_ADVRECV", BoLinkedObject.lf_BusinessPartner); FN.BindGrid(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , "" , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight)); //FN.SetColoumnColor(oForm, "grd3", "#E0ECF8", "ETAX_YN,DTINO,DTSTAT"); //그리드 BG 기본색(#E6E6FA) FN.SetSumField(ref oGrid, "U_PAPEAMT,U_SAVEAMT,U_ADVRECV,U_ADVSUBT,U_UNPAID,U_DELVAMT,U_REQAMT,U_SUMAMT"); oGrid.RowHeaders.Width = 0; oGrid.AutoResizeColumns(); // 데이터 조회후 선수금 목록도 조회한다. //GetAdvanceReceivedSubtract(oForm, strDocEntry); } if (oForm.Mode != BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_OK_MODE; SetItemEnabled(oForm); } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_btnFind_AFItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oForm.Refresh(); } }
private void FindData(SAPbouiCOM.Form oForm) { //ADD YOUR ACTION CODE HERE ... SAPbouiCOM.Grid oGrid; StringBuilder sb; string strDocEntry = string.Empty; string strREADCD_FR = string.Empty; string strREADCD_TO = string.Empty; string strYYYYMM_FR = string.Empty; string strYYYYMM_TO = string.Empty; string strQUERYTP = string.Empty; try { oForm.Freeze(true); oUDS = oForm.DataSources.UserDataSources; oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0150T_HRD"); strDocEntry = oDB_M.GetValue("DocEntry", 0).Trim(); strREADCD_FR = oUDS.Item("edtREADCD1").ValueEx; strREADCD_TO = oUDS.Item("edtREADCD2").ValueEx; strYYYYMM_FR = oUDS.Item("cboREQYM1").ValueEx; strYYYYMM_TO = oUDS.Item("cboREQYM2").ValueEx; strQUERYTP = oUDS.Item("optALL").ValueEx; sb = new StringBuilder(); //조회 sb.AppendFormat(" EXEC KIS_SP_SO0150F1_HRD @pDocEntry = '{0}' \r ", strDocEntry); sb.AppendFormat(" , @pREADCD_FR = '{0}' \r ", strREADCD_FR); sb.AppendFormat(" , @pREADCD_TO = '{0}' \r ", strREADCD_TO); sb.AppendFormat(" , @pYYYYMM_FR = '{0}' \r ", strYYYYMM_FR); sb.AppendFormat(" , @pYYYYMM_TO = '{0}' \r ", strYYYYMM_TO); sb.AppendFormat(" , @pQUERYTP = '{0}' \r ", strQUERYTP); B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oForm.DataSources.DataTables.Item("grd").ExecuteQuery(sb.ToString()); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제 if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("U_READCD", 0).ToString() == null || oGrid.DataTable.GetValue("U_READCD", 0).ToString() == "")) { FN.SetGridTitle(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable)); } else { FN.SetGrdColumnNumber(ref oGrid, "", GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight), "", ""); // 라인 독자구분 FN.SetComboBoxValidValues(oGrid, "U_RTYPE", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO08' ", FN.Enum_WholeTp.m_Nothing); // 라인 가입방법 FN.SetComboBoxValidValues(oGrid, "U_RMETHOD", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO14' ", FN.Enum_WholeTp.m_Nothing); // 라인 납부방법 FN.SetComboBoxValidValues(oGrid, "U_PMETHOD", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO09' ", FN.Enum_WholeTp.m_Nothing); // 라인 분납구분(납부시기) FN.SetComboBoxValidValues(oGrid, "U_PAYPERD", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO11' ", FN.Enum_WholeTp.m_Nothing); // 라인 계산서발행 FN.SetComboBoxValidValues(oGrid, "U_BILLGBN", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO15' ", FN.Enum_WholeTp.m_Nothing); // 라인 분국구분 FN.SetComboBoxValidValues(oGrid, "U_CENTGBN", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO17' ", FN.Enum_WholeTp.m_Nothing); // 수정상태값 FN.SetComboBoxValidValues(oGrid, "ROWSTAT", " SELECT 'R' AS CODE, N'조회' AS NAME UNION SELECT 'U' AS CODE, N'수정' AS NAME UNION SELECT 'I' AS CODE, N'추가' AS NAME UNION SELECT 'C' AS CODE, N'재계산' AS NAME ", FN.Enum_WholeTp.m_Nothing); // 지국 링크버튼추가 //FN.SetGirdColumnLinkedObjec(ref oGrid, "U_CENTCD", BoLinkedObject.lf_BusinessPartner); // 독자 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "U_READCD", BoLinkedObject.lf_BusinessPartner); FN.BindGrid(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , "" , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight)); //FN.SetColoumnColor(oForm, "grd3", "#E0ECF8", "ETAX_YN,DTINO,DTSTAT"); //그리드 BG 기본색(#E6E6FA) oGrid.RowHeaders.Width = 0; oGrid.AutoResizeColumns(); } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_btnFind_AFItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oForm.Refresh(); } }
private void FindData(SAPbouiCOM.Form oForm) { //ADD YOUR ACTION CODE HERE ... SAPbouiCOM.Grid oGrid; StringBuilder sb; string strTransDate = string.Empty; string strPerson = string.Empty; string strCentCd_F = string.Empty; string strCentCd_T = string.Empty; try { oForm.Freeze(true); oUDS = oForm.DataSources.UserDataSources; strTransDate = oUDS.Item("edtTRANSDT").ValueEx; strPerson = oUDS.Item("edtPERSON").ValueEx; strCentCd_F = oUDS.Item("edtCENT_F").ValueEx; strCentCd_T = oUDS.Item("edtCENT_T").ValueEx; sb = new StringBuilder(); //조회 sb.AppendFormat(" EXEC KIS_SP_SO0290F1_HRD @pBASEDT = '{0}' ", strTransDate); sb.AppendFormat(" , @pUSERID = '{0}' ", strPerson); sb.AppendFormat(" , @pCENT_FR = '{0}' ", strCentCd_F); sb.AppendFormat(" , @pCENT_TO = '{0}' ", strCentCd_T); B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oForm.DataSources.DataTables.Item("grd").ExecuteQuery(sb.ToString()); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display //그리드 컬럼셋팅 //FN.SetGridComboDataBind(ref oGrid, "DOCTP", "R:독자,C:지국", BoComboDisplayType.cdt_Description); //1. 지역 FN.SetComboBoxValidValues(oGrid, "AREA", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO90' ", FN.Enum_WholeTp.m_Nothing); //2. 지종 FN.SetComboBoxValidValues(oGrid, "PAPERTP", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO01' ", FN.Enum_WholeTp.m_Nothing); // 지국 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "CENTCD", BoLinkedObject.lf_BusinessPartner); //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제 if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("CENTCD", 0).ToString() == null || oGrid.DataTable.GetValue("CENTCD", 0).ToString() == "")) { FN.SetGridTitle(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable)); } else { FN.BindGrid(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , "" , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight)); //FN.SetColoumnColor(oForm, "grd3", "#E0ECF8", "ETAX_YN,DTINO,DTSTAT"); //그리드 BG 기본색(#E6E6FA) oGrid.RowHeaders.Width = 0; oGrid.AutoResizeColumns(); } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_btnFind_AFItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oForm.Refresh(); } }
private void FindData(SAPbouiCOM.Form oForm) { //ADD YOUR ACTION CODE HERE ... SAPbouiCOM.Grid oGrid; SAPbouiCOM.EditTextColumn oEditTextColumn; StringBuilder sb; string cboBPLID = string.Empty; string edtFDATE = string.Empty; string edtTDATE = string.Empty; string edtFBTFDOC = string.Empty; string edtTBTFDOC = string.Empty; string edtBTFCRNM = string.Empty; string edtAPPRNM = string.Empty; string edtHPRCF = string.Empty; string edtHPRCT = string.Empty; string edtLPRCF = string.Empty; string edtLPRCT = string.Empty; string edtACCTCDF = string.Empty; string edtACCTCDT = string.Empty; string cboSTATUS = string.Empty; try { oForm.Freeze(true); oUDS = oForm.DataSources.UserDataSources; cboBPLID = oUDS.Item("cboBPLID").ValueEx; edtFDATE = oUDS.Item("edtFDATE").ValueEx; edtTDATE = oUDS.Item("edtTDATE").ValueEx; edtFBTFDOC = oUDS.Item("edtFBTFDOC").ValueEx; edtTBTFDOC = oUDS.Item("edtTBTFDOC").ValueEx; edtBTFCRNM = oUDS.Item("edtBTFCRNM").ValueEx; edtAPPRNM = oUDS.Item("edtAPPRNM").ValueEx; edtHPRCF = oUDS.Item("edtHPRCF").ValueEx; edtHPRCT = oUDS.Item("edtHPRCT").ValueEx; edtLPRCF = oUDS.Item("edtLPRCF").ValueEx; edtLPRCT = oUDS.Item("edtLPRCT").ValueEx; edtACCTCDF = oUDS.Item("edtACCTCDF").ValueEx; edtACCTCDT = oUDS.Item("edtACCTCDT").ValueEx; cboSTATUS = oUDS.Item("cboSTATUS").ValueEx; sb = new StringBuilder(); //조회 sb.AppendFormat(" EXEC KIS_SP_FI0040B1_HRD @cboBPLID = '{0}' ", cboBPLID); sb.AppendFormat(" , @edtFDATE = '{0}' ", edtFDATE); sb.AppendFormat(" , @edtTDATE = '{0}' ", edtTDATE); sb.AppendFormat(" , @edtFBTFDOC = '{0}' ", edtFBTFDOC); sb.AppendFormat(" , @edtTBTFDOC = '{0}' ", edtTBTFDOC); sb.AppendFormat(" , @edtBTFCRNM = '{0}' ", edtBTFCRNM); sb.AppendFormat(" , @edtAPPRNM = '{0}' ", edtAPPRNM); sb.AppendFormat(" , @edtHPRCF = '{0}' ", edtHPRCF); sb.AppendFormat(" , @edtHPRCT = '{0}' ", edtHPRCT); sb.AppendFormat(" , @edtLPRCF = '{0}' ", edtLPRCF); sb.AppendFormat(" , @edtLPRCT = '{0}' ", edtLPRCT); sb.AppendFormat(" , @edtACCTCDF = '{0}' ", edtACCTCDF); sb.AppendFormat(" , @edtACCTCDT = '{0}' ", edtACCTCDT); sb.AppendFormat(" , @cboSTATUS = '{0}' ", cboSTATUS); B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oForm.DataSources.DataTables.Item("grd").ExecuteQuery(sb.ToString()); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display //그리드 컬럼셋팅 //FN.SetGridComboDataBind(ref oGrid, "DOCTP", "R:독자,C:지국", BoComboDisplayType.cdt_Description); //1. 지역 //FN.SetComboBoxValidValues(oGrid, "AREA", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO90' ", FN.Enum_WholeTp.m_Nothing); FN.SetGridCheckBox(ref oGrid, "CHECKED", true); // 분개장 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "BATCHNUM", BoLinkedObject.lf_JournalVoucher); // GL/BP코드 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "BPCODE", BoLinkedObject.lf_GLAccounts); // 계정코드 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "ACCOUNT", BoLinkedObject.lf_GLAccounts); // 코스트센터 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "PRCCD", BoLinkedObject.lf_ProfitCenter); // 분개 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "JDTNUM", BoLinkedObject.lf_JournalPosting); // 거래처 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "U_CARDCD", BoLinkedObject.lf_BusinessPartner); // 사업장 콤보 FN.SetComboBoxValidValues(oGrid, "BPLID", " SELECT BPLId, BPLName FROM OBPL ", FN.Enum_WholeTp.m_Nothing); //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제 if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("BATCHNUM", 0).ToString() == null || oGrid.DataTable.GetValue("BATCHNUM", 0).ToString() == "0")) { FN.SetGridTitle(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable)); B1Connections.theAppl.StatusBar.SetText("데이터가 없습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } else { FN.BindGrid(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , "" , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight)); //FN.SetColoumnColor(oForm, "grd3", "#E0ECF8", "ETAX_YN,DTINO,DTSTAT"); //그리드 BG 기본색(#E6E6FA) oGrid.RowHeaders.Width = 0; oGrid.CommonSetting.FixedColumnsCount = 4; oGrid.AutoResizeColumns(); #region Color Setting Color newRGBColor = Color.FromArgb(100, 100, 200); //int rowForeColor = newRGBColor.R | (newRGBColor.G << 8) | (newRGBColor.B << 16); string DefultFontColor = "#000000"; string DefultBackColor1 = "#DCDCDC"; string DefultBackColor2 = "#FFFFFF"; string DefultFontColor1 = "#000000"; string DefultFontColor2 = "#777777"; Color systemBackColor = Color.FromArgb(217, 229, 242); int rowBackColor1 = Color.LightYellow.R | Color.LightYellow.G << 8 | Color.LightYellow.B << 16; int rowBackColor2 = Color.LightCyan.R | Color.LightCyan.G << 8 | Color.LightCyan.B << 16; int blueForeColor = Color.Blue.R | (Color.Blue.G << 8) | (Color.Blue.B << 16); int redForeColor = Color.Red.R | Color.Red.G << 8 | Color.Red.B << 16; //int iDefultFontColor = setting.GetCellFontColor(-1, 1); int iDefultFontColor = Convert.ToInt32(System.Drawing.ColorTranslator.FromHtml(DefultFontColor).ToArgb()); int iDefultBackColor = systemBackColor.R | (systemBackColor.G << 8) | (systemBackColor.B << 16); #endregion #region GridColorSet FN.SetColumnProperty(oForm, "grd", "BackColor=#DCDCDC"); XDocument root = XDocument.Parse(oGrid.DataTable.SerializeAsXML(BoDataTableXmlSelect.dxs_DataOnly)); //필터링 : 선택된 행의 컬랙션을 조회합니다. var rows = from c in root.Descendants("Row") where c.Elements("Cells").Elements("Cell").Any(o => o.Element("ColumnUid").Value == "STATUS" && o.Element("Value").Value == "미결") select c; //var linqTable = from row in root.Descendants("Row").Descendants("Cells").AsEnumerable() // select new // { // LineId = (from col in row.Descendants("Cell").AsEnumerable() where col.Element("ColumnUid").Value == "ROWSID" select col.Element("Value").Value), // }; foreach (XElement r in rows) { foreach (XElement c in r.Descendants("Cell")) { string ColumnUid = c.Element("ColumnUid").Value; string Value = c.Element("Value").Value; if (ColumnUid == "LINENUM") { oGrid.CommonSetting.SetCellEditable(Convert.ToInt32(Value), 1, true); oGrid.CommonSetting.SetRowBackColor(Convert.ToInt32(Value), rowBackColor1); } } } #endregion B1Connections.theAppl.StatusBar.SetText("조회완료", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_btnFind_AFItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oForm.Refresh(); } }
private bool ExecuteData(SAPbouiCOM.Form oForm) { bool rtnValue = true; StringBuilder sb = new StringBuilder(); string strPaperTp = string.Empty; string strYyyyMm = string.Empty; string strDate = string.Empty; string strDesc = string.Empty; SAPbobsCOM.Recordset oRS = null; try { oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); oUDS = oForm.DataSources.UserDataSources; strPaperTp = oUDS.Item("cboPAPERTP").ValueEx; strYyyyMm = oUDS.Item("cboYYYYMM").ValueEx; strDate = oUDS.Item("edtREQDT").ValueEx; strDesc = oUDS.Item("edtDESC").ValueEx; sb.AppendLine(" EXEC KIS_SP_SO0140A1_HRD "); sb.AppendFormat(" @pPAPERTP = '{0}' ", strPaperTp); sb.AppendFormat(" , @pYYYYMM = '{0}' ", strYyyyMm); sb.AppendFormat(" , @pDATE = '{0}' ", strDate); sb.AppendFormat(" , @pDESC = '{0}' ", strDesc); sb.AppendFormat(" , @pUserSign = '{0}' ", B1Connections.diCompany.UserSignature.ToString()); oRS.DoQuery(sb.ToString()); B1Connections.theAppl.StatusBar.SetText("청구실행이 완료 되었습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success); } catch (Exception) { rtnValue = false; throw; } finally { oGrid = null; if (oRS != null) { Marshal.ReleaseComObject(oRS); } oRS = null; } return rtnValue; }
/// <summary> /// 청구 실행전 실행 가능여부 체크 /// </summary> /// <param name="oForm"></param> /// <returns></returns> private bool BeforeExecute_ValidationCheck(SAPbouiCOM.Form oForm) { bool rtnValue = false; string strPaperTp = string.Empty; string strYyyyMm = string.Empty; string strDate = string.Empty; string strDesc = string.Empty; string strValue = string.Empty; StringBuilder sb; SAPbobsCOM.Recordset oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); try { oUDS = oForm.DataSources.UserDataSources; strPaperTp = oUDS.Item("cboPAPERTP").ValueEx; strYyyyMm = oUDS.Item("cboYYYYMM").ValueEx; //strValue = FN.GetRecordsetValue(string.Format( " SELECT COUNT (1) FROM [@KIS_SO0140T_HRD] WHERE U_PAPERTP = '{0}' AND U_YYYYMM = '{1}'", strPaperTp, strYyyyMm); sb = new StringBuilder(); sb.AppendLine(" SELECT U_PAPERTP, U_YYYYMM "); sb.AppendLine(" FROM (SELECT U_PAPERTP "); sb.AppendLine(" , U_YYYYMM "); sb.AppendLine(" , ROW_NUMBER () OVER (PARTITION BY U_PAPERTP ORDER BY U_YYYYMM DESC) AS RegSeq "); sb.AppendLine(" FROM [@KIS_SO0140T_HRD]) AS x "); sb.AppendFormat(" WHERE RegSeq = 1 AND U_PAPERTP = '{0}' ", strPaperTp); oRS.DoQuery(sb.ToString()); if (!oRS.EoF) { strValue = oRS.Fields.Item("U_YYYYMM").Value.ToString(); if (strYyyyMm.CompareTo(strValue) > 0) { rtnValue = true; } else { B1Connections.theAppl.StatusBar.SetText("기존에 청구된 데이터가 존재 합니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); rtnValue = false; } } else rtnValue = true; } catch (Exception) { throw; } finally { if (oRS != null) { Marshal.ReleaseComObject(oRS); } oRS = null; } return rtnValue; }
public virtual void ET_grd_AFClick(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oGrid = ((SAPbouiCOM.Grid)(oForm.Items.Item("grd").Specific)); // ADD YOUR ACTION CODE HERE ... try { if (pVal.Row != -1) { string strPaperTp = FN.GetGridCellValue(ref oGrid, "U_PAPERTP", pVal.Row); string strYyyyMm = FN.GetGridCellValue(ref oGrid, "U_YYYYMM", pVal.Row); string strDate = FN.GetGridCellValue(ref oGrid, "U_REQDT", pVal.Row); string strDesc = FN.GetGridCellValue(ref oGrid, "U_DESC", pVal.Row); oUDS = oForm.DataSources.UserDataSources; oUDS.Item("cboPAPERTP").Value = strPaperTp; oUDS.Item("cboYYYYMM").Value = strYyyyMm; oUDS.Item("edtREQDT").Value = FN.SetDateFormatToDB(strDate, FN.eDateType.n_YYYYMMDD); oUDS.Item("edtDESC").ValueEx = strDesc; oGrid.Rows.SelectedRows.Add(pVal.Row); } } catch (Exception) { throw; } }
private void FindData(SAPbouiCOM.Form oForm) { string cv_ColumnsUID_s; string cv_NoEditable_s; string cv_ColumnsNAM_s; string cv_Right_Just_s; string cv_No_Visible_s; StringBuilder sb = new StringBuilder(); string strPaperTp = string.Empty; string strYyyyMm = string.Empty; try { oForm.Freeze(true); oUDS = oForm.DataSources.UserDataSources; strPaperTp = oUDS.Item("cboPAPERTP").ValueEx; strYyyyMm = oUDS.Item("cboYYYYMM").ValueEx; oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oGrid.SelectionMode = BoMatrixSelect.ms_Single; cv_ColumnsUID_s = " DocEntry, U_PAPERTP, U_YYYYMM, U_DESC, U_REQDT, U_AMT, CreateDate, CreateTime, CalcTime, USER_CODE "; cv_NoEditable_s = " DocEntry, U_PAPERTP, U_YYYYMM, U_DESC, U_REQDT, U_AMT, CreateDate, CreateTime, CalcTime, USER_CODE "; cv_ColumnsNAM_s = " 실행번호, 지종, 청구년월, 내역, 청구일자, 청구금액, 실행일자, 실행시간, 계산시간(분), 실행자 "; cv_Right_Just_s = " DocEntry, U_AMT, CalcTime "; cv_No_Visible_s = " "; sb.AppendLine(" SELECT T0.DocEntry "); sb.AppendLine(" , T0.U_PAPERTP "); sb.AppendLine(" , T0.U_YYYYMM "); sb.AppendLine(" , T0.U_DESC "); sb.AppendLine(" , T0.U_REQDT "); sb.AppendLine(" , T1.U_AMT "); sb.AppendLine(" , T0.CreateDate "); sb.AppendLine(" , T0.CreateTime "); sb.AppendLine(" , DATEDIFF (MI, dbo.KIS_FN_SETDATETIME (T0.CreateDate, T0.CreateTime), dbo.KIS_FN_SETDATETIME (T0.UpdateDate, T0.UpdateTime)) AS CalcTime "); sb.AppendLine(" , T3.USER_CODE "); sb.AppendLine(" FROM [@KIS_SO0140T_HRD] AS T0 "); sb.AppendLine(" INNER JOIN (SELECT DocEntry, SUM (U_AMT) AS U_AMT "); sb.AppendLine(" FROM [@KIS_SO01401_HRD] "); sb.AppendLine(" GROUP BY DocEntry) T1 "); sb.AppendLine(" ON T0.DocEntry = T1.DocEntry "); sb.AppendLine(" LEFT JOIN OUSR AS T3 ON T0.UserSign = USERID "); if (SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.H_CallCenter || SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.H_Manager) sb.AppendLine(" WHERE T0.U_PAPERTP IN ('UHB', 'UKH') "); else if (SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.J_Manager) sb.AppendLine(" WHERE T0.U_PAPERTP IN ('UJH') "); else sb.AppendLine(" WHERE 1 = 2 "); sb.AppendLine(" ORDER BY T0.DocEntry DESC "); oForm.DataSources.DataTables.Item("grd").ExecuteQuery(sb.ToString()); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display FN.SetComboBoxValidValues(oGrid, "U_PAPERTP", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO01' ", FN.Enum_WholeTp.m_Nothing); FN.SetGirdColumnLinkedObjec(ref oGrid, "DocEntry", BoLinkedObject.lf_ProfitCenter); FN.BindGrid(oGrid, cv_ColumnsUID_s, cv_ColumnsNAM_s, cv_NoEditable_s, cv_No_Visible_s, "", cv_Right_Just_s); oGrid.RowHeaders.Width = 0; oGrid.AutoResizeColumns(); } catch (Exception) { //oForm.Freeze(false); throw; } finally { oForm.Freeze(false); oGrid = null; } }
public void FindData(SAPbouiCOM.Form oForm) { #region 조회 string query = string.Empty; string expr = string.Empty; string orderBy = string.Empty; string sColID = string.Empty; string edtCode = string.Empty; try { oUDS = oForm.DataSources.UserDataSources; query = oUDS.Item("pQuery").ValueEx; expr = oUDS.Item("pExpr").ValueEx; orderBy = oUDS.Item("pOrderBy").ValueEx; sColID = oUDS.Item("sColID").ValueEx; oForm.Freeze(true); oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; //oGrid.SelectionMode = boMatrixSelect; string pBoMtxSel = oForm.DataSources.UserDataSources.Item("pBoMtxSel").ValueEx; switch (pBoMtxSel) { case "0": oGrid.SelectionMode = BoMatrixSelect.ms_None; break; case "1": oGrid.SelectionMode = BoMatrixSelect.ms_Auto; break; case "2": oGrid.SelectionMode = BoMatrixSelect.ms_Single; break; case "3": oGrid.SelectionMode = BoMatrixSelect.ms_NotSupported; break; } oGrid.Rows.SelectedRows.Clear(); StringBuilder pQuery = new StringBuilder(); //pQuery.Append(" SELECT * "); //pQuery.Append(" FROM ({0}) userQuery "); //pQuery.Append(" WHERE 1 = 1 "); //pQuery.Append(" SELECT CONVERT(INT, ROW_NUMBER() OVER (ORDER BY userQuery.#ROWS)) AS #, userQuery.* "); pQuery.Append(" SELECT CONVERT(INT, ROW_NUMBER() OVER (ORDER BY {3})) AS #, userQuery.* "); pQuery.Append(" FROM (SELECT N' ' AS #ROWS, userSql.* FROM ({0}) userSql) userQuery "); pQuery.Append(" WHERE 1 = 1 "); if (!string.IsNullOrEmpty(sColID)) { if (GetGridColumnType(oGrid, sColID) == ((int)SAPbouiCOM.BoFieldsType.ft_Date).ToString()) { pQuery.Append("AND ISNULL('{2}', '') = '' OR CONVERT(NVARCHAR(8), userQuery.{1}, 112) = '{2}'"); edtCode = FN.SetDateFormatToDB(oUDS.Item("edtCodeDt").ValueEx, FN.eDateType.n_YYYYMMDD); } else { pQuery.Append("AND ISNULL(CONVERT(NVARCHAR, userQuery.{1}),'') LIKE '{2}'"); edtCode = oUDS.Item("edtCode").ValueEx; edtCode = (edtCode.Length == 0 ? "%" : edtCode); } } if (string.IsNullOrEmpty(orderBy)) orderBy = "#ROWS"; pQuery.Append(" ORDER BY {3}"); query = string.Format(pQuery.ToString(), query, sColID, edtCode, orderBy); //B1Connections.theAppl.StatusBar.SetText("조회중입니다.........", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); oForm.DataSources.DataTables.Item("dt").ExecuteQuery(query); oGrid.DataTable = oForm.DataSources.DataTables.Item("dt"); //데이터 그리드에 Display if (!string.IsNullOrEmpty(expr)) { SetSumField(expr); FN.SetColumnProperty(oForm, "grd", expr); } // 추가 oGrid.Columns.Item("#").Visible = true; oGrid.Columns.Item("#").Width = 10; oGrid.Columns.Item("#").RightJustified = true; oGrid.Columns.Item("#ROWS").Visible = false; FN.SetGirdSort(ref oGrid); oGrid.RowHeaders.Width = 10; oGrid.CommonSetting.FixedColumnsCount = 1; oGrid.Rows.SelectedRows.Clear(); this.selectedRow = -1; //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제 if (oGrid.DataTable.Rows.Count == 1) { if (FN.GetRecordsetValue(query.Replace("CONVERT(INT, ROW_NUMBER() OVER (ORDER BY userQuery.#ROWS)) AS #, userQuery.*", "COUNT(1)")) == "0") { oGrid.DataTable.Rows.Clear(); return; } } oGrid.Rows.SelectedRows.Add(0); this.selectedRow = 0; oGrid.AutoResizeColumns(); } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("FindData " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { //B1Connections.theAppl.StatusBar.SetText("조회가 완료되었습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); oForm.Freeze(false); } #endregion }
private void FindData(SAPbouiCOM.Form oForm) { string strExpr = string.Empty; string strSort = string.Empty; /* 조회조건 */ string strF_DEPT = string.Empty; // 구독부서 string strF_TEL = string.Empty; // 전화번호 string strF_ADDR = string.Empty; // 주소 string strF_CENTER = string.Empty; // 지국(분국) string strF_STATUS = string.Empty; // 상태 System.Data.DataRow[] findRows = null; StringBuilder sb = new StringBuilder(); int i = 0; try { /*조회조건 값 가져오기 */ oUDS = oForm.DataSources.UserDataSources; strF_DEPT = oUDS.Item("edtF_RDEPT").Value; strF_TEL = oUDS.Item("edtF_TEL").Value; strF_ADDR = oUDS.Item("edtF_ADDR").Value; strF_CENTER = oUDS.Item("edtF_CENT").Value; strF_STATUS = oUDS.Item("cboF_STATU").Value; oDB1_Z = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00301Z_HRD"); oDB1_Z.Clear(); sb.Append(" 1 = 1 "); if (!string.IsNullOrEmpty(strF_DEPT)) //구독부서 sb.AppendFormat(" AND RDEPT LIKE '%{0}%' ", strF_DEPT); if (!string.IsNullOrEmpty(strF_TEL)) //전화번호 sb.AppendFormat(" AND TEL LIKE '%{0}%' ", strF_TEL); if (!string.IsNullOrEmpty(strF_ADDR)) //주소 sb.AppendFormat(" AND (ADDR1 LIKE '%{0}%' OR ADDR1_D LIKE '%{0}%' OR ADDR2 LIKE '%{0}%' OR ADDR2_D LIKE '%{0}%' ) ", strF_ADDR); if (!string.IsNullOrEmpty(strF_CENTER)) //지국 sb.AppendFormat(" AND CENTNM LIKE '%{0}%' ", strF_CENTER); if (!string.IsNullOrEmpty(strF_STATUS)) //상태 sb.AppendFormat(" AND STATUS = '{0}' ", strF_STATUS); // 정렬 기준 findRows = gDs.Tables[oForm.UniqueID + "_Deliver"].Select(sb.ToString(), "LINEID ASC"); foreach (System.Data.DataRow dr in findRows) { oDB1_Z.InsertRecord(i); oDB1_Z.SetValue("U_NO", i, (i + 1).ToString()); oDB1_Z.SetValue("U_IDX", i, dr["IDX"].ToString()); //"데이터테이블 고유번호 IDX"; oDB1_Z.SetValue("LineId", i, dr["LineId"].ToString());//"원본라인번호"; oDB1_Z.SetValue("U_DELVCD", i, dr["DELVCD"].ToString()); //"배달코드"; oDB1_Z.SetValue("U_RDEPT", i, dr["RDEPT"].ToString()); //"부서"; oDB1_Z.SetValue("U_PAPERTP", i, dr["PAPERTP"].ToString()); //"지종"; oDB1_Z.SetValue("U_READTP", i, dr["READTP"].ToString()); //"독자구분"; oDB1_Z.SetValue("U_PAYCD", i, dr["PAYCD"].ToString()); //"요금제코드"; oDB1_Z.SetValue("U_PAYNM", i, dr["PAYNM"].ToString()); //"요금제명"; oDB1_Z.SetValue("U_TEL", i, dr["TEL"].ToString()); //"연락처"; oDB1_Z.SetValue("U_MOBILE", i, dr["MOBILE"].ToString()); //"휴대폰"; oDB1_Z.SetValue("U_ADDR1", i, dr["ADDR1"].ToString()); //"주소1"; oDB1_Z.SetValue("U_ADDR2", i, dr["ADDR2"].ToString()); //"주소2"; oDB1_Z.SetValue("U_ADDR1_D", i, dr["ADDR1_D"].ToString()); //"주소1상세"; oDB1_Z.SetValue("U_ADDR2_D", i, dr["ADDR2_D"].ToString()); //"주소2상세"; oDB1_Z.SetValue("U_CENTCD", i, dr["CENTCD"].ToString()); //"지국"; oDB1_Z.SetValue("U_CENTNM", i, dr["CENTNM"].ToString()); //"지국명"; oDB1_Z.SetValue("U_DELVFR", i, FN.SetDateFormatToDB(dr["DELVFR"].ToString(), FN.eDateType.n_YYYYMMDD)); //"배달시작일"; oDB1_Z.SetValue("U_DELVTO", i, FN.SetDateFormatToDB(dr["DELVTO"].ToString(), FN.eDateType.n_YYYYMMDD)); //"배달종료일"; oDB1_Z.SetValue("U_DELVCNT", i, dr["DELVCNT"].ToString()); //"배달부수"; oDB1_Z.SetValue("U_METHOD", i, dr["METHOD"].ToString()); //"가입방법"; oDB1_Z.SetValue("U_SAILCD", i, dr["SAILCD"].ToString()); //"유치자"; oDB1_Z.SetValue("U_SAILNM", i, dr["SAILNM"].ToString()); //"유치자"; oDB1_Z.SetValue("U_SDEPT", i, dr["SDEPT"].ToString()); //"유치부서"; oDB1_Z.SetValue("U_NOTE", i, dr["NOTE"].ToString()); //"배달상세"; oDB1_Z.SetValue("U_STATUS", i, dr["STATUS"].ToString()); //"배달상태"; oDB1_Z.SetValue("U_JOINDT", i, FN.SetDateFormatToDB(dr["JOINDT"].ToString(), FN.eDateType.n_YYYYMMDD)); //"가입일자"; oDB1_Z.SetValue("U_CLOSEDT", i, FN.SetDateFormatToDB(dr["CLOSEDT"].ToString(), FN.eDateType.n_YYYYMMDD)); //"중지일자"; oDB1_Z.SetValue("U_USERSG1", i, dr["USERSG1"].ToString()); //"등록자"; oDB1_Z.SetValue("U_BTEL1", i, dr["BTEL1"].ToString()); //"분국전화1"; oDB1_Z.SetValue("U_BTEL2", i, dr["BTEL2"].ToString()); //"분국전화1"; i += 1; } oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific; oMatrix.LoadFromDataSource(); } catch (Exception) { throw; } finally { findRows = null; } }
private void GetAdvanceAmt(SAPbouiCOM.Form oForm) { string strREADCD = string.Empty; try { oForm.Freeze(true); oUDS = oForm.DataSources.UserDataSources; oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); strREADCD = oDB_M.GetValue("Code", 0).Trim(); string strRtnValue = FN.GetRecordsetValue(string.Format( " SELECT ISNULL(U_AMT,0) FROM KIS_VW_SO02401_HRD WHERE U_READCD = '{0}' " , strREADCD)); oUDS.Item("edtADVANCE").Value = strRtnValue; } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("GetAdvanceAmt " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oForm.Refresh(); } }
/// <summary> /// 청구일자를 지종, 청구년월일 기준으로 설정한다. /// JH(주니어헤럴드) : 말일 /// KH(코리아헤럴드), HE(헤럴드) : 매월 10일 설정 /// </summary> /// <param name="oForm"></param> private void SetRequireDate(SAPbouiCOM.Form oForm) { string strYyyyMm = string.Empty; string strDate = string.Empty; string strPaperTp = string.Empty; string strPaperTypeDesc = string.Empty; string strYearMonthDesc = string.Empty; try { oUDS = oForm.DataSources.UserDataSources; strPaperTp = oUDS.Item("cboPAPERTP").ValueEx; strYyyyMm = oUDS.Item("cboYYYYMM").ValueEx; if (!string.IsNullOrEmpty(strPaperTp) && !string.IsNullOrEmpty(strYyyyMm)) { if (strPaperTp == "UJH") { strDate = DateTimeLibrary.LastDayOfCurrentMonth(strYyyyMm + "01"); oUDS.Item("edtReqDt").Value = strDate; } else { oUDS.Item("edtReqDt").Value = strYyyyMm + "10"; } oComboBox = oForm.Items.Item("cboPAPERTP").Specific; strPaperTypeDesc = oComboBox.Selected.Description; oComboBox = oForm.Items.Item("cboYYYYMM").Specific; strYearMonthDesc = oComboBox.Selected.Description; oUDS.Item("edtDESC").Value = strYearMonthDesc + " [" + strPaperTypeDesc + "] 청구내역"; } } catch (Exception) { throw; } }
private SAPbouiCOM.DataTable FindData(SAPbouiCOM.Form oForm) { //ADD YOUR ACTION CODE HERE ... SAPbouiCOM.Grid oGrid; StringBuilder sb; string strCALLPER = string.Empty; string strColYyyyMm = string.Empty; string strCENTCE_FR = string.Empty; string strCENTCE_TO = string.Empty; try { oForm.Freeze(true); oUDS = oForm.DataSources.UserDataSources; strCALLPER = oUDS.Item("edtCALLPER").ValueEx; strCENTCE_FR = oUDS.Item("edtCENTCD1").ValueEx; strCENTCE_TO = oUDS.Item("edtCENTCD2").ValueEx; sb = new StringBuilder(); //조회 sb.AppendLine(" EXEC KIS_SP_SO0260F1_HRD @pQUERY_TYPE = '{0}' "); sb.AppendLine(" , @pPERSON = '{1}' "); sb.AppendLine(" , @pCENTCD_FR = '{2}' "); sb.AppendLine(" , @pCENTCD_TO = '{3}' "); B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oForm.DataSources.DataTables.Item("grd").ExecuteQuery(string.Format(sb.ToString(), "Q", strCALLPER, strCENTCE_FR, strCENTCE_TO)); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제 if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("U_READCD", 0).ToString() == null || oGrid.DataTable.GetValue("U_READCD", 0).ToString() == "")) { FN.SetGridTitle(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable)); } else { strColYyyyMm = FN.GetRecordsetValue(string.Format(sb.ToString(), "C", "", "", "", "")).Replace("[", "").Replace("]", ""); FN.SetGrdColumnNumber(ref oGrid, "", GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight) + "," + strColYyyyMm, "", ""); // 독자 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "U_READCD", BoLinkedObject.lf_BusinessPartner); // 지국 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "U_CENTCD", BoLinkedObject.lf_BusinessPartner); FN.BindGrid(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) + "," + strColYyyyMm , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) + "," + strColYyyyMm , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable) + "," + strColYyyyMm , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , "" , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight) + "," + strColYyyyMm); //FN.SetColoumnColor(oForm, "grd3", "#E0ECF8", "ETAX_YN,DTINO,DTSTAT"); //그리드 BG 기본색(#E6E6FA) //oGrid.RowHeaders.Width = 0; oGrid.AutoResizeColumns(); } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_btnFind_AFItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oForm.Refresh(); } SAPbouiCOM.DataTable dt = oForm.DataSources.DataTables.Item("grd"); return dt; }
private void FindData(SAPbouiCOM.Form oForm) { string cv_ColumnsUID_s; string cv_NoEditable_s; string cv_ColumnsNAM_s; string cv_Right_Just_s; string cv_No_Visible_s; StringBuilder sb = new StringBuilder(); string cboTAKEYM = string.Empty; string edtTAKEDT = string.Empty; try { oForm.Freeze(true); oUDS = oForm.DataSources.UserDataSources; cboTAKEYM = oUDS.Item("cboTAKEYM").ValueEx.Trim(); edtTAKEDT = oUDS.Item("edtTAKEDT").ValueEx; oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oGrid.SelectionMode = BoMatrixSelect.ms_Single; cv_ColumnsUID_s = " DocEntry, U_TAKEYM, U_TAKEDT, U_SFILE, U_EFILE, U_TOTCNT, U_NEWCNT, U_MODCNT, U_CLOCNT, U_RCLCNT, CreateDate, CreateTime, USER_CODE "; cv_NoEditable_s = " DocEntry, U_TAKEYM, U_TAKEDT, U_SFILE, U_EFILE, U_TOTCNT, U_NEWCNT, U_MODCNT, U_CLOCNT, U_RCLCNT, CreateDate, CreateTime, USER_CODE "; cv_ColumnsNAM_s = " 문서번호, 신청접수년월, 신청접수일자, 신청파일이름, 결과파일이름, 총건수, 신규등록건수, 변경등록건수, 해지등록건수, 임의해지건수, 실행일자, 실행시간, 실행자 "; cv_Right_Just_s = " DocEntry, U_TOTCNT, U_NEWCNT, U_MODCNT, U_CLOCNT, U_RCLCNT "; cv_No_Visible_s = " "; sb.AppendLine(" SELECT T0.DocEntry "); sb.AppendLine(" , T0.U_TAKEYM "); sb.AppendLine(" , T0.U_TAKEDT "); //sb.AppendLine(" , T0.U_DESC "); sb.AppendLine(" , T0.U_SFILE "); sb.AppendLine(" , T0.U_EFILE "); sb.AppendLine(" , T0.U_TOTCNT "); sb.AppendLine(" , T0.U_NEWCNT "); sb.AppendLine(" , T0.U_MODCNT "); sb.AppendLine(" , T0.U_CLOCNT "); sb.AppendLine(" , T0.U_RCLCNT "); sb.AppendLine(" , T0.CreateDate "); sb.AppendLine(" , T0.CreateTime "); sb.AppendLine(" , (SELECT F.USER_CODE FROM OUSR F WHERE F.USERID = T0.UserSign) AS USER_CODE "); sb.AppendLine(" FROM [@KIS_SO0390T_HRD] T0 "); sb.AppendLine(" WHERE (ISNULL('{0}','') = '' OR (T0.U_TAKEYM = '{0}')) "); sb.AppendLine(" AND (ISNULL('{1}','') = '' OR (T0.U_TAKEDT = '{1}')) "); sb.AppendLine(" ORDER BY T0.U_TAKEYM, T0.U_TAKEDT "); oForm.DataSources.DataTables.Item("grd").ExecuteQuery(string.Format(sb.ToString(), cboTAKEYM, edtTAKEDT)); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display if (oGrid.DataTable.Rows.Count == 1) { if (oGrid.DataTable.Columns.Item("DocEntry").Cells.Item(0).Value.ToString().Trim() == "0") { oGrid.DataTable.Rows.Clear(); } } FN.SetGirdColumnLinkedObjec(ref oGrid, "DocEntry", BoLinkedObject.lf_ProfitCenter); FN.BindGrid(oGrid, cv_ColumnsUID_s, cv_ColumnsNAM_s, cv_NoEditable_s, cv_No_Visible_s, "", cv_Right_Just_s); oGrid.RowHeaders.Width = 0; oGrid.AutoResizeColumns(); } catch (Exception) { //oForm.Freeze(false); throw; } finally { oForm.Freeze(false); oGrid = null; } }
private void FindData(SAPbouiCOM.Form oForm) { //ADD YOUR ACTION CODE HERE ... SAPbouiCOM.Grid oGrid; StringBuilder sb; string strYYYYMM_FR = string.Empty; string strYYYYMM_TO = string.Empty; string strCENTCD_FR = string.Empty; string strCENTCD_TO = string.Empty; string strPERSON = string.Empty; try { oForm.Freeze(true); oUDS = oForm.DataSources.UserDataSources; strYYYYMM_FR = oUDS.Item("cboYYYYMM1").ValueEx; strYYYYMM_TO = oUDS.Item("cboYYYYMM2").ValueEx; sb = new StringBuilder(); //조회 sb.AppendLine(" SELECT CONVERT (VARCHAR (10), ROW_NUMBER () OVER (ORDER BY T0.Code)) AS ROWSEQ "); sb.AppendLine(" , T0.Code AS READCD "); sb.AppendLine(" , T0.[Name] AS READNM "); sb.AppendLine(" , ISNULL(T0.U_SUMCNT, 0) AS READCNT "); sb.AppendLine(" , T1.U_SAILCD "); sb.AppendLine(" , T1.U_SAILNM "); sb.AppendLine(" , T1.U_METHOD "); sb.AppendLine(" , T1.U_PAPERTP "); sb.AppendLine(" , U_EXPRYM "); sb.AppendLine(" FROM [@KIS_SO0030M_HRD] T0 "); sb.AppendLine(" INNER JOIN (SELECT ROW_NUMBER () OVER (PARTITION BY Code ORDER BY LineId) AS SEQ "); sb.AppendLine(" , Code "); sb.AppendLine(" , U_PAPERTP "); sb.AppendLine(" , U_SAILCD "); sb.AppendLine(" , U_SAILNM "); sb.AppendLine(" , U_METHOD "); sb.AppendLine(" FROM [@KIS_SO00301_HRD]) T1 "); sb.AppendLine(" ON T0.Code = T1.Code AND T1.Seq = 1 "); sb.AppendLine(" WHERE CONVERT(NVARCHAR(6), ISNULL(U_EXPRYM,''), 112) BETWEEN '{0}' AND '{1}' "); B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oForm.DataSources.DataTables.Item("grd").ExecuteQuery(string.Format( sb.ToString(), strYYYYMM_FR, strYYYYMM_TO) ); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display //1. 지종 FN.SetComboBoxValidValues(oGrid, "U_PAPERTP", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO01' ", FN.Enum_WholeTp.m_Nothing); //2. 가입방법 FN.SetComboBoxValidValues(oGrid, "U_METHOD", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO14' ", FN.Enum_WholeTp.m_Nothing); // 지국 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "READCD", BoLinkedObject.lf_BusinessPartner); //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제 if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("READCD", 0).ToString() == null || oGrid.DataTable.GetValue("READCD", 0).ToString() == "")) { FN.SetGridTitle(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable)); } else { FN.BindGrid(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , "" , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight)); //FN.SetColoumnColor(oForm, "grd3", "#E0ECF8", "ETAX_YN,DTINO,DTSTAT"); //그리드 BG 기본색(#E6E6FA) oGrid.RowHeaders.Width = 0; oGrid.AutoResizeColumns(); } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_btnFind_AFItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oForm.Refresh(); } }
private void FindData(SAPbouiCOM.Form oForm) { //ADD YOUR ACTION CODE HERE ... SAPbouiCOM.Grid oGrid; StringBuilder sb; string strQueryTp = string.Empty; string strYyyyMm_F = string.Empty; string strYyyyMm_T = string.Empty; string strReadCd_F = string.Empty; string strReadCd_T = string.Empty; string strCentCd_F = string.Empty; string strCentCd_T = string.Empty; string strBillTp = string.Empty; string strISSUEDT_F = string.Empty; string strISSUEDT_T = string.Empty; try { oForm.Freeze(true); oUDS = oForm.DataSources.UserDataSources; strQueryTp = oUDS.Item("optALL").ValueEx; strYyyyMm_F = oUDS.Item("cboREQYM_F").ValueEx; strYyyyMm_T = oUDS.Item("cboREQYM_T").ValueEx; strReadCd_F = oUDS.Item("edtREAD_F").ValueEx; strReadCd_T = oUDS.Item("edtREAD_T").ValueEx; strCentCd_F = oUDS.Item("edtCENT_F").ValueEx; strCentCd_T = oUDS.Item("edtCENT_T").ValueEx; strBillTp = oUDS.Item("cboBILLTP").ValueEx; strISSUEDT_F = oUDS.Item("edtISSUDT1").ValueEx; strISSUEDT_T = oUDS.Item("edtISSUDT2").ValueEx; sb = new StringBuilder(); //조회 sb.AppendFormat(" EXEC KIS_SP_SO0230F1_HRD @pFOLDLEV = '{0}' ", oForm.PaneLevel.ToString()); sb.AppendFormat(" , @pQUERYTP = '{0}' ", strQueryTp); sb.AppendFormat(" , @pDATE_FR = '{0}' ", strYyyyMm_F); sb.AppendFormat(" , @pDATE_TO = '{0}' ", strYyyyMm_T); sb.AppendFormat(" , @pREAD_FR = '{0}' ", strReadCd_F); sb.AppendFormat(" , @pREAD_TO = '{0}' ", strReadCd_T); sb.AppendFormat(" , @pCENT_FR = '{0}' ", strCentCd_F); sb.AppendFormat(" , @pCENT_TO = '{0}' ", strCentCd_T); sb.AppendFormat(" , @pBILLTP = '{0}' ", strBillTp); sb.AppendFormat(" , @pISSUDT1 = '{0}' ", strISSUEDT_F); sb.AppendFormat(" , @pISSUDT2 = '{0}' ", strISSUEDT_T); B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 switch (oForm.PaneLevel) { case 1: oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd1").Specific; oForm.DataSources.DataTables.Item("grd1").ExecuteQuery(sb.ToString()); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd1"); //데이터 그리드에 Display FN.SetGirdSort(ref oGrid); FN.SetSumField(ref oGrid, "SUPPAMT"); break; case 2: oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd2").Specific; oForm.DataSources.DataTables.Item("grd2").ExecuteQuery(sb.ToString()); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd2"); //데이터 그리드에 Display FN.SetGirdSort(ref oGrid); FN.SetSumField(ref oGrid, "SUPPAMT"); break; case 3: oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd3").Specific; oForm.DataSources.DataTables.Item("grd3").ExecuteQuery(sb.ToString()); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd3"); //데이터 그리드에 Display FN.SetSumField(ref oGrid, "PRICE,QTY,SUPPAMT"); break; default: oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd1").Specific; break; } //그리드 컬럼셋팅 FN.SetGridCheckBox(ref oGrid, "CHK", true); //그리드 컬럼셋팅 FN.SetGridComboDataBind(ref oGrid, "DOCTP", "R:독자,C:지국", BoComboDisplayType.cdt_Description); //2. 세금그룹 FN.SetComboBoxValidValues(oGrid, "VATGRUP", "SELECT Code, Name FROM OVTG WHERE Code = 'A0' ", FN.Enum_WholeTp.m_Nothing); //3. 계산서발행구분 FN.SetComboBoxValidValues(oGrid, "BILLGBN", "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO15' ", FN.Enum_WholeTp.m_Nothing); //링크컬럼셋팅 FN.SetGirdColumnLinkedObjec(ref oGrid, "CODE", BoLinkedObject.lf_BusinessPartner); // 독자/지국링크 FN.SetGirdColumnLinkedObjec(ref oGrid, "CARDCODE", BoLinkedObject.lf_BusinessPartner); //FN.SetGirdColumnLinkedObjec(ref oGrid, "VATGRUP", BoLinkedObject.lf_VatGroup); if (oForm.PaneLevel == 3) { FN.SetGridCheckBox(ref oGrid, "ETAX_YN", true); FN.SetGridComboDataBind(ref oGrid, "INPUTP", "A:자동,M:수기", BoComboDisplayType.cdt_Description); FN.SetComboBoxValidValues(oGrid, "DTSTAT", " SELECT U_CD, U_SMLNM FROM [@KIS_AD00101] WHERE Code ='VT14' ", FN.Enum_WholeTp.m_Nothing); } //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제 if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("CODE", 0).ToString() == null || oGrid.DataTable.GetValue("CODE", 0).ToString() == "")) { FN.SetGridTitle(oGrid , GetGridFieldInfo(oForm, oForm.PaneLevel, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, oForm.PaneLevel, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, oForm.PaneLevel, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , GetGridFieldInfo(oForm, oForm.PaneLevel, SO.SO_COMMON_HRD.GridTitleType.NotEditable)); } else { FN.BindGrid(oGrid , GetGridFieldInfo(oForm, oForm.PaneLevel, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, oForm.PaneLevel, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, oForm.PaneLevel, SO.SO_COMMON_HRD.GridTitleType.NotEditable) , GetGridFieldInfo(oForm, oForm.PaneLevel, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , "" , GetGridFieldInfo(oForm, oForm.PaneLevel, SO.SO_COMMON_HRD.GridTitleType.AlignRight)); FN.SetColoumnColor(oForm, "grd3", "#E0ECF8", "ETAX_YN,DTINO,DTSTAT"); //그리드 BG 기본색(#E6E6FA) oGrid.RowHeaders.Width = 0; oGrid.AutoResizeColumns(); } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_btnFind_AFItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oForm.Refresh(); } }
private SAPbouiCOM.DataTable FindData(SAPbouiCOM.Form oForm) { //ADD YOUR ACTION CODE HERE ... SAPbouiCOM.Grid oGrid; StringBuilder sb; string strREQDT_FR = string.Empty; string strREQDT_TO = string.Empty; string strREADCD_FR = string.Empty; string strREADCD_TO = string.Empty; string strPAPERTP = string.Empty; string strBRANCHCD = string.Empty; string strSALECD = string.Empty; string strSTATUS = string.Empty; try { oForm.Freeze(true); oUDS = oForm.DataSources.UserDataSources; strREQDT_FR = oUDS.Item("edtREQDT1").ValueEx; strREQDT_TO = oUDS.Item("edtREQDT2").ValueEx; strREADCD_FR = oUDS.Item("edtREADCD1").ValueEx; strREADCD_TO = oUDS.Item("edtREADCD2").ValueEx; strPAPERTP = oUDS.Item("cboPAPERTP").ValueEx; strBRANCHCD = oUDS.Item("edtBRCHCD").ValueEx; strSALECD = oUDS.Item("edtSALECD").ValueEx; strSTATUS = oUDS.Item("cboSTATUS").ValueEx; sb = new StringBuilder(); //조회 sb.AppendFormat(" EXEC KIS_SP_SO0130F1_HRD @pREQDT_FR = '{0}' ", strREQDT_FR); sb.AppendFormat(" , @pREQDT_TO = '{0}' ", strREQDT_TO); sb.AppendFormat(" , @pREADCD_FR = '{0}' ", strREADCD_FR); sb.AppendFormat(" , @pREADCD_TO = '{0}' ", strREADCD_TO); sb.AppendFormat(" , @pPAPERTP = '{0}' ", strPAPERTP); sb.AppendFormat(" , @pBRANCHCD = '{0}' ", strBRANCHCD); sb.AppendFormat(" , @pSALECD = '{0}' ", strSALECD); sb.AppendFormat(" , @pSTATUS = '{0}' ", strSTATUS); B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다 oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oForm.DataSources.DataTables.Item("grd").ExecuteQuery(sb.ToString()); oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display //1. 지종 //FN.SetComboBoxValidValues(oGrid, "U_PAPERTP", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO01' ", FN.Enum_WholeTp.m_Nothing); //2. 상태 //FN.SetComboBoxValidValues(oGrid, "U_STATUS", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO13' ", FN.Enum_WholeTp.m_Nothing); // 독자 링크버튼추가 FN.SetGirdColumnLinkedObjec(ref oGrid, "READCD", BoLinkedObject.lf_BusinessPartner); //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제 if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("READCD", 0).ToString() == null || oGrid.DataTable.GetValue("READCD", 0).ToString() == "")) { FN.SetGridTitle(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable)); } else { FN.BindGrid(oGrid , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable) , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible) , "" , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight)); //FN.SetColoumnColor(oForm, "grd3", "#E0ECF8", "ETAX_YN,DTINO,DTSTAT"); //그리드 BG 기본색(#E6E6FA) oGrid.RowHeaders.Width = 0; oGrid.AutoResizeColumns(); } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("ET_btnFind_AFItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { oForm.Freeze(false); oForm.Refresh(); } SAPbouiCOM.DataTable dt = oForm.DataSources.DataTables.Item("grd"); return dt; }
/// <summary> /// 창 닫기전에 부모창에 값을 바인딩 한다. /// </summary> /// <param name="oForm"></param> private void SetDataToParentApply(SAPbouiCOM.Form oForm) { try { //oForm.Update(); oUDS = oForm.DataSources.UserDataSources; string StrPFormUID = oUDS.Item("pFORMUID").Value; pForm = B1Connections.theAppl.Forms.Item(StrPFormUID); //oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); pDB_M = pForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); //string strBANKNM = FN.GetItemValue(ref oForm, "cboBANKNM"); //string strBNKACCT = FN.GetItemValue(ref oForm, "edtBNKACCT"); //string strCREDTBP = FN.GetItemValue(ref oForm, "cboCREDTBP"); //string strDEPNAME = FN.GetItemValue(ref oForm, "edtDEPNAME"); //string strCREDTNO = FN.GetItemValue(ref oForm, "edtCREDTNO"); //string strVALIDMY = FN.GetItemValue(ref oForm, "edtVALIDMY"); //string strCREDTNM = FN.GetItemValue(ref oForm, "edtCREDTNM"); //string strJMNO = FN.GetItemValue(ref oForm, "edtJMNO1"); //string strJMNO2 = FN.GetItemValue(ref oForm, "edtJMNO2"); string strBANKNM = oUDS.Item("cboBANKNM").Value; string strBNKACCT = oUDS.Item("edtBNKACCT").Value; string strCREDTBP = oUDS.Item("cboCREDTBP").Value; string strDEPNAME = oUDS.Item("edtDEPNAME").Value; string strCREDTNO = oUDS.Item("edtCREDTNO").Value; string strVALIDMY = oUDS.Item("edtVALIDMY").Value; string strCREDTNM = oUDS.Item("edtCREDTNM").Value; string strJMNO = oUDS.Item("edtJMNO").Value; string strJMNOYN = oUDS.Item("chkJMNOYN").Value; pDB_M.SetValue("U_BANKNM", 0, strBANKNM); pDB_M.SetValue("U_BNKACCT", 0, strBNKACCT); pDB_M.SetValue("U_CREDTBP", 0, strCREDTBP); pDB_M.SetValue("U_DEPNAME", 0, strDEPNAME); pDB_M.SetValue("U_CREDTNO", 0, strCREDTNO); pDB_M.SetValue("U_VALIDMY", 0, strVALIDMY); pDB_M.SetValue("U_CREDTNM", 0, strCREDTNM); pDB_M.SetValue("U_JMNO", 0, strJMNO); pDB_M.SetValue("U_JMNOYN", 0, strJMNOYN); if (pForm.Mode == BoFormMode.fm_OK_MODE) pForm.Mode = BoFormMode.fm_UPDATE_MODE; } catch (Exception) { throw; } }
private void Act03_DefualtSetting(SAPbouiCOM.Form oForm, string pStrPFormUID, Dictionary<string, string> pDictionary) { try { //메트릭스 첫줄 선택시 팝업박스 뜨는것 막는다. oForm.Settings.EnableRowFormat = false; // UDO, 네비게이션 사용하지않음 oForm.SupportedModes = 1; // 부모창 ID 저장 oForm.DataSources.UserDataSources.Item("pFORMUID").Value = pStrPFormUID; // 부보창에 현재창 ID 저장 pForm = B1Connections.theAppl.Forms.Item(pStrPFormUID); pForm.DataSources.UserDataSources.Item("cFORMUID").Value = oForm.UniqueID; //은행 FN.SetComboBoxValidValues(oForm, " SELECT U_CD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO40' AND U_USEYN = 'Y' ", "cboBANKNM", FN.Enum_WholeTp.m_Space, ""); //신용카드 FN.SetComboBoxValidValues(oForm, " SELECT U_CD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO52' AND U_USEYN = 'Y' ", "cboCREDTBP", FN.Enum_WholeTp.m_Space, ""); //oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD"); oUDS = oForm.DataSources.UserDataSources; foreach (var item in pDictionary) { switch (item.Key.ToString()) { case "U_BANKNM": oUDS.Item("cboBANKNM").Value = item.Value.ToString(); //oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString()); break; case "U_BNKACCT": oUDS.Item("edtBNKACCT").Value = item.Value.ToString(); //oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString()); break; case "U_CREDTBP": oUDS.Item("cboCREDTBP").Value = item.Value.ToString(); //oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString()); break; case "U_DEPNAME": oUDS.Item("edtDEPNAME").Value = item.Value.ToString(); //oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString()); break; case "U_CREDTNO": oUDS.Item("edtCREDTNO").Value = item.Value.ToString(); //oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString()); break; case "U_VALIDMY": oUDS.Item("edtVALIDMY").Value = item.Value.ToString(); //oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString()); break; case "U_CREDTNM": oUDS.Item("edtCREDTNM").Value = item.Value.ToString(); //oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString()); break; case "U_JMNO": oUDS.Item("edtJMNO").Value = item.Value.ToString(); //oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString()); break; case "U_JMNOYN": oUDS.Item("chkJMNOYN").Value = item.Value.ToString(); break; default: break; } } } catch (Exception) { throw; } }