Ejemplo n.º 1
0
 private void HeaderEvents_OnNew(object Sender, ExtenderEventArgs e)
 {
     _transaction = (ItemTransaction)e.get_data();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Chamado no momento da gravação
 /// </summary>
 /// <param name="Sender">GenericExtensibilityController</param>
 /// <param name="e">
 /// IN:
 ///     e.get_Data(): ExtendedPropertyList
 ///         "Data":  Customer
 ///         "PreviousID": Identificador anterior (ItemId). Pode não estar presente
 ///         "IsNew": O Artigo é novo
 ///
 /// OUT:
 ///     result.Sucess: Ignorado
 ///     result.ResultMessage: Mensagem a apresentar
 /// </param>
 void myEvents_OnSave(object Sender, ExtenderEventArgs e)
 {
     var proplist = (ExtendedPropertyList)e.get_data();
     var Customer = ( Customer)proplist.get_Value("Data"); // The  Customer
     var isNew    = (bool)proplist.get_Value("IsNew");     // Is new?
 }
Ejemplo n.º 3
0
        private void MyEvents_OnStartup(object Sender, ExtenderEventArgs e)
        {
            ExtendedPropertyList properties = null;;
            ExtenderMenuItems    menuItem;

            //APIEngine.SystemSettings.WorkstationInfo.Touch.CompanyLogoPosition = 1;

            properties = (ExtendedPropertyList)e.get_data();

            //this property will only be available in the backoffice
            if (properties.PropertyExists("ChildWindow"))
            {
                generalChildWindow = (IChildWindow2)properties.get_Value("ChildWindow");
            }

            //this property will only be available in the backoffice
            if (properties.PropertyExists("WorkspaceWindow"))
            {
                generalWorkspaceWindow = (IWorkspaceWindow)properties.get_Value("WorkspaceWindow");
            }
            //this property will be available in both backoffice and frontoffice
            if (properties.PropertyExists("DialogWindow"))
            {
                generalDialogWindow = (IDialogWindow)properties.get_Value("DialogWindow");
            }

            //this property will be available in both backoffice and frontoffice
            if (properties.PropertyExists("UITransactionManager"))
            {
                generalUITransactionManager = (IUITransaction)properties.get_Value("UITransactionManager");
            }

            //this property will be available in both backoffice and frontoffice
            if (properties.PropertyExists("UIMasterTableManager"))
            {
                generalUIMasterTableManager = (IUIMasterTable)properties.get_Value("UIMasterTableManager");
            }

            if (properties.PropertyExists("UIMenuManager"))
            {
                generalUIMenuManager = (IUIMenu)properties.get_Value("UIMenuManager");
            }

            // CUSTOM MENUS
            // Definir os menus
            // Botão simples
            menuItem = new ExtenderMenuItems();
            var simpleButton = menuItem.Add("miSimpleButton", "Exemplo de janela");

            // Colocar o caminho para o icone.
            // Não usar os nomes de ficheiro da Sage em:
            //      TARGETDIR\Icons50c
            //      TARGETDIR\Images
            var myTargetDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);

            myTargetDir = System.IO.Path.Combine(myTargetDir, "Icons");
            simpleButton.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-01.png");
            var simpleButton2 = menuItem.Add("miSimpleButton1", "Exemplo 2 de janela");

            simpleButton2.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-02.png");

            // Botão com submenu
            var parentButton = menuItem.Add("miComplexButton", "Grupo");
            var parentBtn1   = parentButton.ChildItems.Add("miComplexButtonItem1", "Clique aqui para ver uma mensagem do Grupo!");

            parentBtn1.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-03.png");
            //menuItem.Add("miItemView", "Alterar Artigos");

            var parentButton2 = menuItem.Add("miComplexButton2", "Grupo");
            var child1        = parentButton2.ChildItems.Add("miComplexButtonItem2", "SubGrupo");
            var childItem1    = child1.ChildItems.Add("miComplexButtonItem3", "Clique aqui para ver uma mensagem do SubGrupo!", "miComplexButtonItem3");

            childItem1.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-03.png");
            var childItem2 = child1.ChildItems.Add("miComplexButtonItem4", "Clique aqui para ver outra mensagem do SubGrupo!", "miComplexButtonItem3");

            childItem2.PictureName = System.IO.Path.Combine(myTargetDir, "icon-save.ico");

            // Custom Functions
            // Remember, all functions declared here will not recorded on physical base
            AddMyFunction("XFunctionA", "PTG");
            AddMyFunction("XPosDisplay", "PTG");

            //
            // COM mandatories
            object oMenuItem = menuItem;

            properties.set_Value("ExtenderMenuItems", ref oMenuItem);

            //Change RibbonTab Title
            object oRibbonCaption = "My caption";

            properties.set_Value("RibbonCaption", ref oRibbonCaption);

            //Use this property if you want Sage Retail to rebuild the permissions tree...
            //object rebuildPermissionsTree = true;
            //properties.set_Value("RebuildPermissionsTree", rebuildPermissionsTree);

            object oProps = properties;

            e.result.set_data(ref oProps);

            menuItem = null;
        }
Ejemplo n.º 4
0
 /// <summary>
 /// EXEMPLO DE VALIDAÇÃO NA LINHA
 /// </summary>
 /// <param name="Sender"></param>
 /// <param name="e"></param>
 void DetailEvents_OnValidating(object Sender, ExtenderEventArgs e)
 {
     ExtendedPropertyList    properties = (ExtendedPropertyList)e.get_data();
     TenderTransactionDetail _tenderTransactionDetail = (TenderTransactionDetail)properties.get_Value("Data");
     string errorMessage = string.Empty;
 }
Ejemplo n.º 5
0
 private void SystemEvents_OnMenuItem(object Sender, ExtenderEventArgs e)
 {
     string menuItemId = (string)e.get_data();
     //switch (menuItemId) {
     //}
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Chamado no momento da gravação
 /// </summary>
 /// <param name="Sender">GenericExtensibilityController</param>
 /// <param name="e">
 /// IN:
 ///     e.get_Data(): ExtendedPropertyList
 ///         "Data":  Salesman
 ///         "PreviousID": Identificador anterior (ItemId). Pode não estar presente
 ///         "IsNew": O Artigo é novo
 ///
 /// OUT:
 ///     result.Sucess: Ignorado
 ///     result.ResultMessage: Mensagem a apresentar
 /// </param>
 void myEvents_OnSave(object Sender, ExtenderEventArgs e)
 {
     var proplist = (ExtendedPropertyList)e.get_data();
     var Salesman = (Salesman)proplist.get_Value("Data"); // The  Salesman
     var isNew    = (bool)proplist.get_Value("IsNew");    // Is new?
 }