Ejemplo n.º 1
0
        /// <summary>
        /// Handle menu event
        /// </summary>
        public void HandleMenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            AlternativeItem altItem     = new AlternativeItem(oSBOApplication, oSBOCompany);
            ChangeCompItem  chgCompItem = new ChangeCompItem(oSBOApplication, oSBOCompany);
            UpdateBomVer    updtBomVer  = new UpdateBomVer(oSBOApplication, oSBOCompany);

            try
            {
                switch (pVal.MenuUID)
                {
                case "89111": altItem.MenuEvent_AltItem(ref pVal, out BubbleEvent); break;

                case "89222": chgCompItem.MenuEvent_ChangeCompItm(ref pVal, out BubbleEvent); break;

                case "89333": updtBomVer.MenuEvent_UpdateBomVer(ref pVal, out BubbleEvent); break;

                case "AltItemAdd": altItem.MenuEvent_AltItemAdd(ref pVal, ref BubbleEvent); break;

                case "AltItemDel": altItem.MenuEvent_AltItemDel(ref pVal, ref BubbleEvent); break;
                }
            }
            catch (Exception ex)
            {
                BubbleEvent = false;
                oSBOApplication.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handle item event
        /// </summary>
        public void HandleItemEvent(string FormUID, ref ItemEvent pVal, out bool bubbleEvent)
        {
            bubbleEvent = true;
            AlternativeItem altItem       = new AlternativeItem(oSBOApplication, oSBOCompany);
            ChangeCompItem  changeCompItm = new ChangeCompItem(oSBOApplication, oSBOCompany);
            UpdateBomVer    updateBom     = new UpdateBomVer(oSBOApplication, oSBOCompany);

            try
            {
                if (pVal.EventType != BoEventTypes.et_FORM_UNLOAD)
                {
                    switch (pVal.FormTypeEx)
                    {
                    case "ALTITEM": altItem.ItemEvent_AltItem(FormUID, ref pVal, ref bubbleEvent); break;

                    case "COMPITM": changeCompItm.ItemEvent_ChangeCompItm(FormUID, ref pVal, ref bubbleEvent); break;

                    case "UPBOMVER": updateBom.ItemEvent_UpdateBomVer(FormUID, ref pVal, ref bubbleEvent); break;
                    }
                }
            }
            catch (Exception ex)
            {
                bubbleEvent = false;
                oSBOApplication.MessageBox(ex.Message);
            }
        }