Beispiel #1
0
        private void FindRequestData(SAPbouiCOM.Form oForm)
        {
            //ADD YOUR ACTION CODE HERE ...
            SAPbouiCOM.Grid oGrid;

            StringBuilder sb;
            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();

                sb = new StringBuilder();
                //조회
                /*
                sb.AppendLine(" SELECT M.U_REQYM    AS U_YYYYMM                                                                                             ");
                sb.AppendLine("      , M.U_AMT      AS REQAMT                                                                                               ");
                sb.AppendLine("      , M.U_DATE     AS DEPO_DATE                                                                                            ");
                sb.AppendLine("      , M.U_INAMT    AS DEPO_AMT                                                                                             ");
                sb.AppendLine("      , M.U_SMLNM + ' ' + M.U_SMLNM2    AS U_PMETHOD                                                                         ");
                sb.AppendLine("      , M.U_STATUS   AS U_STATUS                                                                                             ");
                sb.AppendLine("   FROM (                                                                                                                    ");
                sb.AppendLine(" 		SELECT A.U_READCD                                                                                                   ");
                sb.AppendLine(" 			 , A.U_REQYM                                                                                                    ");
                sb.AppendLine(" 			 , (SELECT SUM(CASE ISNULL(F.U_TYPE, '') WHEN '110' THEN ISNULL(F.U_DEBIT, 0)                                   ");
                sb.AppendLine(" 												 WHEN '120' THEN (-1) * ISNULL(F.U_CREDIT, 0)                               ");
                sb.AppendLine(" 											     ELSE 0 END)                                                                ");
                sb.AppendLine(" 			      FROM [@KIS_SO01403_HRD] F                                                                                 ");
                sb.AppendLine(" 			     WHERE A.DocEntry = F.DocEntry                                                                              ");
                sb.AppendLine(" 				   AND A.LineId = F.U_UPLINEID                                                                              ");
                sb.AppendLine(" 				   AND F.U_TYPE IN ('110', '120') ) AS U_AMT                                                                ");
                sb.AppendLine(" 			 , CASE WHEN ISNULL(B.U_TYPE, '') NOT IN ('110', '120','150') THEN ISNULL(B.U_CREDIT, 0) ELSE 0 END AS U_INAMT  ");
                sb.AppendLine(" 			 , B.U_DATE					                                                                                    ");
                sb.AppendLine(" 			 , ISNULL(B.U_DEBIT,0) AS U_DEBIT                                                                               ");
                sb.AppendLine(" 			 , ISNULL(B.U_CREDIT,0) AS U_CREDIT                                                                             ");
                sb.AppendLine(" 			 , B.U_TYPE                                                                                                     ");
                sb.AppendLine(" 			 , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO54' AND F.U_CD = B.U_TYPE) AS U_SMLNM              ");
                sb.AppendLine(" 			 , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO51' AND F.U_SMLCD = B.U_SUBTYPE) AS U_SMLNM2       ");
                sb.AppendLine(" 			 , A.U_STATUS                                                                                                   ");
                sb.AppendLine(" 		  FROM [@KIS_SO01401_HRD] A                                                                                         ");
                sb.AppendLine(" 		       LEFT OUTER JOIN [@KIS_SO01403_HRD] B ON A.DocEntry = B.DocEntry                                              ");
                sb.AppendLine(" 													AND A.LineId = B.U_UPLINEID                                             ");
                sb.AppendLine(" 													AND B.U_TYPE NOT IN ('110', '120', '150')                               ");
                sb.AppendLine(" 	   ) M                                                                                                                  ");
                sb.AppendLine("   WHERE M.U_AMT <> 0 AND M.U_READCD = '{0}'                                                                                 ");
                sb.AppendLine("   ORDER BY M.U_READCD, M.U_REQYM                                                                                            ");
                */

                sb.AppendLine(" SELECT CASE WHEN ROW_NUMBER() OVER (PARTITION BY M.U_READCD, M.U_REQYM ORDER BY M.U_READCD, M.U_REQYM, M.U_AMT, M.DocEntry, M.LineId, M.U_DATE) = 1 THEN M.U_REQYM ELSE NULL END AS U_YYYYMM                                                     ");
                sb.AppendLine("      , CASE WHEN ROW_NUMBER() OVER (PARTITION BY M.U_READCD, M.U_REQYM ORDER BY M.U_READCD, M.U_REQYM, M.U_AMT, M.DocEntry, M.LineId, M.U_DATE) = 1 THEN M.U_AMT ELSE NULL END AS REQAMT                                                         ");
                sb.AppendLine("      , M.U_DATE     AS DEPO_DATE                                                                                            ");
                sb.AppendLine("      , M.U_INAMT    AS DEPO_AMT                                                                                             ");
                sb.AppendLine("      , M.U_SMLNM + (CASE ISNULL(M.U_SMLNM2,'') WHEN '' THEN '' ELSE ' ' + M.U_SMLNM2 END) AS U_PMETHOD                      ");
                sb.AppendLine("      , M.U_STATUS   AS U_STATUS                                                                                             ");
                sb.AppendLine("   FROM (                                                                                                                    ");
                sb.AppendLine(" 		SELECT A.U_READCD                                                                                                   ");
                sb.AppendLine(" 			 , A.U_REQYM                                                                                                    ");
                sb.AppendLine(" 			 , A.DocEntry                                                                                                   ");
                sb.AppendLine(" 			 , A.LineId                                                                                                     ");
                sb.AppendLine(" 			 , ISNULL((SELECT SUM(ISNULL(F.U_DEBIT, 0))                                                                     ");
                sb.AppendLine(" 			             FROM [@KIS_SO01403_HRD] F                                                                          ");
                sb.AppendLine(" 			            WHERE A.DocEntry = F.DocEntry                                                                       ");
                sb.AppendLine(" 				          AND A.LineId = F.U_UPLINEID                                                                       ");
                sb.AppendLine(" 				          AND F.U_TYPE IN ('110') ), 0) AS U_AMT                                                            ");
                sb.AppendLine(" 			 , CASE WHEN ISNULL(B.U_TYPE, '') NOT IN ('110','150','910','920','000') THEN ISNULL(B.U_CREDIT, 0) ELSE 0 END AS U_INAMT         ");
                sb.AppendLine(" 			 , B.U_DATE					                                                                                    ");
                sb.AppendLine(" 			 , ISNULL(B.U_DEBIT,0) AS U_DEBIT                                                                               ");
                sb.AppendLine(" 			 , ISNULL(B.U_CREDIT,0) AS U_CREDIT                                                                             ");
                sb.AppendLine(" 			 , B.U_TYPE                                                                                                     ");
                sb.AppendLine(" 			 , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO54' AND F.U_CD = B.U_TYPE) AS U_SMLNM              ");
                sb.AppendLine(" 			 , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO51' AND F.U_SMLCD = B.U_SUBTYPE) AS U_SMLNM2       ");
                sb.AppendLine(" 			 , A.U_STATUS                                                                                                   ");
                sb.AppendLine(" 		  FROM [@KIS_SO01401_HRD] A                                                                                         ");
                sb.AppendLine(" 		       LEFT OUTER JOIN [@KIS_SO01403_HRD] B ON A.DocEntry = B.DocEntry                                              ");
                sb.AppendLine(" 													AND A.LineId = B.U_UPLINEID                                             ");
                sb.AppendLine(" 													AND B.U_TYPE NOT IN ('110','150','910','920','000')                                       ");
                sb.AppendLine(" 	   ) M                                                                                                                  ");
                sb.AppendLine("   WHERE M.U_AMT <> 0 AND M.U_READCD = '{0}'                                                                                 ");
                sb.AppendLine("   ORDER BY M.U_READCD, M.U_REQYM                                                                                            ");

                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(), strREADCD));
                oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display                  

                //1. 납부방법
                //FN.SetComboBoxValidValues(oGrid, "U_PMETHOD", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO09' ", FN.Enum_WholeTp.m_Nothing);

                //2. 상태
                FN.SetComboBoxValidValues(oGrid, "U_STATUS", " SELECT 'O' [Code], '미납' AS [Name] UNION ALL SELECT 'C' [Code], '완납' AS [Name]  ", FN.Enum_WholeTp.m_Nothing);

                //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제
                if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("U_YYYYMM", 0).ToString() == null || oGrid.DataTable.GetValue("U_YYYYMM", 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("FindRequestData " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oForm.Freeze(false);
                oForm.Refresh();
            }
        }
