Пример #1
0
        //Process here the AccordionChildButton Events, only here we have access to BackOffice Objects. Ex.: _hboxContent
        protected void accordion_Clicked(object sender, EventArgs e)
        {
            try
            {
                dynamic clickedButton;

                if (sender.GetType() == typeof(AccordionParentButton))
                {
                    clickedButton = (AccordionParentButton)sender;
                }
                else
                {
                    clickedButton = (AccordionChildButton)sender;
                }

                //Show Button Content if its a Chield Button
                if (clickedButton.GetType() == typeof(AccordionChildButton))
                {
                    if (clickedButton.Content != null)
                    {
                        if (_nodeContent != null)
                        {
                            _hboxContent.Remove(_nodeContent);
                        }
                        _nodeContent = clickedButton.Content;
                        //Store active content button nodeContentActiveButton to reference to have access to Name, used for previleges etc
                        _accordion.CurrentChildButtonContent = clickedButton;
                        _labelActiveContent.Text             = clickedButton.Label;

                        if (!_nodeContent.Visible)
                        {
                            _nodeContent.Visible = true;
                        }
                        _hboxContent.PackStart(_nodeContent);
                    }
                    else
                    {
                        if (clickedButton.ExternalAppFileName != null)
                        {
                            FrameworkUtils.ExecuteExternalProcess(clickedButton.ExternalAppFileName);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Пример #2
0
        //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

        //Not Used: Implemented to send Data to Reports.exe
        //Use with:
        //PrintTransportObject transportObject = new PrintTransportObject(printCopies, dataTableLoop, dataTableStatic);
        //bool result = TransportDataToGenericPrinter(transportObject);
        private static bool TransportDataToGenericPrinter(PrintTransportObject pTransportObject)
        {
            bool result = false;

            try
            {
                //External App
                string externalApp = "ConsoleApplication.exe";//SettingsApp.ExecutableReports
                //Filename
                Guid   guidParameter = Guid.NewGuid();
                String fileName      = string.Format("{0}{1}.tob", GlobalFramework.Path["temp"].ToString(), guidParameter.ToString());
                JsonSerialization.WriteToJsonFile <PrintTransportObject>(fileName, pTransportObject);
                //Call External Application
                FrameworkUtils.ExecuteExternalProcess(externalApp, string.Format("printpreview {0}", fileName));

                result = true;
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
            return(result);
        }