Beispiel #1
0
        /// <summary>
        /// 화면 팝업에 필요한 설정정보를 호출합니다.
        /// </summary>
        /// 
        public bool Act0_SubFormInit(string popupID, string pFormUID, SO.SO_COMMON_HRD.ConfirmType confirmType = SO.SO_COMMON_HRD.ConfirmType.Close, BoMatrixSelect pBoMatrixSelect = BoMatrixSelect.ms_Single, string pQuery = "", int pRowIdx = -1, int pWidth = 430, int pHeight = 392, string expr = null, string orderBy = null, bool autoQuery = true, string callBack = "CallBack")
        {
            // 팝업창이 열려있으면 return
            if (LoadFormChk(popupID.Trim(), pFormUID))
                return false;

            this.width = Convert.ToInt32(pWidth);
            this.height = Convert.ToInt32(pHeight);
            this.pRowIdx = pRowIdx;
            
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            
            oForm.Freeze(true);

            ItemPosition(oForm, width, height);

            SAPbouiCOM.Form pForm = B1Connections.theAppl.Forms.Item(pFormUID);

            // 부모창의 popupID 유져데이터에 팝업창의 FormUID를 넣는다.
            FN.SetDataSourceValue(pForm, popupID.Trim(), oForm.UniqueID);
            
            Act2_DataSourcesBinding(oForm);
            Act3_DefualtSetting(popupID.Trim(), pFormUID, confirmType, pBoMatrixSelect, pQuery, pRowIdx, pWidth, pHeight, expr, orderBy, autoQuery, callBack);

            oForm.Freeze(false);
            return true;
        }
Beispiel #2
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting(string popupID = null, string pFormUID = null, SO.SO_COMMON_HRD.ConfirmType confirmType = SO.SO_COMMON_HRD.ConfirmType.Close, BoMatrixSelect pBoMatrixSelect = BoMatrixSelect.ms_Single, string pQuery = null, int pRowIdx = -1, int? pWidth = null, int? pHeight = null, string pExpr = null, string pOrderBy = null, bool autoQuery = true, string callBack = "CallBack")
        {
            // '// ADD YOUR ACTION CODE HERE ...
            oForm.Settings.EnableRowFormat = false;

            oForm.DataSources.DataTables.Add("sboReturnDt");
            //this.boMatrixSelect = pBoMatrixSelect;


            #region 유져데이터 생성

            oForm.DataSources.UserDataSources.Add("sColID", BoDataType.dt_SHORT_TEXT, 254);

            if (!string.IsNullOrEmpty(popupID))
            {
                oForm.DataSources.UserDataSources.Add("popupID", BoDataType.dt_LONG_TEXT);
                oForm.DataSources.UserDataSources.Item("popupID").ValueEx = popupID;

                oForm.Title = popupID;
            }

            if (!string.IsNullOrEmpty(pFormUID))
            {
                oForm.DataSources.UserDataSources.Add("pFormUID", BoDataType.dt_SHORT_TEXT, 254);
                oForm.DataSources.UserDataSources.Item("pFormUID").ValueEx = pFormUID;

                pForm = B1Connections.theAppl.Forms.Item(pFormUID);
            }

            oForm.DataSources.UserDataSources.Add("pConfTp", BoDataType.dt_LONG_TEXT);
            oForm.DataSources.UserDataSources.Item("pConfTp").ValueEx = confirmType.ToString();

            oForm.DataSources.UserDataSources.Add("pBoMtxSel", BoDataType.dt_LONG_TEXT);
            oForm.DataSources.UserDataSources.Item("pBoMtxSel").ValueEx = ((int)pBoMatrixSelect).ToString();

            oForm.DataSources.UserDataSources.Add("pQuery", BoDataType.dt_LONG_TEXT);
            oForm.DataSources.UserDataSources.Item("pQuery").ValueEx = pQuery;

            oForm.DataSources.UserDataSources.Add("pExpr", BoDataType.dt_LONG_TEXT);
            oForm.DataSources.UserDataSources.Item("pExpr").ValueEx = pExpr;

            oForm.DataSources.UserDataSources.Add("pOrderBy", BoDataType.dt_LONG_TEXT);
            oForm.DataSources.UserDataSources.Item("pOrderBy").ValueEx = pOrderBy;

            oForm.DataSources.UserDataSources.Add("callBack", BoDataType.dt_LONG_TEXT);
            oForm.DataSources.UserDataSources.Item("callBack").ValueEx = callBack;
            
            oForm.DataSources.UserDataSources.Add("pRowIdx", BoDataType.dt_SHORT_TEXT);
            oForm.DataSources.UserDataSources.Item("pRowIdx").ValueEx = pRowIdx.ToString();

            #endregion

            #region 콜백버튼 생성
            if (!FN.GetItemExistsChk(pForm, callBack))
            {
                pForm.Freeze(true);
                SAPbouiCOM.Item oItm;
                oItm = pForm.Items.Add(callBack, BoFormItemTypes.it_BUTTON);
                oItm.Top = -100;
                oItm.Left = -100;
                oItm.Width = 1;
                oItm.Height = 1;
                oItm.LinkTo = "";

                SAPbouiCOM.Button oButton = (SAPbouiCOM.Button)oItm.Specific;
                oButton.Caption = popupID;
                pForm.Freeze(false);
            }
            #endregion

            #region 조회
            if (autoQuery)
                FindData(oForm);
            #endregion
        }