Beispiel #2
0
        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();
            }
        }
Beispiel #3
0
        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;
        }
Beispiel #4
0
        public void SetGridTitle(SAPbouiCOM.Form oForm)
        {
            //ADD YOUR ACTION CODE HERE ...
            try
            {
                oForm.Freeze(true);

                //* 미발행 그리드 초기화 */
                oForm.DataSources.DataTables.Add("grd");
                oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific;
                oGrid.DataTable = oForm.DataSources.DataTables.Item("grd");

                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));
                oGrid.RowHeaders.Width = 0;
                oGrid.AutoResizeColumns();
                oGrid.SelectionMode = BoMatrixSelect.ms_NotSupported;
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText("SetGridTitle " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oForm.Freeze(false);
                oForm.Refresh();
            }
        }
Beispiel #5
0
        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();
            }
        }
Beispiel #6
0
        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();
            }
        }
Beispiel #7
0
        private void FindData(SAPbouiCOM.Form oForm)
        {
            //ADD YOUR ACTION CODE HERE ...
            SAPbouiCOM.Grid oGrid;

            StringBuilder sb;
            string strPaperTp = string.Empty;
            string strSingBn = string.Empty;
            string strSinDt_Fr = string.Empty;
            string strSinDt_To = string.Empty;

            try
            {
                oForm.Freeze(true);
                strPaperTp = oForm.DataSources.UserDataSources.Item("cboPAPERTP").ValueEx;
                strSingBn = oForm.DataSources.UserDataSources.Item("cboSINGBN").ValueEx;
                strSinDt_Fr = oForm.DataSources.UserDataSources.Item("edtSINDT1").ValueEx;
                strSinDt_To = oForm.DataSources.UserDataSources.Item("edtSINDT2").ValueEx;

                sb = new StringBuilder();
                //조회
                sb.AppendFormat(" EXEC KIS_SP_SO0032F1_HRD @pPAPERTP   = '{0}'  \r", strPaperTp);
                sb.AppendFormat("                        , @pSINGBN    = '{0}'  \r", strSingBn);
                sb.AppendFormat("                        , @pSINDT_FR  = '{0}'  \r", strSinDt_Fr);
                sb.AppendFormat("                        , @pSINDT_TO  = '{0}'  \r", strSinDt_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(sb.ToString());
                oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display         

                //1. 주소구분
                FN.SetComboBoxValidValues(oGrid, "U_ADDRTP", " SELECT '0' AS CODE, '지번' [NAME] UNION ALL SELECT '1' AS CODE, '거리' [NAME] ", 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, 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.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("FindData " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oForm.Freeze(false);
                oForm.Refresh();
            }
        }
Beispiel #8
0
        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;
        }
Beispiel #9
0
        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();
            }
        }
