예제 #1
0
        public void A00_SubFormInit(string pStrPFormUID, int pRows = -1, string extCOM = "", string popupID = "", string callBack = "CallBack")
        {
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            oForm.Freeze(true);

            Act02_DataSourcesBinding(oForm, pRows, extCOM, popupID, callBack);
            Act03_DefualtSetting(oForm, pStrPFormUID);

            #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);
        }
예제 #2
0
        //[B1Listener(BoEventTypes.et_MENU_CLICK, true, ActionType.Mnu)]
        //public virtual bool ET_BFMenuClick(MenuEvent pVal) {
        //    // GENERATED CODE
        //    // ADD YOUR ACTION CODE HERE ...
        //    return this.LoadForm();
        //}

        //[B1Listener(BoEventTypes.et_MENU_CLICK, false, ActionType.Mnu)]
        //public virtual void ET_OnAfterMenuClick(MenuEvent pVal) {
        //    // GENERATED CODE
        //    oForm = B1Connections.theAppl.Forms.Item(formuid);
        //    oForm.Freeze(true);
        //    this.FormInit(oForm);
        //    oForm.Freeze(false);
        //    // ADD YOUR ACTION CODE HERE ...
        //}

        public void SubFormInit(string Pformuid)
        {
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.Item(formuid);
            oForm.Freeze(true);
            this.Act1_FormInit(Pformuid);
            oForm.Freeze(false);
        }
예제 #3
0
        //[B1Listener(BoEventTypes.et_MENU_CLICK, true, ActionType.Mnu)]
        //public virtual bool ET_BFMenuClick(MenuEvent pVal) {
        //    // ADD YOUR ACTION CODE HERE ...
        //    return this.LoadForm();
        //}
        
        //[B1Listener(BoEventTypes.et_MENU_CLICK, false, ActionType.Mnu)]
        //public virtual void ET_OnAfterMenuClick(MenuEvent pVal) {
        //    oForm.Freeze(true);
        //    this.Act1_FormInit();
        //    oForm.Freeze(false);
        //    // ADD YOUR ACTION CODE HERE ...
        //}

        public void SubFormInit(string Pformuid, string pCol, string ColName, string Col, string FRCol = "", string TOCol = "")
        {
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.Item(formuid);
            oForm.Freeze(true);
            this.Act1_FormInit(Pformuid, pCol, ColName, Col, FRCol, TOCol);
            oForm.Freeze(false);
        }
예제 #4
0
 public virtual void ET_OnAfterMenuClick(MenuEvent pVal) 
 {
     oForm = B1Connections.theAppl.Forms.Item(formuid);
     oForm.Freeze(true);
     this.Act1_FormInit(oForm);
     oForm.Freeze(false);
     // ADD YOUR ACTION CODE HERE ...
 }
예제 #5
0
        /// <summary>
        /// 화면 팝업에 필요한 설정정보를 호출합니다.
        /// </summary>
        private void Act1_FormInit() {
            // '// ADD YOUR ACTION CODE HERE ...
            oForm = B1Connections.theAppl.Forms.Item(formuid);

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

            oForm.Visible = true;
        }
예제 #6
0
        private void ClearUnManagedObject() {
			if ( oButton != null ) { Marshal.ReleaseComObject(oButton); } oButton = null;
            if ((oForm != null)) {
                Marshal.ReleaseComObject(oForm);
            }
            oForm = null;
            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }
예제 #7
0
 /// <summary>
 /// 화면 팝업에 필요한 설정정보를 호출합니다.
 /// </summary>
 private void Act1_FormInit()
 {
     oForm = B1Connections.theAppl.Forms.ActiveForm;
     oForm.Freeze(true);
     Act2_DataSourcesBinding(oForm);
     Act3_DefualtSetting(oForm);
     //Act4_FormMenuSetting(oForm);
     //FindData(false)
     oForm.Freeze(false);
 }
예제 #8
0
 /// <summary>
 /// 화면 팝업에 필요한 설정정보를 호출합니다.
 /// </summary>
 private void Act1_FormInit()
 {
     // '// ADD YOUR ACTION CODE HERE ...
     oForm = B1Connections.theAppl.Forms.ActiveForm;
     oForm.Freeze(true);
     Act2_DataSourcesBinding(oForm);
     Act3_DefualtSetting(oForm, "");
     Act4_FormMenuSetting(oForm);
     //FindData(false)
     oForm.Freeze(false);
 }
예제 #9
0
        //protected KIS_SO0031F_HRD(string strFormType, string strFormUID, bool bAddOn)
        //    : base(strFormType, strFormUID, bAddOn)
        //{
        //}

        //[B1Listener(BoEventTypes.et_MENU_CLICK, true, ActionType.Mnu)]
        //public virtual bool ET_BFMenuClick(MenuEvent pVal) {
        //    // ADD YOUR ACTION CODE HERE ...
        //    return this.LoadForm();
        //}

        //[B1Listener(BoEventTypes.et_MENU_CLICK, false, ActionType.Mnu)]
        //public virtual void ET_OnAfterMenuClick(MenuEvent pVal) {
        //    oForm.Freeze(true);
        //    this.Act1_FormInit();
        //    oForm.Freeze(false);
        //    // ADD YOUR ACTION CODE HERE ...
        //}

        public void A00_SubFormInit(string pStrPFormUID, Dictionary<string, string> pParamDict)
        {
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            oForm.Freeze(true);

            Act02_DataSourcesBinding(oForm);
            Act03_DefualtSetting(oForm, pStrPFormUID, pParamDict);

            oForm.Freeze(false);
        }
예제 #10
0
        /// <summary>
        /// 화면 팝업에 필요한 설정정보를 호출합니다.
        /// </summary>
        public void A00_SubFormInit(string pStrPFormUID)
        {
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            oForm.Freeze(true);

            Act02_DataSourcesBinding(oForm);
            Act03_DefualtSetting(oForm, pStrPFormUID);
            Act04_FormMenuSetting();
            oForm.Freeze(false);
        }
예제 #11
0
        /// <summary>
        /// 화면 팝업에 필요한 설정정보를 호출합니다.
        /// </summary>
        public void Act0_SubFormInit(string pStrPFormUID)
        {
            // '// ADD YOUR ACTION CODE HERE ...
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            SAPbouiCOM.Form pForm = B1Connections.theAppl.Forms.Item(pStrPFormUID);
            pForm.DataSources.UserDataSources.Item("cFormDOC").Value = oForm.UniqueID;

            this.Act2_DataSourcesBinding();
            this.Act3_DefualtSetting(oForm, pStrPFormUID);
            this.Act4_FormMenuSetting();
        }
예제 #12
0
        public virtual void ET_AFDataMenu_Add(MenuEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            // ADD YOUR ACTION CODE HERE ...

            try
            {
                SetAddedDefualtFormat();
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
예제 #13
0
        public void Act0_SubFormInit(string pStrPFormUID, string pDocEntry, string sDocEntry = "")
        {
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.ActiveForm;

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

            // UserDataSource 가 있는지 체크한다.(모달팝업여부)
            if (FN.GetUserDataSourceExistsChk(pForm, "cFORMUID"))
                pForm.DataSources.UserDataSources.Item("cFORMUID").Value = oForm.UniqueID;

            oForm.Freeze(true);
            Act2_DataSourcesBinding(oForm);
            Act3_DefualtSetting(oForm, pStrPFormUID, pDocEntry, sDocEntry);
            Act4_FormMenuSetting(oForm);

            oForm.Freeze(false);
        }
예제 #14
0
        public void SubFormInit(string KeyValue)
        {
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.Item(formuid);
            oForm.Freeze(true);
            this.Act1_FormInit();

            oForm.Freeze(false);
            oForm.Visible = true;

            oForm.Mode = BoFormMode.fm_FIND_MODE;
            oEditText = (SAPbouiCOM.EditText)oForm.Items.Item("edtCODE").Specific;
            oEditText.Value = KeyValue;

            SAPbouiCOM.Item oItem = oForm.Items.Item("1");
            oItem.Click();

            oItem = null;

        }
예제 #15
0
 public virtual bool ET_1_BFItemPressed(ItemEvent pVal) {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("1").Specific));
     // ADD YOUR ACTION CODE HERE ...
     try
     {
         switch (oForm.Mode)
         {
             case BoFormMode.fm_ADD_MODE:
                 if (CheckValues() == false)
                 {
                     return false;
                 }
                 break;
             case BoFormMode.fm_EDIT_MODE:
                 break;
             case BoFormMode.fm_FIND_MODE:
                 break;
             case BoFormMode.fm_OK_MODE:
                 
                 break;
             case BoFormMode.fm_PRINT_MODE:
                 break;
             case BoFormMode.fm_UPDATE_MODE:
                 if (CheckValues() == false)
                 {
                     return false;
                 }
                 break;
             case BoFormMode.fm_VIEW_MODE:
                 break;
             default:
                 break;
         }
     }
     catch (Exception ex)
     {
         B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
     }
     return true;
 }
예제 #16
0
        public override void OnAfterChooseFromList(SAPbouiCOM.Form form, ChooseFromListEvent chooseEvent, ChooseFromList choose, ref ItemEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;

            var dataTable = chooseEvent.SelectedObjects;
            var mtx       = ((Matrix)form.Items.Item(_matriz.ItemUID).Specific);

            var itemcode = dataTable.GetValue("ItemCode", 0);
            var itemname = dataTable.GetValue("ItemName", 0);

            if (ItemJaFoiUsado(itemcode, mtx))
            {
                Dialogs.PopupError($"O Item '{itemcode}' - '{itemname}' já foi usado.");
            }
            else
            {
                mtx.SetCellWithoutValidation(pVal.Row, _matriz._codigoItem.ItemUID, itemcode);
                mtx.SetCellWithoutValidation(pVal.Row, _matriz._nomeItem.ItemUID, itemname);

                ChangeFormMode(form);
            }
        }