Beispiel #3
0
        public bool Act0_SubFormInit(string popupID, string pFormUID, SO_COMMON_HRD.ZipCodeTypes zipCodeTypes, BoMatrixSelect pBoMatrixSelect = BoMatrixSelect.ms_Single, int pRowIdx = -1, string callBack = "CallBack")
        {
            // 팝업창이 열려있으면 return
            if (LoadFormChk(popupID.Trim(), pFormUID))
                return false;

            this.LoadForm();

            oForm = B1Connections.theAppl.Forms.ActiveForm;
            pForm = B1Connections.theAppl.Forms.Item(pFormUID);
            this.pRowIdx = pRowIdx;

            oForm.Freeze(true);

            this.Act2_DataSourcesBinding();
            this.Act3_DefualtSetting();
            this.Act4_FormMenuSetting();


            #region 팝업초기설정

            oForm.DataSources.DataTables.Add("sboReturnDt");

            this.boMatrixSelect = pBoMatrixSelect;

            // 부모창의 popupID 유져데이터에 팝업창의 FormUID를 넣는다.
            FN.SetDataSourceValue(pForm, popupID.Trim(), oForm.UniqueID);


            if (zipCodeTypes != SO_COMMON_HRD.ZipCodeTypes.Null)
            {
                FN.SetDataSourceValue(oForm, "opt", ((int)zipCodeTypes).ToString());

                FN.SetItemEnable(oForm, "opt0", false);
                FN.SetItemEnable(oForm, "opt1", false);
            }

            if (!string.IsNullOrEmpty(popupID))
            {
                oForm.DataSources.UserDataSources.Item("popupID").ValueEx = popupID;

                oForm.Title = popupID;
            }

            if (!string.IsNullOrEmpty(pFormUID))
            {
                oForm.DataSources.UserDataSources.Item("pFormUID").ValueEx = pFormUID;

                pForm = B1Connections.theAppl.Forms.Item(pFormUID);

                oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnCONF").Specific));
                oButton.Item.Visible = true;
            }

            if (!string.IsNullOrEmpty(callBack))
            {
                oForm.DataSources.UserDataSources.Add("callBack", BoDataType.dt_LONG_TEXT);
                oForm.DataSources.UserDataSources.Item("callBack").ValueEx = callBack;
            }

            if (!string.IsNullOrEmpty(pRowIdx.ToString()))
            {
                oForm.DataSources.UserDataSources.Add("pRowIdx", BoDataType.dt_SHORT_TEXT);
                oForm.DataSources.UserDataSources.Item("pRowIdx").ValueEx = pRowIdx.ToString();
            }

            #endregion

            #region 콜백버튼생성
            if (!FN.GetItemExistsChk(pForm, callBack))
            {
                pForm.Freeze(true);
                SAPbouiCOM.Item oItm;
                oItm = pForm.Items.Add(callBack, BoFormItemTypes.it_BUTTON);
                oItm.Top = -100;
                oItm.Left = -100;
                oItm.Width = 1;
                oItm.Height = 1;
                oItm.LinkTo = "";

                SAPbouiCOM.Button oButton = (SAPbouiCOM.Button)oItm.Specific;
                oButton.Caption = popupID;
                pForm.Freeze(false);
            }
            #endregion

            oForm.Freeze(false);


            return true;
        }