Beispiel #10
0
        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();
            }
        }
Beispiel #11
0
        public void SetGridTitle(SAPbouiCOM.Form oForm, bool bFirestExcute)
        {
            //ADD YOUR ACTION CODE HERE ...
            try
            {
                oForm.Freeze(true);

                //* 미발행 그리드 초기화 */
                if (bFirestExcute)
                    oForm.DataSources.DataTables.Add("grd");

                oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific;
                oGrid.DataTable = oForm.DataSources.DataTables.Item("grd");

                if (!bFirestExcute)
                    oGrid.DataTable.Clear();

                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));

                if (GetIsChooseFromItem("grd.U_READCD") == false)
                {
                    FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "grd", "Code", BoFormItemTypes.it_GRID, null, "U_READCD");
                }
                else
                {
                    SAPbouiCOM.EditTextColumn oColumn = (SAPbouiCOM.EditTextColumn)oGrid.Columns.Item("U_READCD");
                    oColumn.ChooseFromListUID = "grd.U_READCD";
                    oColumn.ChooseFromListAlias = "Code";
                }


                oGrid.RowHeaders.Width = 0;
                oGrid.AutoResizeColumns();
                oGrid.SelectionMode = BoMatrixSelect.ms_NotSupported;
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText("SetGridTitle " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oForm.Freeze(false);
                oForm.Refresh();
            }
        }
Beispiel #12
0
        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();
            }
        }
Beispiel #13
0
        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();
            }
        }
Beispiel #14
0
        private void FindData(SAPbouiCOM.Form oForm)
        {
            //ADD YOUR ACTION CODE HERE ...
            SAPbouiCOM.Grid oGrid;

            StringBuilder sb;
            string strCentCd = string.Empty;

            try
            {
                oForm.Freeze(true);     
                strCentCd = oForm.DataSources.UserDataSources.Item("edtCENTCD").ValueEx;

                sb = new StringBuilder();
                //조회
                sb.AppendFormat(" EXEC KIS_SP_SO0321F1_HRD @pTYPE = '{0}', @pCENTCD    = '{1}' ","", strCentCd);
                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_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.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.SetGridCheckBox(ref oGrid, "CHK", true);
                    //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();
            }
        }
Beispiel #15
0
        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();
            }
        }