예제 #17
0
        public void LlenarChkForms(string oForm)
        {
            if (oForm == "BOPC")
            {
                SAPbouiCOM.Form oFormBOPC = null;
                oFormBOPC = sboapp.Forms.Item("BOPC");
                //oForm = sboapp.Forms.ActiveForm;
                SAPbouiCOM.CheckBox chk01 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_ProySN").Specific;
                SAPbouiCOM.CheckBox chk02 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim1SN").Specific;
                SAPbouiCOM.CheckBox chk03 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim2SN").Specific;
                SAPbouiCOM.CheckBox chk04 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim3SN").Specific;
                SAPbouiCOM.CheckBox chk05 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim4SN").Specific;
                SAPbouiCOM.CheckBox chk06 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim5SN").Specific;
                EditText            txt01 = (EditText)oFormBOPC.Items.Item("BO_Proy").Specific;
                EditText            txt02 = (EditText)oFormBOPC.Items.Item("BO_Dim1").Specific;
                EditText            txt03 = (EditText)oFormBOPC.Items.Item("BO_Dim2").Specific;
                EditText            txt04 = (EditText)oFormBOPC.Items.Item("BO_Dim3").Specific;
                EditText            txt05 = (EditText)oFormBOPC.Items.Item("BO_Dim4").Specific;
                EditText            txt06 = (EditText)oFormBOPC.Items.Item("BO_Dim5").Specific;
                //ComboBox cbx01 = (ComboBox)oFormBOPC.Items.Item("BO_Activo").Specific;
                //ComboBox cbx02 = (ComboBox)oFormBOPC.Items.Item("BO_Status").Specific;

                //cbx01.Select("Y");
                //cbx02.Select("B");
                chk01.Checked = false;
                chk02.Checked = false;
                chk03.Checked = false;
                chk04.Checked = false;
                chk05.Checked = false;
                chk06.Checked = false;

                txt01.Item.Enabled = false;
                txt02.Item.Enabled = false;
                txt03.Item.Enabled = false;
                txt04.Item.Enabled = false;
                txt05.Item.Enabled = false;
                txt06.Item.Enabled = false;
            }
        }
예제 #18
0
        public virtual void CreateForm(Application SboApp, SAPbobsCOM.Company cmp, string frmId)
        {
            formId       = frmId;
            oCompany     = cmp;
            oApplication = SboApp;

            oApplication.ItemEvent       += new _IApplicationEvents_ItemEventEventHandler(oApplication_ItemEvent);
            oApplication.RightClickEvent += new _IApplicationEvents_RightClickEventEventHandler(oApplication_RightClickEvent);
            oApplication.AppEvent        += new _IApplicationEvents_AppEventEventHandler(oApplication_AppEvent);
            oApplication.MenuEvent       += new _IApplicationEvents_MenuEventEventHandler(oApplication_MenuEvent);
            oApplication.FormDataEvent   += new _IApplicationEvents_FormDataEventEventHandler(oApplication_FormDataEvent);


            UDClass clsudo = Program.objHrmsUI;

            setFilter();
            oForm = oApplication.Forms.Item(frmId);

            string mnuId = frmId.Replace("frm_", "");

            //isFormReadOnly(mnuId);
        }
예제 #19
0
        public void SubFormInit(string KeyValue)
        {
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.Item(formuid);
            oForm.Freeze(true);
            this.Act1_FormInit();
            if (oForm.Mode != BoFormMode.fm_VIEW_MODE) { oForm.Mode = BoFormMode.fm_OK_MODE; }

            oForm.Freeze(false);
            oForm.Visible = true;

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

            for (int iLooper = 0; iLooper < oGrid.Rows.Count; iLooper++)
            {
                if (oGrid.DataTable.Columns.Item("Code").Cells.Item(oGrid.GetDataTableRowIndex(iLooper)).Value.ToString() == KeyValue)
                {
                    Veiw_Grid_SelectedRow(iLooper);
                    break;
                }
            }
        }
예제 #20
0
        /// <summary>
        /// Inicializa los componentes de la forma activa
        /// </summary>
        public void inicializarComponentes()
        {
            try
            {
                _oForma      = _Application.Forms.Item(formID);
                _oForma.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE;
                _oForma.Freeze(true);

                //Tipo de dato fecha inicial
                _oForma.DataSources.UserDataSources.Add(TXTFECHA_INICIAL, BoDataType.dt_DATE);
                _oTxtFechaInicial = (SAPbouiCOM.EditText)_oForma.Items.Item(TXTFECHA_INICIAL).Specific;
                _oTxtFechaInicial.DataBind.SetBound(true, "", TXTFECHA_INICIAL);

                //Tipo de dato fecha final
                _oForma.DataSources.UserDataSources.Add(TXTFECHA_FINAL, BoDataType.dt_DATE);
                _oTxtFechaFinal = (SAPbouiCOM.EditText)_oForma.Items.Item(TXTFECHA_FINAL).Specific;
                _oTxtFechaFinal.DataBind.SetBound(true, "", TXTFECHA_FINAL);

                //Tipo de dato Oficina
                _oForma.DataSources.UserDataSources.Add(TXT_OFICINA, BoDataType.dt_LONG_TEXT);
                _oTxtOficina = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_OFICINA).Specific;
                _oTxtOficina.DataBind.SetBound(true, "", TXT_OFICINA);

                //_oTxtOficina.Value = Extensor.ObtenerAlmacenOficina(_Company);
                _oTxtFechaInicial.Active = true;

                //Declarar DataTable
                _oForma.DataSources.DataTables.Add(DT_PRECONTRATOS);
            }
            catch (Exception ex)
            {
                _Application.MessageBox("Error al inicializar: " + ex.Message);
            }
            finally
            {
                _oForma.Freeze(false);
            }
        }
