Ejemplo n.º 1
0
        public static void MenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            try
            {
                #region Autoretention

                if (pVal.MenuUID == "BYB_MWT04" &&
                    !pVal.BeforeAction)
                {
                    SelfWithholdingTax.loadCancelSWTaxForm();
                }
                if (pVal.MenuUID == "BYB_MWT03" &&
                    !pVal.BeforeAction)
                {
                    SelfWithholdingTax.loadMissingSWTaxForm();
                }

                //COnfiguración Autoretencion
                if (pVal.MenuUID == "BYB_MWT02" &&
                    !pVal.BeforeAction)
                {
                    SelfWithholdingTax.loadSWTaxConfigForm();
                }

                //Add Row BP
                if (pVal.MenuUID == "BYB_MWTRU" &&
                    !pVal.BeforeAction)
                {
                    EventInfoClass eventInfo = CacheManager.CacheManager.Instance.getFromCache(Settings._Main.lastRightClickEventInfo);
                    SelfWithholdingTax.relatedPartiedMatrixOperationUDO(eventInfo, "Add");
                }
                //Remove Row BP
                if (pVal.MenuUID == "BYB_MWTDRU" &&
                    !pVal.BeforeAction)
                {
                    EventInfoClass eventInfo = CacheManager.CacheManager.Instance.getFromCache(Settings._Main.lastRightClickEventInfo);
                    SelfWithholdingTax.relatedPartiedMatrixOperationUDO(eventInfo, "Delete");
                }
                #endregion

                #region Retenciones
                if (pVal.MenuUID == "5897" &&
                    pVal.BeforeAction)
                {
                    string strLastActiveForm = MainObject.Instance.B1Application.Forms.ActiveForm.UniqueID;
                    CacheManager.CacheManager.Instance.addToCache("WTLastActiveForm", strLastActiveForm, CacheManager.CacheManager.objCachePriority.Default);
                }
                if (pVal.MenuUID == "6005" &&
                    pVal.BeforeAction)
                {
                    string strLastActiveForm = MainObject.Instance.B1Application.Forms.ActiveForm.UniqueID;
                    CacheManager.CacheManager.Instance.addToCache("LastActiveForm", strLastActiveForm, CacheManager.CacheManager.objCachePriority.Default);
                }

                if (pVal.MenuUID == "BYB_MWT06" &&
                    pVal.BeforeAction)
                {
                    MainObject.Instance.B1Application.OpenForm(SAPbouiCOM.BoFormObjectEnum.fo_UserDefinedObject, "BYB_T1WHT200", "");
                }

                //Transacciones faltantes
                if (pVal.MenuUID == "BYB_MWT07" &&
                    !pVal.BeforeAction)
                {
                    WithholdingTax.loadMissingOperationsForm();
                }



                #endregion
            }
            catch (Exception er)
            {
                _Logger.Error("", er);
            }
        }