예제 #21
0
        /// <summary>
        /// Obtiene el reporte agregado en SAP
        /// </summary>
        private void CargarReporteArqueo()
        {
            try
            {
                _oRec = null;
                _oRec = _Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                SAPbouiCOM.Form     _formaRpt = null;
                SAPbouiCOM.EditText asistente = null;

                _oRec.DoQuery(@"SELECT  MenuUID
                                FROM    dbo.OCMN
                                WHERE   Name = 'Arqueos'
                                        AND Type = 'C'");
                _Application.ActivateMenuItem(_oRec.Fields.Item("MenuUID").Value);
                _formaRpt       = _Application.Forms.ActiveForm;
                asistente       = _formaRpt.Items.Item("1000003").Specific;
                asistente.Value = _oTxtCodigoAsociado.Value;
                _formaRpt.Items.Item(0).Click();
                _Application.Menus.Item("520").Activate();
            }
            catch (Exception ex)
            {
                throw new Exception("Error al cargar el reporte de Arqueo *CargarReporteArqueo* : " + ex.Message);
            }
            finally
            {
                try
                {
                    if (_oRec != null)
                    {
                        System.Runtime.InteropServices.Marshal.ReleaseComObject(_oRec);
                    }
                }
                catch (Exception)
                {
                }
            }
        }
예제 #22
0
        private void OApplication_ItemEvent(string FormUID, ref ItemEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            if (FormUID.Equals("frmComplex"))
            {
                oForm = oApplication.Forms.Item(FormUID);
                switch (pVal.EventType)
                {
                case BoEventTypes.et_ITEM_PRESSED:
                    if (pVal.ItemUID.Equals("Folder1"))
                    {
                        oForm.PaneLevel = 1;
                    }
                    else if (pVal.ItemUID.Equals("Folder2"))
                    {
                        oForm.PaneLevel = 2;
                    }

                    else if (pVal.ItemUID.Equals("Folder3"))
                    {
                        oForm.PaneLevel = 3;
                    }
                    break;

                case BoEventTypes.et_FORM_RESIZE:
                    oForm.Freeze(true);
                    ReorganizarItensNaTela();

                    oForm.Freeze(false);
                    oForm.Update();
                    break;

                case BoEventTypes.et_FORM_CLOSE:
                    System.Windows.Forms.Application.Exit();
                    break;
                }
            }
        }
        public static SAPbouiCOM.Grid AddGridAoFormulario(
            SAPbouiCOM.Form pForm
            , string pUID
            , int pLeft
            , int pWidth
            , int pTop
            , int pHeight
            , SAPbouiCOM.BoMatrixSelect pBoMatrixSelect
            , SAPbouiCOM.DataTable pDataTable)
        {
            SAPbouiCOM.Grid oGrid;

            SAPbouiCOM.Item oItem = pForm.Items.Add(pUID, SAPbouiCOM.BoFormItemTypes.it_GRID);
            oGrid               = ((SAPbouiCOM.Grid)(oItem.Specific));
            oGrid.Item.Left     = pLeft;
            oGrid.Item.Top      = pTop;
            oGrid.Item.Height   = pHeight;
            oGrid.Item.Width    = pWidth;
            oGrid.SelectionMode = pBoMatrixSelect;
            oGrid.DataTable     = pDataTable;

            return(oGrid);
        }
예제 #24
0
        public static string getValueFromComboBox(SAPbouiCOM.Form objForm, string sItemUID)
        {
            string sValor = "";

            try
            {
                SAPbouiCOM.ComboBox x;
                var y = (objForm.Items.Item(sItemUID).Specific);

                var j = ((SAPbouiCOM.ComboBox)y).Selected;
                if (((SAPbouiCOM.ComboBox)(objForm.Items.Item(sItemUID).Specific)).Selected != null)
                {
                    sValor = ((SAPbouiCOM.ComboBox)(objForm.Items.Item(sItemUID).Specific)).Selected.Value;
                }
            }
            catch (Exception e)
            {
                //ExceptionAddOn.GetInstance().throwException("HELPERS", "3.0", e);
                B1Connections.theAppl.SetStatusBarMessage(String.Format("Helpers.getValueFormUserDataSource - {0}", e.Message));
            }

            return(sValor);
        }
예제 #25
0
        /// <summary>
        /// Muestra el formulario seleccionado.
        /// </summary>
        /// <param name="formID">Nombre o ID de la forma.</param>
        /// <returns>Nombre del Formulario</returns>
        public SAPbouiCOM.Form showForm(string formID)
        {
            SAPbouiCOM.Form fForm = null;
            try
            {
                try
                {
                    LoadFromXML(formID);
                }
                catch { }

                fForm = _Application.Forms.Item(formID);
                fForm.Select();
                return(fForm);
            }
            catch (Exception ex)
            {
                return(fForm);
            }
            finally
            {
            }
        }
예제 #26
0
 /// <summary>
 /// Inicializa los componentes de la forma activa
 /// </summary>
 public void inicializarComponentes()
 {
     try
     {
         _oForma      = _Application.Forms.Item(formID);
         _oForma.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE;
         _oForma.Freeze(true);
         //Declarar DataTable
         _oForma.DataSources.DataTables.Add(DT_COMISIONES_COBRADORES);
         _oTxtCodeCobrador        = _oForma.Items.Item(TXTCODCOB).Specific;
         _oTxtNomCobrador         = _oForma.Items.Item(TXTNOMCOB).Specific;
         _oBotonUpdate            = _oForma.Items.Item(BTN_UPDATE).Specific;
         _oTxtCodeCobrador.Active = true;
     }
     catch (Exception ex)
     {
         _Application.MessageBox("Error al inicializar: " + ex.Message);
     }
     finally
     {
         _oForma.Freeze(false);
     }
 }
예제 #27
0
        /// <summary>
        /// GetDatails of row.
        /// TODO: The Details return only calendar type day.
        /// </summary>
        /// <param name="oForm"></param>
        /// <param name="row"></param>
        /// <returns></returns>
        public static DateTime GetDetailsDate(ref SAPbouiCOM.Form oForm, int row)
        {
            var typeOfCalendar = GetTypeOfCalendar(ref oForm);
            var date           = GetDate(ref oForm);

            if (typeOfCalendar == TypeOfCalendar.Day)
            {
                if (row == -1)
                {
                    row = 1;
                }

                var time = TimeSpan.FromMinutes(30 * (row - 1));
                date = date.Add(time);
            }
            else
            {
                k.Diagnostic.Error(LOG, null, $"GetDetailsDate is not implemented {typeOfCalendar} type");
            }


            return(date);
        }
예제 #28
0
        /// <summary>
        /// Eventos de la forma activa
        /// </summary>
        /// <param name="FormUID">Id de la forma</param>
        /// <param name="pVal">Propiedades de la forma</param>
        /// <param name="BubbleEvent">Evento true/false</param>
        public override void eventos(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool bubbleEvent)
        {
            bubbleEvent = true;
            try
            {
                if (pVal.BeforeAction == false && pVal.FormType == FRM_FACTURA_DE_PROVEEDOR)
                {
                    if (pVal.EventType == BoEventTypes.et_FORM_RESIZE)
                    {
                        _oForm = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        OcultarControlesVentana(_oForm);
                    }

                    if (pVal.EventType == BoEventTypes.et_FORM_CLOSE)
                    {
                        if (_oContadorFormas == 1)
                        {
                            _Application.ItemEvent -= new _IApplicationEvents_ItemEventEventHandler(SBO_Application_ItemEvent);
                            Dispose();
                            application          = null;
                            company              = null;
                            _oFacturaProveedores = false;
                            Addon.typeList.RemoveAll(p => p._forma == formID);
                            return;
                        }
                        else
                        {
                            _oContadorFormas -= 1;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en método 'eventos' *clsFacturaDeProveedores* : " + ex.Message);
            }
        }
예제 #29
0
        private void LoadXmlForm(string pStrFrmName)
        {
            System.Xml.XmlDocument lObjXmlDoc = new System.Xml.XmlDocument();
            string lStrPath = PathUtilities.GetCurrent("ModalForms") + "\\" + pStrFrmName + ".xml";

            lObjXmlDoc.Load(lStrPath);

            SAPbouiCOM.FormCreationParams lObjCreationPackage =
                (SAPbouiCOM.FormCreationParams)SAPbouiCOM.Framework.Application.SBO_Application.CreateObject
                    (SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams);


            lObjCreationPackage.XmlData = lObjXmlDoc.InnerXml;

            if (pStrFrmName.Equals(pStrFrmName))
            {
                if (!lObjUtility.FormExists(pStrFrmName))
                {
                    lObjCreationPackage.UniqueID    = pStrFrmName;
                    lObjCreationPackage.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed;
                    lObjCreationPackage.Modality    = SAPbouiCOM.BoFormModality.fm_Modal;
                    lObjCreationPackage.FormType    = pStrFrmName;

                    mObjMFreights         = SAPbouiCOM.Framework.Application.SBO_Application.Forms.AddEx(lObjCreationPackage);
                    mObjMFreights.Title   = "Busqueda de rutas";
                    mObjMFreights.Left    = 400;
                    mObjMFreights.Top     = 100;
                    mObjMFreights.Mode    = SAPbouiCOM.BoFormMode.fm_OK_MODE;
                    mObjMFreights.Visible = true;
                    InitializeXmlForm();
                }
            }
            else
            {
                mObjMFreights.Select();
            }
        }
예제 #30
0
        /// <summary>
        /// Eventos de la forma activa
        /// </summary>
        /// <param name="FormUID">Id de la forma</param>
        /// <param name="pVal">Propiedades de la forma</param>
        /// <param name="BubbleEvent">Evento true/false</param>
        public override void eventos(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool bubbleEvent)
        {
            bubbleEvent = true;
            try
            {
                if (pVal.BeforeAction == false && pVal.FormType == FRM_SELECCIONAR_NUMEROS_DE_SERIE)
                {
                    if (pVal.EventType == BoEventTypes.et_FORM_CLOSE)
                    {
                        _Application.ItemEvent -= new _IApplicationEvents_ItemEventEventHandler(SBO_Application_ItemEvent);
                        Dispose();
                        application = null;
                        company     = null;
                        _oSeleccionarNumerosDeSerie = false;
                        Addon.typeList.RemoveAll(p => p._forma == formID);
                        return;
                    }

                    if (pVal.EventType == BoEventTypes.et_FORM_ACTIVATE && pVal.ActionSuccess == true)
                    {
                        _oForm      = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        _oTxtFiltro = _oForm.Items.Item(CAMPO_FILTRO).Specific;
                        if (ProcesoActivo == false)
                        {
                            if (lDatosTransferenciaStock.Count != 0)
                            {
                                AsignarNumerosDeSeries(_oForm);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en método 'eventos' *clsSeleccionarNumerosDeSerie* : " + ex.Message);
            }
        }
        public static SAPbouiCOM.Button AddBotaoAoFormulario(
            SAPbouiCOM.Form pForm
            , string pUID
            , int pLeft
            , int pWidth
            , int pTop
            , int pHeight
            , string pCaption
            )
        {
            SAPbouiCOM.Button oButton = null;
            SAPbouiCOM.Item   oItem   = null;
            oItem                 = pForm.Items.Add(pUID, SAPbouiCOM.BoFormItemTypes.it_BUTTON);
            oItem.Left            = pLeft;
            oItem.Width           = pWidth;
            oItem.Top             = pTop;
            oItem.Height          = pHeight;
            oItem.AffectsFormMode = false;

            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Caption = pCaption;

            return(oButton);
        }
예제 #32
0
        private bool MatrizEstaValida(SAPbouiCOM.Form form, DBDataSource dbdts, Matriz matriz)
        {
            try
            {
                ValidarMatriz(dbdts, matriz);
            }
            catch (FormValidationException e)
            {
                Dialogs.MessageBox(e.Message);
                var mtx = GetMatrix(form, matriz.ItemUID);
                if (mtx.RowCount > 0)
                {
                    mtx.Columns.Item(e.Campo).Cells.Item(e.DatasourceRow + 1).Click();
                }

                return(false);
            }
            catch (Exception e)
            {
                Dialogs.PopupError("Erro interno. Erro ao tentar atribuir valores da matriz ao formulário.\nErro: " + e.Message);
                return(false);
            }
            return(true);
        }
예제 #33
0
        private void addMenuItemsToForm(SAPbouiCOM.Form pMenuForm)

        {
            SAPbouiCOM.MenuCreationParams oMenuCreationParams = null;
            oMenuCreationParams = (SAPbouiCOM.MenuCreationParams)(oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams));

            string sPath = null;

            sPath = Application.StartupPath;

            oMenuCreationParams.Type     = BoMenuType.mt_STRING;
            oMenuCreationParams.UniqueID = "menuGoTo1";
            oMenuCreationParams.String   = "Menu Relativo ao form";
            //oMenuCreationParams.Enabled = true;
            oMenuCreationParams.Image = sPath + @"\\UT1.bmp";


            try
            {
                pMenuForm.Menu.AddEx(oMenuCreationParams);
            }
            catch (Exception ex)
            {
                oMenuCreationParams.UniqueID = "mnuGoTo2";
                oMenuCreationParams.String   = "Menu Relativo ao form 2";
                oMenuCreationParams.Image    = sPath + @"\\UI2.bmp";
            }
            try
            {
                pMenuForm.Menu.AddEx(oMenuCreationParams);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
예제 #34
0
        private void PreencherDadosMatriz(SAPbouiCOM.Form form, Matrix mtx, DBDataSource dbdts)
        {
            dbdts.Clear();

            using (var recordset = new RecordSet())
            {
                var rs = recordset.DoQuery("SELECT * FROM [@UPD_CONF_PENEIRA] ORDER BY CONVERT(INT,Code)");
                if (rs.RecordCount > 0)
                {
                    while (!rs.EoF)
                    {
                        var code        = rs.Fields.Item("Code").Value;
                        var peneira     = rs.Fields.Item(_matriz._peneira.Datasource).Value;
                        var nomePeneira = rs.Fields.Item(_matriz._nomepeneira.Datasource).Value;
                        var ativo       = rs.Fields.Item(_matriz._ativo.Datasource).Value;

                        dbdts.InsertRecord(dbdts.Size);

                        int row = dbdts.Size - 1;

                        dbdts.SetValue("Code", row, code);
                        dbdts.SetValue(_matriz._peneira.Datasource, row, peneira);
                        dbdts.SetValue(_matriz._nomepeneira.Datasource, row, nomePeneira);
                        dbdts.SetValue(_matriz._ativo.Datasource, row, ativo);

                        rs.MoveNext();
                    }

                    mtx.LoadFromDataSourceEx();
                }
                else
                {
                    _matriz.AdicionarLinha(form);
                }
            }
        }
예제 #35
0
        private void CriarEDesenharCampoEmbalagem(SAPbouiCOM.Form form)
        {
            var itemRefUID = "2034";
            var itemRef    = form.Items.Item(itemRefUID);

            var itemLabelRefUID = "2051";
            var itemLabelRef    = form.Items.Item(itemLabelRefUID);

            var       comboEmbalagem = form.Items.Add(_embalagem.ItemUID, BoFormItemTypes.it_COMBO_BOX);
            const int Pane           = 8;

            comboEmbalagem.FromPane = Pane;
            comboEmbalagem.ToPane   = Pane;

            int comboTop = itemRef.Top + 15;

            comboEmbalagem.Top         = comboTop;
            comboEmbalagem.Left        = itemRef.Left;
            comboEmbalagem.Width       = itemRef.Width;
            comboEmbalagem.DisplayDesc = true;

            ((ComboBox)comboEmbalagem.Specific).DataBind.SetBound(true, mainDbDataSource, _embalagem.Datasource);

            var labelGrupoAprovador = form.Items.Add("L_Packg", BoFormItemTypes.it_STATIC);

            labelGrupoAprovador.FromPane = Pane;
            labelGrupoAprovador.ToPane   = Pane;
            labelGrupoAprovador.Top      = comboTop;
            labelGrupoAprovador.Left     = itemLabelRef.Left;
            labelGrupoAprovador.Width    = itemLabelRef.Width;
            labelGrupoAprovador.LinkTo   = comboEmbalagem.UniqueID;

            ((StaticText)labelGrupoAprovador.Specific).Caption = "Embalagem";

            _embalagem.Popular(form);
        }
        public static SAPbouiCOM.Matrix AddMatrixAoFormulario(
            SAPbouiCOM.Form pForm
            , string pUID
            , int pLeft
            , int pWidth
            , int pTop
            , int pHeight
            , SAPbouiCOM.BoMatrixSelect pBoMatrixSelect)
        {
            SAPbouiCOM.Item   oItem;
            SAPbouiCOM.Matrix oMatrix;

            oItem = pForm.Items.Add(pUID, SAPbouiCOM.BoFormItemTypes.it_MATRIX);
            if (pLeft > 0)
            {
                oItem.Left = pLeft;
            }
            if (pWidth > 0)
            {
                oItem.Width = pWidth;
            }
            if (pTop > 0)
            {
                oItem.Top = pTop;
            }
            if (pHeight > 0)
            {
                oItem.Height = pHeight;
            }



            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.SelectionMode = pBoMatrixSelect;
            return(oMatrix);
        }
예제 #37
0
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

            try
            {
                oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
                //FSBOf.LoadForm(xmlPath, 'VID_Entrega.srf', Uid);
                oForm = FSBOApp.Forms.Item(uid);
                //Flag := false;
                oForm.Freeze(true);
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                oForm.Visible = true;
                oForm.Freeze(false);
            }
            return(Result);
        }//fin InitForm
예제 #38
0
        public void OnMenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool Bubble)
        {
            Bubble = true;
            try
            {
                if (pVal.BeforeAction == true)
                {
                    SAPbouiCOM.Form oForm = null;

                    oForm = eCommon.SBO_Application.Forms.ActiveForm;
                    String sXML = oForm.GetAsXML();
                    switch (pVal.MenuUID)
                    {
                    case "1293":
                        break;

                    case "1285":            //Restore Form
                        break;
                    }
                }
                else
                {
                    //After Menu
                    SAPbouiCOM.Form oActiveForm = null;
                    switch (pVal.MenuUID)
                    {
                    case "1293":            //Delete Row Menu
                        oActiveForm = eCommon.SBO_Application.Forms.ActiveForm;
                        break;

                    case "1282":        //Add Menu pressed
                        oActiveForm = eCommon.SBO_Application.Forms.ActiveForm;
                        break;

                    case "1281":       //Find Menu
                        oActiveForm = eCommon.SBO_Application.Forms.ActiveForm;
                        break;

                    default:
                        FormAttribute oAttrib = Forms[pVal.MenuUID] as FormAttribute;
                        if (oAttrib != null)
                        {
                            try
                            {
                                //Execute the constructor
                                System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
                                Type oType = asm.GetType(oAttrib.TypeName);
                                System.Reflection.ConstructorInfo ctor = oType.GetConstructor(new Type[0]);
                                if (ctor != null)
                                {
                                    object oForm = ctor.Invoke(new Object[0]);
                                }
                                else
                                {
                                    throw new Exception("No default constructor found for form type - " + oAttrib.FormType);
                                }
                            }
                            catch (Exception Ex)
                            {
                                eCommon.SBO_Application.MessageBox(Ex.Message);
                            }
                        }
                        break;
                    }
                }
            }
            catch (Exception Ex)
            {
                eCommon.SBO_Application.StatusBar.SetText(Ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
예제 #39
0
        public virtual void ET_btnFIND_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnFIND").Specific));
            // ADD YOUR ACTION CODE HERE ...

            // 추가중인 행 삭제
            DataTableDeleteRows("I");

            // 조회
            FindData(oForm);

            // 상담이력 조회
            FindSubData(oForm, 0);
        }
예제 #40
0
        public virtual void ET_AFFormClose(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...

            // 결재방법 팝업 닫기
            string strCFormUID = oForm.DataSources.UserDataSources.Item("cFORMUID").Value.ToString();
            if (FN.GetFormExistsChk(strCFormUID))
            {
                B1Connections.theAppl.Forms.Item(strCFormUID).Close();
            }

            // 주소 팝업창 닫기
            KIS_SO0000F_HRD.CloseForm(oForm.UniqueID);
        }
        public new bool InitForm(string uid, string xmlPath, ref SAPbouiCOM.Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 CantRol;

            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

            oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            Funciones.SBO_f = FSBOf;
            try
            {
                Lista = new List <string>();
                FSBOf.LoadForm(xmlPath, "VID_FEMonDTE.srf", uid);
                //EnableCrystal := true;
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;       // afm_All
                oForm.EnableMenu("1282", false); //Crear
                oForm.EnableMenu("1281", false); //Actualizar

                // Ok Ad  Fnd Vw Rq Sec
                //Lista.Add('DocNum    , f,  f,  t,  f, n, 1');
                //Lista.Add('DocDate   , f,  t,  f,  f, r, 1');
                //Lista.Add('CardCode  , f,  t,  t,  f, r, 1');
                //FSBOf.SetAutoManaged(var oForm, Lista);

                oDBDSHC = oForm.DataSources.DBDataSources.Add("@VID_FEDTECPRA");
                oDBDSHV = oForm.DataSources.DBDataSources.Add("@VID_FEDTEVTA");

                oForm.DataSources.UserDataSources.Add("FechaD", BoDataType.dt_DATE, 10);
                oEditText = (EditText)(oForm.Items.Item("FechaD").Specific);
                oEditText.DataBind.SetBound(true, "", "FechaD");
                oEditText.Value = DateTime.Now.ToString("yyyyMMdd");

                oForm.DataSources.UserDataSources.Add("FechaH", BoDataType.dt_DATE, 10);
                oEditText = (EditText)(oForm.Items.Item("FechaH").Specific);
                oEditText.DataBind.SetBound(true, "", "FechaH");
                oEditText.Value = DateTime.Now.ToString("yyyyMMdd");

                oComboBox = (ComboBox)(oForm.Items.Item("TipoDTE").Specific);
                oForm.DataSources.UserDataSources.Add("TipoDTE", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "TipoDTE");
                oComboBox.ValidValues.Add("V", "Venta");
                oComboBox.ValidValues.Add("C", "Compra");
                oComboBox.Select("V", BoSearchKey.psk_ByValue);
                oForm.Items.Item("TipoDTE").DisplayDesc = true;

                oDataTable      = oForm.DataSources.DataTables.Add("dt");
                oGrid           = (Grid)(oForm.Items.Item("grid").Specific);
                oGrid.DataTable = oDataTable;

                DSOpFec = oForm.DataSources.UserDataSources.Add("FechaEmi", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1);
                ((OptionBtn)oForm.Items.Item("FechaEmi").Specific).DataBind.SetBound(true, "", "FechaEmi");

                ((OptionBtn)oForm.Items.Item("FechaRecep").Specific).DataBind.SetBound(true, "", "FechaEmi");
                ((OptionBtn)oForm.Items.Item("FechaRecep").Specific).GroupWith("FechaEmi");
                ((OptionBtn)oForm.Items.Item("FechaEmi").Specific).Selected = true;


                oComboBox = (ComboBox)(oForm.Items.Item("Cliente").Specific);
                oForm.DataSources.UserDataSources.Add("Cliente", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "Cliente");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT 'Todos' Code, 'Todos' Name UNION ALL 
                          SELECT T1.FldValue Code, T1.Descr Name
                          FROM CUFD T0
                          JOIN UFD1 T1 ON T1.TableID = T0.TableID
                                      AND T1.FieldID = T0.FieldID
                         WHERE T0.TableID = '{0}'
                           AND T0.AliasID = 'EstadoC'";
                }
                else
                {
                    s = @"SELECT 'Todos' ""Code"", 'Todos' ""Name"" FROM DUMMY UNION ALL
                          SELECT T1.""FldValue"" ""Code"", T1.""Descr"" ""Name""
                          FROM ""CUFD"" T0
                          JOIN ""UFD1"" T1 ON T1.""TableID"" = T0.""TableID""
                                      AND T1.""FieldID"" = T0.""FieldID""
                         WHERE T0.""TableID"" = '{0}'
                           AND T0.""AliasID"" = 'EstadoC'";
                }
                s = String.Format(s, "@VID_FEDTEVTA");
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo(oComboBox, ref oRecordSet, false);
                oComboBox.Select("Todos", BoSearchKey.psk_ByValue);

                oComboBox = (ComboBox)(oForm.Items.Item("SII").Specific);
                oForm.DataSources.UserDataSources.Add("SII", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "SII");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT 'Todos' Code, 'Todos' Name UNION ALL
                          SELECT T1.FldValue Code, T1.Descr Name
                          FROM CUFD T0
                          JOIN UFD1 T1 ON T1.TableID = T0.TableID
                                      AND T1.FieldID = T0.FieldID
                         WHERE T0.TableID = '{0}'
                           AND T0.AliasID = 'EstadoSII'";
                }
                else
                {
                    s = @"SELECT 'Todos' ""Code"", 'Todos' ""Name"" FROM DUMMY UNION ALL
                          SELECT T1.""FldValue"" ""Code"", T1.""Descr"" ""Name""
                          FROM ""CUFD"" T0
                          JOIN ""UFD1"" T1 ON T1.""TableID"" = T0.""TableID""
                                      AND T1.""FieldID"" = T0.""FieldID""
                         WHERE T0.""TableID"" = '{0}'
                           AND T0.""AliasID"" = 'EstadoSII'";
                }
                s = String.Format(s, "@VID_FEDTEVTA");
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo(oComboBox, ref oRecordSet, false);
                oComboBox.Select("Todos", BoSearchKey.psk_ByValue);

                oComboBox = (ComboBox)(oForm.Items.Item("Ley").Specific);
                oForm.DataSources.UserDataSources.Add("Ley", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "Ley");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT 'Todos' Code, 'Todos' Name UNION ALL
                          SELECT T1.FldValue Code, T1.Descr Name
                          FROM CUFD T0
                          JOIN UFD1 T1 ON T1.TableID = T0.TableID
                                      AND T1.FieldID = T0.FieldID
                         WHERE T0.TableID = '{0}'
                           AND T0.AliasID = 'EstadoLey'";
                }
                else
                {
                    s = @"SELECT 'Todos' ""Code"", 'Todos' ""Name"" FROM DUMMY UNION ALL
                          SELECT T1.""FldValue"" ""Code"", T1.""Descr"" ""Name""
                          FROM ""CUFD"" T0
                          JOIN ""UFD1"" T1 ON T1.""TableID"" = T0.""TableID""
                                      AND T1.""FieldID"" = T0.""FieldID""
                         WHERE T0.""TableID"" = '{0}'
                           AND T0.""AliasID"" = 'EstadoLey'";
                }
                s = String.Format(s, "@VID_FEDTEVTA");
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo(oComboBox, ref oRecordSet, false);
                oComboBox.Select("Todos", BoSearchKey.psk_ByValue);

                BuscarDatos();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                if (oForm != null)
                {
                    oForm.Freeze(false);
                }
            }


            return(Result);
        }//fin InitForm
예제 #42
0
        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 ...
            if ((oGrid.Rows.Count > 0) && (pVal.Row >= 0))
            {
                oGrid.Rows.SelectedRows.Add(pVal.Row);
            }

        }
예제 #43
0
        public virtual bool ET_grd_BFMatrixLinkPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oGrid = ((SAPbouiCOM.Grid)(oForm.Items.Item("grd").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                int oRowIndex = oGrid.GetDataTableRowIndex(pVal.Row);
                string KeyValue = string.Empty;

                switch (pVal.ColUID)
                {
                    case "DocEntry":
                        KeyValue = FN.GetGridCellValue(ref oGrid, "DocEntry", pVal.Row);
                        LoadSubForm(oForm, "KIS_SD0080_HRD", KeyValue);
                        return false;
                    default:
                        break;
                }
            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return true;
        }
예제 #44
0
        public virtual void ET_AFFormClose(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...

            // 결재방법 팝업 닫기
            string strCFormUID = oForm.DataSources.UserDataSources.Item("cFORMUID").Value.ToString();
            if (FN.GetFormExistsChk(strCFormUID))
            {
                B1Connections.theAppl.Forms.Item(strCFormUID).Items.Item("2").Click(BoCellClickType.ct_Regular);
            }
        }
예제 #45
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act03_DefualtSetting(SAPbouiCOM.Form oForm, string pStrPFormUID)
        {
            try
            {
                //메트릭스 첫줄 선택시 팝업박스 뜨는것 막는다.
                oForm.Settings.EnableRowFormat = false;
                // UDO, 네비게이션 사용하지 않음
                oForm.SupportedModes = 1;

                // 메트릭스 설정
                oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific;
                oGrid.SelectionMode = BoMatrixSelect.ms_Auto;

                // 부모창 ID 저장
                oForm.DataSources.UserDataSources.Item("pFORMUID").Value = pStrPFormUID;

                // 부보창에 현재창 ID 저장
                pForm = B1Connections.theAppl.Forms.Item(pStrPFormUID);
                pForm.DataSources.UserDataSources.Item("cFORMUID").Value = oForm.UniqueID;

                oForm.DataSources.DataTables.Add("grd");
                FindData(oForm);
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #46
0
        private void CreateForm()
        {
            SAPbouiCOM.FormCreationParams oCP = null;
            SAPbouiCOM.Item       oItem       = null;
            SAPbouiCOM.StaticText oStatic     = null;
            SAPbouiCOM.Button     oButton     = null;
            SAPbouiCOM.EditText   oEdit       = null;

            //  Setting the form creation params
            oCP             = ((SAPbouiCOM.FormCreationParams)(SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)));
            oCP.UniqueID    = "CFL3";
            oCP.FormType    = "CFL3";
            oCP.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable;


            //  Adding the form
            oForm       = SBO_Application.Forms.AddEx(oCP);
            oForm.Title = "Configuración";

            oItem           = oForm.Items.Add("StaticTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC);
            oItem.Left      = 10;
            oItem.Top       = 20;
            oItem.LinkTo    = "EditTxt";
            oItem.Width     = 200;
            oStatic         = ((SAPbouiCOM.StaticText)(oItem.Specific));
            oStatic.Caption = "Carpeta de archivos";


            oItem           = oForm.Items.Add("StaticTxt2", SAPbouiCOM.BoFormItemTypes.it_STATIC);
            oItem.Left      = 10;
            oItem.Top       = 50;
            oItem.LinkTo    = "EditTxt";
            oItem.Width     = 200;
            oStatic         = ((SAPbouiCOM.StaticText)(oItem.Specific));
            oStatic.Caption = "Kilometros recorridos";

            oItem        = oForm.Items.Add("txtKM", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oItem.Left   = 120;
            oItem.Top    = 50;
            oItem.LinkTo = "StaticTxt2";
            oEdit        = ((SAPbouiCOM.EditText)(oItem.Specific));


            oItem           = oForm.Items.Add("StaticTxt3", SAPbouiCOM.BoFormItemTypes.it_STATIC);
            oItem.Left      = 10;
            oItem.Top       = 80;
            oItem.LinkTo    = "EditTxt";
            oStatic         = ((SAPbouiCOM.StaticText)(oItem.Specific));
            oStatic.Caption = "Horas de motor";

            oItem        = oForm.Items.Add("txtHoras", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oItem.Left   = 120;
            oItem.Top    = 80;
            oItem.LinkTo = "StaticTxt3";
            oEdit        = ((SAPbouiCOM.EditText)(oItem.Specific));

            //  Adding a CFL button
            oItem           = oForm.Items.Add("btnGuardar", SAPbouiCOM.BoFormItemTypes.it_BUTTON);
            oItem.Left      = 120;
            oItem.Top       = 110;
            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Type    = SAPbouiCOM.BoButtonTypes.bt_Caption;
            oButton.Caption = "Guardar";
            oItem.Width     = 100;
            oItem.Height    = 20;


            oForm.Width  = 300;
            oForm.Height = 300;

            oForm.Visible = true;
        }
예제 #47
0
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

            try
            {
                oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
                FSBOf.LoadForm(xmlPath, "VID_FEIMPADIC.srf", uid);
                oForm                = FSBOApp.Forms.Item(uid);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;             // afm_All
                Flag = false;
                oForm.Freeze(true);

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select count(*) Cont from [@VID_FEIMPADIC]";
                }
                else
                {
                    s = @"select count(*) ""Cont"" from ""@VID_FEIMPADIC"" ";
                }
                oRecordSet.DoQuery(s);
                if ((System.Int32)(oRecordSet.Fields.Item("Cont").Value) > 0)
                {
                    oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                }
                else
                {
                    oForm.Mode = BoFormMode.fm_ADD_MODE;
                }


                oGrid       = (Grid)(oForm.Items.Item("3").Specific);
                oDBDSHeader = oForm.DataSources.DBDataSources.Add("@VID_FEIMPADIC");

                oDataTable = oForm.DataSources.DataTables.Add("Tax");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select Code, U_CodImpto, U_Desc, U_Porc from [@VID_FEIMPADIC]
                          UNION ALL 
                          select CAST('' as varchar(20)), CAST('' as varchar(20)), CAST('' as varchar(50)), 0";
                }
                else
                {
                    s = @"select ""Code"", ""U_CodImpto"", ""U_Desc"", ""U_Porc"" from ""@VID_FEIMPADIC""
                          UNION ALL
                          select CAST('' as varchar(20)), CAST('' as varchar(20)), CAST('' as varchar(50)), 0 FROM DUMMY ";
                }

                oDataTable.ExecuteQuery(s);
                oGrid.DataTable = oDataTable;

                oGrid.Columns.Item("Code").Type = BoGridColumnType.gct_ComboBox;
                oColumn = (GridColumn)(oGrid.Columns.Item("Code"));
                var oComboCol = (ComboBoxColumn)(oColumn);
                oComboCol.Editable            = true;
                oComboCol.TitleObject.Caption = "Impuesto SAP";

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select Code, Name from OSTA
                          UNION ALL
                          select WTCode 'Code', WTName 'Name' from OWHT where Inactive = 'N'";
                }
                else
                {
                    s = @"select ""Code"", ""Name"" from ""OSTA""
                          UNION ALL
                          select ""WTCode"" ""Code"", ""WTName"" ""Name"" from ""OWHT"" where ""Inactive"" = 'N' ";
                }

                oRecordSet.DoQuery(s);
                FSBOf.FillComboGrid((GridColumn)(oGrid.Columns.Item("Code")), ref oRecordSet, true);

                oGrid.Columns.Item("U_CodImpto").Type = BoGridColumnType.gct_EditText;
                oColumn = (GridColumn)(oGrid.Columns.Item("U_CodImpto"));
                var oEditCol = (EditTextColumn)(oColumn);
                oEditCol.Editable            = true;
                oEditCol.TitleObject.Caption = "Código Impto. SII";


                oGrid.Columns.Item("U_Desc").Type = BoGridColumnType.gct_EditText;
                oColumn                      = (GridColumn)(oGrid.Columns.Item("U_Desc"));
                oEditCol                     = (EditTextColumn)(oColumn);
                oEditCol.Editable            = true;
                oEditCol.TitleObject.Caption = "Descripción Impuesto";

                oGrid.Columns.Item("U_Porc").Type = BoGridColumnType.gct_EditText;
                oColumn                      = (GridColumn)(oGrid.Columns.Item("U_Porc"));
                oEditCol                     = (EditTextColumn)(oColumn);
                oEditCol.Editable            = true;
                oEditCol.TitleObject.Caption = "Porcentaje Retencion";
                oEditCol.RightJustified      = true;

                oGrid.AutoResizeColumns();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin InitForm
예제 #48
0
 public virtual void ET_AFFormLoad(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     // ADD YOUR ACTION CODE HERE ...
 }
예제 #49
0
        public virtual bool ET_BFFormClose(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...

            try
            {
                string pFORMUID = oForm.DataSources.UserDataSources.Item("pFORMUID").ValueEx;
                if (pFORMUID != "")
                {

                    SAPbouiCOM.Form pform = (SAPbouiCOM.Form)B1Connections.theAppl.Forms.Item(pFORMUID);
                    pform.DataSources.UserDataSources.Item("cFORMUID").ValueEx = "";
                    pform.Close();
                    pform = null;
                }

            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return true;

        }
예제 #50
0
        public virtual bool ET_btnSTOP_BFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnSTOP").Specific));
            // ADD YOUR ACTION CODE HERE ...
            string strNowDate = oForm.Items.Item("edtSTOPDT").Specific.Value; //oForm.DataSources.UserDataSources.Item("edtSTOPDT").ValueEx;

            if (String.IsNullOrEmpty(strNowDate))
            {
                B1Connections.theAppl.StatusBar.SetText("중지 일자가 입력되지 않았습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                //oForm.Items.Item("btnSTOP").Click(0);
                return false;
            }
            return true;
        }
예제 #51
0
        public virtual void ET_btnBACK_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnBACK").Specific));
            // ADD YOUR ACTION CODE HERE ...

            try
            {
                string strPFormUID = oForm.DataSources.UserDataSources.Item("pFORMUID").ValueEx;
                if (strPFormUID != "")
                {
                    oForm.Visible = false;
                    SAPbouiCOM.Form pForm = B1Connections.theAppl.Forms.Item(strPFormUID);
                    pForm.Select();
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
예제 #52
0
        public virtual void ET_btnLIST_AFItemPressed(ItemEvent pVal) 
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnLIST").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                string edtCode = oForm.Items.Item("edtCode").Specific.Value;

                if (String.IsNullOrEmpty(edtCode))
                {
                    B1Connections.theAppl.StatusBar.SetText("독자를 선택해주세요.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    return;
                }

                FindData_List(oForm, edtCode);
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
예제 #53
0
        public virtual bool ET_grd_BFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oGrid = ((SAPbouiCOM.Grid)(oForm.Items.Item("grd").Specific));
            // ADD YOUR ACTION CODE HERE ...

            if (pVal.Row == -1)
            {
                oGrid.SelectionMode = BoMatrixSelect.ms_None;
            }
            else { oGrid.SelectionMode = BoMatrixSelect.ms_Single; }

            return true;
        }
예제 #54
0
        public virtual void ET_AFFormDataLoad(BusinessObjectInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...

            // Data를 SystemDataTable에 담는다.
            SetSystemDataTable(oForm);

            // 신용카드인증키 패드워드타입 변경(패스워드 타입이 항상 ***으로 표시 되기때문에 데이터 있을때만 패스워드타입으로 없을때 일반 EditText타입으로)
            SetCreditKey_ItemAttribute(oForm);

            // 청구데이터를 조회한다.
            FindRequestData(oForm);
            
            // 선수금잔액 조회
            GetAdvanceAmt(oForm);

            FindSubData(oForm, 0, "Load");


            /* 테스트용
            System.Data.DataSet ds = new DataSet();
            ds.Tables.AddRange(new System.Data.DataTable[]{gDs.Tables[oForm.UniqueID + "_Deliver"], gDs.Tables[oForm.UniqueID + "_Call"]});
            ds.WriteXml(@"C:\\test.xml");
             */
        }
예제 #55
0
        public virtual void ET_OnFormResize(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...


            SAPbouiCOM.Item oItemRet = oForm.Items.Item("retFOLD");
            SAPbouiCOM.Item oItemGrd = oForm.Items.Item("grd");
            oGrid = oForm.Items.Item("grd").Specific;

            SAPbouiCOM.Item oItem1Mtx = oForm.Items.Item("mtx1_DUMY");
            SAPbouiCOM.Item oItem2Mtx = oForm.Items.Item("mtx2_DUMY");

            SAPbouiCOM.Item oItem3Mtx = oForm.Items.Item("mtx1_ORIG");
            SAPbouiCOM.Item oItem4Mtx = oForm.Items.Item("mtx2_ORIG");

            // 폴더박스 리사이즈
            oItemRet.Height = oForm.Height - 110;
            oItemRet.Width = oForm.Width - 30;

            // 상담이력 메트릭스
            oItem2Mtx.Top = oItem1Mtx.Height + 200;
            oItem2Mtx.Width = oForm.Width - 425;
            oItem2Mtx.Height = 140;

            // 청구데이터(그리드)
            oItemGrd.Top = oItem1Mtx.Height + 200;
            oItemGrd.Width = 360;
            oItemGrd.Height = 140;

            // 안보이는 메트릭스
            oItem3Mtx.Left = oForm.Width + 100;
            oItem4Mtx.Left = oForm.Width + 100;

            if (oGrid.Columns.Count > 0) oGrid.AutoResizeColumns();

            ((SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific).AutoResizeColumns();
            ((SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_DUMY").Specific).AutoResizeColumns();
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oCombo;
            SAPbouiCOM.GridColumn oColumn;
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

            try
            {
                oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
                Funciones.SBO_f = FSBOf;
                Lista           = new List <string>();

                FSBOf.LoadForm(xmlPath, "VID_FECAF.srf", uid);
                //EnableCrystal := true;
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;       // afm_All
                oForm.EnableMenu("1281", false); //Buscar
                oForm.EnableMenu("1282", false); //Crear

                //        VID_DelRow := true;
                //        VID_DelRowOK := true;

                //        oForm.DataBrowser.BrowseBy := "Code";
                oDBDSH     = oForm.DataSources.DBDataSources.Add("@VID_FECAF");
                ogrid      = (Grid)(oForm.Items.Item("grid").Specific);
                oDataTable = oForm.DataSources.DataTables.Add("dt");

                ogrid.DataTable = oDataTable;

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select ISNULL(U_MultiSoc,'N') MultiSoc from [@VID_FEPARAM]";
                }
                else
                {
                    s = @"select IFNULL(""U_MultiSoc"",'N') ""MultiSoc"" from ""@VID_FEPARAM"" ";
                }
                oRecordSet.DoQuery(s);
                if (oRecordSet.RecordCount > 0)
                {
                    if (((System.String)oRecordSet.Fields.Item("MultiSoc").Value).Trim() == "Y")
                    {
                        bMultiSoc = true;
                    }
                    else
                    {
                        bMultiSoc = false;
                    }
                }
                else
                {
                    bMultiSoc = false;
                }


                ActualizarGrilla();
                // Ok Ad  Fnd Vw Rq Sec
                //        Lista.Add('TipoDoc   , f,  t,  t,  f, r, 1');
                //        FSBOf.SetAutoManaged(var oForm, Lista);

                oForm.Mode = BoFormMode.fm_OK_MODE;
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin Initform
예제 #57
0
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 CantRol;

            SAPbouiCOM.Folder oFolder;
            SAPbouiCOM.Item   oItem;
            SAPbouiCOM.Item   oItemB;
            Boolean           Flag;


            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

            oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            Funciones.SBO_f = FSBOf;
            try
            {
                Lista = new List <string>();
                oForm = FSBOApp.Forms.Item(uid);
                Flag  = false;
                oForm.Freeze(true);

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = "select ISNULL(TaxIdNum,'') TaxIdNum from OADM ";
                }
                else
                {
                    s = @"select IFNULL(""TaxIdNum"",'') ""TaxIdNum"" from ""OADM"" ";
                }

                oRecordSet.DoQuery(s);
                if (oRecordSet.RecordCount == 0)
                {
                    throw new Exception("Debe ingresar RUC de Emisor, Gestión -> Inicialización Sistema -> Detalle Sociedad -> Datos de Contabilidad -> ID fiscal general 1");
                }
                else
                {
                    RUC = ((System.String)oRecordSet.Fields.Item("TaxIdNum").Value).Trim();
                }


                //Campo con el estado de DTE
                oItemB          = oForm.Items.Item("53");
                oItem           = oForm.Items.Add("lblEstado", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Left      = oItemB.Left;
                oItem.Width     = oItemB.Width;
                oItem.Top       = oItemB.Top + oItemB.Height + 5;
                oItem.Height    = oItem.Height;
                oItem.LinkTo    = "VID_FEEstado";
                oStatic         = (StaticText)(oForm.Items.Item("lblEstado").Specific);
                oStatic.Caption = "Estado Doc. Electronico";

                oItemB            = oForm.Items.Item("52");
                oItem             = oForm.Items.Add("VID_Estado", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX);
                oItem.Left        = oItemB.Left;
                oItem.Width       = oItemB.Width;
                oItem.Top         = oItemB.Top + oItemB.Height + 5;
                oItem.Height      = oItem.Height;
                oItem.DisplayDesc = true;
                oItem.Enabled     = false;
                oComboBox         = (ComboBox)(oForm.Items.Item("VID_Estado").Specific);

                //colocar folder con los campos necesarios en FE PERU
                //oForm.DataSources.UserDataSources.Add("VID_FEDCTO", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1);
                //oItem = oForm.Items.Add("VID_FEDCTO", SAPbouiCOM.BoFormItemTypes.it_FOLDER);

                //oItemB = oForm.Items.Item("1320002137");

                //oItem.Left = oItemB.Left + 30;
                //oItem.Width = oItemB.Width;
                //oItem.Top = oItemB.Top;
                //oItem.Height = oItem.Height;
                //oFolder = (Folder)((oItem.Specific));
                //oFolder.Caption = "Factura Electrónica";
                //oFolder.Pane = 333;
                //oFolder.DataBind.SetBound(true, "", "VID_FEDCTO");
                //para SAP 882 en adelante
                //oFolder.GroupWith("1320002137");

                //cargar campos de usuarios
                oItemB       = oForm.Items.Item("lblEstado");
                oItem        = oForm.Items.Add("lblPTSC", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Left   = oItemB.Left;
                oItem.Width  = oItemB.Width;
                oItem.Top    = oItemB.Top + oItemB.Height + 5;
                oItem.Height = oItemB.Height;
                //oItem.FromPane = 333;
                //oItem.ToPane = 333;
                oItem.LinkTo    = "VID_FEPTSC";
                oStatic         = (StaticText)(oForm.Items.Item("lblPTSC").Specific);
                oStatic.Caption = "Serie del documento";

                oItemB       = oForm.Items.Item("VID_Estado");
                oItem        = oForm.Items.Add("VID_FEPTSC", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oItem.Left   = oItemB.Left;
                oItem.Width  = 90; // oItemB.Width;
                oItem.Top    = oItemB.Top + oItemB.Height + 5;
                oItem.Height = oItemB.Height;
                //oItem.FromPane = 333;
                //oItem.ToPane = 333;
                oItem.RightJustified = true;
                oEditText            = (EditText)(oForm.Items.Item("VID_FEPTSC").Specific);
                oEditText.DataBind.SetBound(true, "OVPM", "U_BPP_PTSC");

                //--
                oItemB       = oForm.Items.Item("lblPTSC");
                oItem        = oForm.Items.Add("lblPTCC", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Left   = oItemB.Left;
                oItem.Width  = oItemB.Width;
                oItem.Top    = oItemB.Top + oItemB.Height + 5;
                oItem.Height = oItemB.Height;
                //oItem.FromPane = 333;
                //oItem.ToPane = 333;
                oItem.LinkTo    = "VID_FEPTCC";
                oStatic         = (StaticText)(oForm.Items.Item("lblPTCC").Specific);
                oStatic.Caption = "Correlativo del documento";

                oItemB       = oForm.Items.Item("VID_FEPTSC");
                oItem        = oForm.Items.Add("VID_FEPTCC", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oItem.Left   = oItemB.Left;
                oItem.Width  = 90; // oItemB.Width;
                oItem.Top    = oItemB.Top + oItemB.Height + 5;
                oItem.Height = oItemB.Height;
                //oItem.FromPane = 333;
                //oItem.ToPane = 333;
                oItem.RightJustified = true;
                oEditText            = (EditText)(oForm.Items.Item("VID_FEPTCC").Specific);
                oEditText.DataBind.SetBound(true, "OVPM", "U_BPP_PTCC");
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                if (oForm != null)
                {
                    oForm.Visible = true;
                    oForm.Freeze(false);
                }
            }


            return(Result);
        }//fin InitForm
예제 #58
0
        public static void clsSupplierPurchaseHistory_ItemEvent(ref SAPbouiCOM.Application oApplication, ref SAPbobsCOM.Company oCompany, SAPbouiCOM.Form oSetupForm, ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            if (oForm != null)
            {
                oForm = oSetupForm;
                SAPbouiCOM.Grid oGrid;
                oGrid   = (SAPbouiCOM.Grid)oForm.Items.Item("4").Specific;
                oMatrix = (SAPbouiCOM.Matrix)oSOForm.Items.Item("38").Specific;
                if (pVal.BeforeAction)
                {
                    switch (pVal.EventType)
                    {
                    //case BoEventTypes.et_FORM_CLOSE:
                    //    BubbleEvent = false;
                    //    oForm.Visible = false;
                    //    break;

                    case BoEventTypes.et_DOUBLE_CLICK:
                        if (pVal.ItemUID == "4")
                        {
                            string strSelCol = "";
                            strSelCol = oGrid.Columns.Item(pVal.ColUID).TitleObject.Caption.ToString();
                            string[] words = strSelCol.Split('-');
                            string[] words1;
                            if (words.Length == 2)
                            {
                                oForm.Freeze(true);
                                for (int i = 0; i < oGrid.Rows.Count; i++)
                                {
                                    if (oGrid.DataTable.GetValue(strSelCol, i).ToString().Trim() != "")
                                    {
                                        if (oGrid.DataTable.GetValue(strSelCol, i).ToString().Trim() != "0")
                                        {
                                            words1 = oGrid.DataTable.GetValue(strSelCol, i).ToString().Trim().Split(' ');
                                            if (words1[0].Trim() != "")
                                            {
                                                oGrid.DataTable.SetValue("Order Qty", i, words1[0].Trim());
                                            }
                                        }
                                    }
                                }
                                oForm.Freeze(false);
                            }
                        }
                        break;

                    case BoEventTypes.et_ITEM_PRESSED:
                        if (pVal.ItemUID == "2")
                        {
                            BubbleEvent   = false;
                            oForm.Visible = false;
                        }
                        if (pVal.ItemUID == "3")
                        {
                            flushAll();
                            BubbleEvent   = false;
                            oForm.Visible = false;
                            return;

                            oMatrix.Clear();
                            int j = oMatrix.RowCount;
                            if (j == 0)
                            {
                                oMatrix.AddRow(1, -1);
                            }
                            j = oMatrix.RowCount;

                            for (int i = 0; i < oGrid.Rows.Count; i++)
                            {
                                if (oGrid.DataTable.GetValue("Order Qty", i).ToString().Trim() != "")
                                {
                                    if (oGrid.DataTable.GetValue("Order Qty", i).ToString().Trim() != "0")
                                    {
                                        string strItemCode = oGrid.DataTable.GetValue("ItemCode", i).ToString().Trim();
                                        string strQty      = oGrid.DataTable.GetValue("Order Qty", i).ToString().Trim();
                                        string strPrice    = oGrid.DataTable.GetValue("Current Purchase Price", i).ToString().Trim();
                                        string strUoM      = oGrid.DataTable.GetValue("UoM", i).ToString().Trim();
                                        try
                                        {
                                            ((SAPbouiCOM.EditText)oMatrix.Columns.Item("1").Cells.Item(j).Specific).Value  = strItemCode;
                                            ((SAPbouiCOM.EditText)oMatrix.Columns.Item("11").Cells.Item(j).Specific).Value = strQty;
                                            try
                                            {
                                                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("1470002145").Cells.Item(j).Specific).Value = strUoM;
                                            }
                                            catch (Exception)
                                            {
                                            }
                                            try
                                            {
                                                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("14").Cells.Item(j).Specific).Value = strPrice;
                                            }
                                            catch (Exception)
                                            {
                                            }
                                            j++;
                                        }
                                        catch (Exception)
                                        {
                                            j++;
                                        }
                                    }
                                }
                            }

                            //oForm.Close();
                            oForm.Visible = false;
                        }
                        break;

                    case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST:
                        if (pVal.ItemUID == "4")
                        {
                            if (pVal.ColUID == "UoM")
                            {
                                if (oGrid.DataTable.GetValue("ItemCode", pVal.Row).ToString().Trim() != "")
                                {
                                    string squery = "Select T2.\"UomCode\",T2.\"UomName\" From OITM T0 Inner Join UGP1 T1 On T0.\"UgpEntry\" = T1.\"UgpEntry\" Inner Join OUOM T2 On T1.\"UomEntry\" = T2.\"UomEntry\" Where T0.\"ItemCode\" = '" + oGrid.DataTable.GetValue("ItemCode", pVal.Row).ToString().Trim() + "'";
                                    Utilities.UtilitiesCls.CFLConditionQuery(ref oApplication, ref oCompany, oForm, ref pVal, squery, "UomCode", "10010198", "UomCode", false, true, "4", "UoM", false);
                                }
                            }
                            if (pVal.ColUID == "ItemCode")
                            {
                                SAPbouiCOM.ChooseFromListCollection oCFLs = null;
                                SAPbouiCOM.Conditions oCons = null;
                                SAPbouiCOM.Condition  oCon  = null;
                                oCFLs = oForm.ChooseFromLists;
                                SAPbouiCOM.ChooseFromList oCFL = null;
                                oCFL = oCFLs.Item("CFL_2");

                                oCons = new Conditions();
                                oCFL.SetConditions(oCons);


                                oCons = oCFL.GetConditions();



                                oCon           = oCons.Add();
                                oCon.Alias     = "PrchseItem";
                                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                                oCon.CondVal   = "Y";

                                oCon.Relationship = BoConditionRelationship.cr_AND;
                                oCon           = oCons.Add();
                                oCon.Alias     = "frozenFor";
                                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_NOT_EQUAL;
                                oCon.CondVal   = "Y";


                                int intCnt = 2;
                                for (int i = 0; i < oGrid.Rows.Count; i++)
                                {
                                    if (oGrid.DataTable.GetValue("ItemCode", i).ToString().Trim() != "")
                                    {
                                        if (intCnt > 0)
                                        {
                                            oCon.Relationship = BoConditionRelationship.cr_AND;
                                        }
                                        oCon           = oCons.Add();
                                        oCon.Alias     = "ItemCode";
                                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_NOT_EQUAL;
                                        oCon.CondVal   = oGrid.DataTable.GetValue("ItemCode", i).ToString().Trim();
                                        intCnt        += 1;
                                    }
                                }

                                oCFL.SetConditions(oCons);
                            }
                        }
                        break;

                    default:
                        break;
                    }
                }
                else if (pVal.BeforeAction == false)
                {
                    switch (pVal.EventType)
                    {
                    case BoEventTypes.et_ITEM_PRESSED:
                        break;

                    case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST:
                        if (oForm.Mode != SAPbouiCOM.BoFormMode.fm_FIND_MODE)
                        {
                            if (pVal.ItemUID == "4")
                            {
                                if (pVal.ColUID == "ItemCode")
                                {
                                    oRecordSet = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(BoObjectTypes.BoRecordset);
                                    string strQry      = "";
                                    string strItemCode = "";
                                    oDataTable = UtilitiesCls.DataTable(ref oApplication, ref oCompany, oForm, ref pVal);
                                    if (oDataTable != null)
                                    {
                                        strItemCode = oDataTable.GetValue("ItemCode", 0).ToString();
                                    }
                                    if (strItemCode != "")
                                    {
                                        strQry = " Exec EJ_LoadBPItemDetails '" + ((SAPbouiCOM.EditText)oForm.Items.Item("6").Specific).Value.Trim() + "', '" + strItemCode + "'";
                                        oRecordSet.DoQuery(strQry);
                                        if (!oRecordSet.EoF)
                                        {
                                            oGrid.DataTable.SetValue("ItemCode", pVal.Row, strItemCode);
                                            oGrid.DataTable.SetValue("ItemName", pVal.Row, oRecordSet.Fields.Item("ItemName").Value.ToString());
                                            oGrid.DataTable.SetValue("Order Qty", pVal.Row, "");
                                            oGrid.DataTable.SetValue("UoM", pVal.Row, oRecordSet.Fields.Item("UoM").Value.ToString());
                                            oGrid.DataTable.SetValue("Current Purchase Price", pVal.Row, oRecordSet.Fields.Item("Current Price").Value.ToString());
                                        }
                                    }

                                    oGrid.DataTable.SetValue("ItemCode", pVal.Row, strItemCode);
                                    int j = oGrid.Rows.Count;
                                    if (j == oGrid.Rows.Count)
                                    {
                                        oGrid.DataTable.Rows.Add();
                                    }
                                }

                                if (pVal.ColUID == "UoM")
                                {
                                    oRecordSet = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(BoObjectTypes.BoRecordset);
                                    string strUoMCode = "";
                                    oDataTable = UtilitiesCls.DataTable(ref oApplication, ref oCompany, oForm, ref pVal);
                                    if (oDataTable != null)
                                    {
                                        strUoMCode = oDataTable.GetValue("UomCode", 0).ToString();
                                    }
                                    oGrid.DataTable.SetValue("UoM", pVal.Row, strUoMCode);
                                    string strQry = " Exec EJ_LoadUoMPrice '" + ((SAPbouiCOM.EditText)oForm.Items.Item("6").Specific).Value.Trim() + "','" + oGrid.DataTable.GetValue("ItemCode", pVal.Row).ToString().Trim() + "' ,'" + strUoMCode + "'";
                                    oRecordSet.DoQuery(strQry);
                                    if (!oRecordSet.EoF)
                                    {
                                        oGrid.DataTable.SetValue("Current Purchase Price", pVal.Row, oRecordSet.Fields.Item("Current Price").Value.ToString());
                                    }
                                }
                            }
                        }
                        break;

                    case BoEventTypes.et_COMBO_SELECT:

                        break;

                    case BoEventTypes.et_FORM_CLOSE:
                        oForm = null;
                        break;

                    default:
                        break;
                    }
                }
            }
        }
예제 #59
0
        public static void clsAPCreditMemo_ItemEvent(ref SAPbouiCOM.Application oApplication, ref SAPbobsCOM.Company oCompany, SAPbouiCOM.Form oSetupForm, ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            oForm            = oSetupForm;
            oHDBDataSource   = oForm.DataSources.DBDataSources.Item("ORPC");
            oChildDataSource = oForm.DataSources.DBDataSources.Item("RPC1");
            oMatrix          = (SAPbouiCOM.Matrix)oForm.Items.Item("38").Specific;

            if (pVal.BeforeAction)
            {
                switch (pVal.EventType)
                {
                case SAPbouiCOM.BoEventTypes.et_CLICK:
                    if (pVal.ItemUID == "38" && (pVal.ColUID == "U_Variance" || pVal.ColUID == "U_DiscExc"))
                    {
                        BubbleEvent = false;
                    }
                    if (oForm.Mode == SAPbouiCOM.BoFormMode.fm_OK_MODE || oForm.Mode == SAPbouiCOM.BoFormMode.fm_UPDATE_MODE)
                    {
                        if (pVal.ItemUID == "U_DocType")
                        {
                            BubbleEvent = false;
                        }
                    }
                    break;

                case SAPbouiCOM.BoEventTypes.et_PICKER_CLICKED:
                    if (pVal.ItemUID == "38" && pVal.ColUID == "U_Variance")
                    {
                        BubbleEvent = false;
                    }
                    break;

                case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED:
                    if (pVal.ItemUID == "btnSH")
                    {
                        if (((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim() == "")
                        {
                            oApplication.StatusBar.SetText("Select the Supplier....", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                            BubbleEvent = false;
                        }

                        if (oHDBDataSource.GetValue("DocStatus", oHDBDataSource.Offset).ToString().Trim() != "O")
                        {
                            BubbleEvent = false;
                        }

                        // strDocEntry = oHDBDataSource.GetValue("DocEntry", 0).Trim();
                        //strDocType = oHDBDataSource.GetValue("U_DocType", 0).Trim();
                    }
                    break;

                default:
                    break;
                }
            }

            else if (pVal.BeforeAction == false)
            {
                switch (pVal.EventType)
                {
                case SAPbouiCOM.BoEventTypes.et_FORM_LOAD:
                    //Utilities.UtilitiesCls.CreateButtonItem(oForm, "btnSH", oForm.Items.Item("2").Left + oForm.Items.Item("2").Width + 6, oForm.Items.Item("2").Top, oForm.Items.Item("2").Width + 8, oForm.Items.Item("2").Height, "Purchase History", true, 0, "");
                    Utilities.UtilitiesCls.CreateButtonItem(oForm, "btnSH", oForm.Items.Item("46").Left, oForm.Items.Item("46").Top + 20, oForm.Items.Item("46").Width, oForm.Items.Item("2").Height, "Purchase History", true, 0, "46");
                    break;

                case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED:
                    if (pVal.ItemUID == "1")
                    {
                        if (pVal.ActionSuccess)
                        {
                            if (oWaitForm != null)
                            {
                                oWaitForm.Close();
                                oWaitForm = null;
                            }
                        }
                    }

                    if (pVal.ItemUID == "btnSH")
                    {
                        try
                        {
                            if (oWaitForm != null)
                            {
                                string strCardCode1 = ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim();
                                string strCardCode2 = ((SAPbouiCOM.EditText)oWaitForm.Items.Item("6").Specific).Value.Trim();

                                if (strCardCode1 != strCardCode2)
                                {
                                    oWaitForm.Close();
                                    oWaitForm = null;
                                }
                            }
                        }
                        catch (Exception)
                        {
                            oWaitForm = null;
                        }

                        if (oWaitForm == null)
                        {
                            string strQry;
                            oWaitForm = clsSBO.LoadForm("EJ_OSSH.srf", "EJ_OSSH", oApplication);

                            ((SAPbouiCOM.EditText)oWaitForm.Items.Item("6").Specific).Value = ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim();
                            ((SAPbouiCOM.EditText)oWaitForm.Items.Item("8").Specific).Value = ((SAPbouiCOM.EditText)oForm.Items.Item("54").Specific).Value.Trim();
                            oWaitForm.Freeze(true);
                            oWaitForm.DataSources.DataTables.Add("@dtTemp");
                            SAPbouiCOM.Grid oGrid;
                            oGrid      = (SAPbouiCOM.Grid)oWaitForm.Items.Item("4").Specific;
                            oRecordSet = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(BoObjectTypes.BoRecordset);
                            //  strQry = "Exec \"EJ_SupplierCMPurchaseHistory\"  '" + ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim() + "'";
                            strQry = "Exec \"EJ_SupplierPurchaseHistory\"  '" + ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim() + "'";

                            oWaitForm.DataSources.DataTables.Item(0).ExecuteQuery(strQry);
                            oGrid.DataTable = oWaitForm.DataSources.DataTables.Item(0);
                            oGrid.Columns.Item(0).Editable = true;
                            SAPbouiCOM.EditTextColumn oEditTxt = ((SAPbouiCOM.EditTextColumn)oGrid.Columns.Item(0));
                            oEditTxt.ChooseFromListUID     = "CFL_2";
                            oEditTxt.ChooseFromListAlias   = "ItemCode";
                            oGrid.Columns.Item(1).Editable = false;
                            oGrid.Columns.Item(2).Editable = true;
                            oGrid.Columns.Item(3).Editable = true;
                            oEditTxt = ((SAPbouiCOM.EditTextColumn)oGrid.Columns.Item(3));
                            oEditTxt.ChooseFromListUID     = "CFL_3";
                            oEditTxt.ChooseFromListAlias   = "UomCode";
                            oGrid.Columns.Item(4).Editable = true;
                            oGrid.Columns.Item(0).Editable = true;

                            for (int j = 5; j < oGrid.Columns.Count; j++)
                            {
                                oGrid.Columns.Item(j).Editable = false;
                            }

                            oGrid.AutoResizeColumns();
                            oGrid.DataTable.Rows.Add(1);

                            clsSupplierPurchaseHistory.oForm   = oWaitForm;
                            clsSupplierPurchaseHistory.oSOForm = oForm;
                            oWaitForm.Freeze(false);
                        }
                        else
                        {
                            oWaitForm.Visible = true;
                        }
                    }
                    break;

                case SAPbouiCOM.BoEventTypes.et_LOST_FOCUS:
                    if (oForm.Mode == SAPbouiCOM.BoFormMode.fm_ADD_MODE || oForm.Mode == SAPbouiCOM.BoFormMode.fm_UPDATE_MODE)
                    {
                        if (pVal.ItemUID == "12")
                        {
                            //oForm.DefButton = "btnSH";
                            // oForm.ActiveItem = "btnSH";
                            ((SAPbouiCOM.Button)oForm.Items.Item("btnSH").Specific).Item.Click(BoCellClickType.ct_Regular);
                        }
                    }
                    break;

                case SAPbouiCOM.BoEventTypes.et_FORM_CLOSE:
                    if (oWaitForm != null)
                    {
                        oWaitForm.Close();
                        oWaitForm = null;
                    }
                    break;

                default:
                    break;
                }
            }
        }
예제 #60
0
        private void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            #region AddButton In Sales Order
            try
            {
                if (pVal.FormType == 139 || pVal.FormType == 133 || pVal.FormType == 149)
                {
                    if (!pVal.BeforeAction)
                    {
                        switch (pVal.EventType)
                        {
                        case SAPbouiCOM.BoEventTypes.et_FORM_LOAD:
                            mObjSOForm = SAPbouiCOM.Framework.Application.SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                            SetFormSettings(mObjSOForm);
                            this.mObjTxtCardCode.LostFocusAfter += lObjTxtCardCode_LostFocusAfter;
                            AddButton();
                            break;

                        case SAPbouiCOM.BoEventTypes.et_FORM_CLOSE:
                            UnloadEvents();
                            mObjUFForm     = null;
                            mObjRetentions = null;
                            break;

                        case SAPbouiCOM.BoEventTypes.et_CLICK:
                            if (pVal.ItemUID == "btnFrgh")
                            {
                                mObjUFForm = SAPbouiCOM.Framework.Application.SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType * -1, pVal.FormTypeCount);
                                LoadFreight();
                            }
                            break;

                        case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST:
                            if (pVal.ItemUID == "4")
                            {
                                mBoolChooseFromList = true;
                            }

                            break;

                        case SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE:
                            if (mBoolChooseFromList)
                            {
                                mObjSOForm = SAPbouiCOM.Framework.Application.SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                                EnableButton();
                                mBoolChooseFromList = false;
                            }
                            break;
                        }
                    }
                }
                else if (pVal.FormType == -139 || pVal.FormType == -133 || pVal.FormType == -149)
                {
                    if (mObjUFForm == null)
                    {
                        switch (pVal.EventType)
                        {
                        case SAPbouiCOM.BoEventTypes.et_FORM_LOAD:
                            mObjUFForm = SAPbouiCOM.Framework.Application.SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                            break;
                        }
                    }
                }
                else if (pVal.FormType == 60504)
                {
                    if (mObjRetentions == null)
                    {
                        switch (pVal.EventType)
                        {
                        case SAPbouiCOM.BoEventTypes.et_FORM_LOAD:
                            mObjRetentions = SAPbouiCOM.Framework.Application.SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                            break;
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                LogService.WriteError("(SBO_Application_ItemEvent): " + ex.Message);
                LogService.WriteError(ex);
                UIApplication.ShowMessageBox(ex.Message);
            }
            #endregion
        }