Exemplo n.º 1
0
        private void InitPrintButton(AttachmentPoint attachmentPoint, PrintButton button)
        {
            button.AttachmentPoint = attachmentPoint;
            Visibility visibility;
            switch (_oClientType)
            {
                case OClientTypes.Person:
                    visibility = Visibility.Individual;
                    break;

                case OClientTypes.Group:
                    visibility = Visibility.Group;
                    break;

                case OClientTypes.Corporate:
                    visibility = Visibility.Corporate;
                    break;

                default:
                    visibility = Visibility.All;
                    break;
            }
            button.Visibility = visibility;

            button.ReportInitializer =
                report =>
                {
                    report.SetParamValue("user_id", User.CurrentUser.Id);
                    if (_credit != null) report.SetParamValue("contract_id", _credit.Id);
                    if (_saving != null) report.SetParamValue("saving_id", _saving.Id);
                    if (_guarantee != null) report.SetParamValue("guarantee_id", _guarantee.Id);
                };
            button.LoadReports();
        }
Exemplo n.º 2
0
        private void InitPrintButton(AttachmentPoint attachmentPoint, PrintButton button)
        {
            button.AttachmentPoint = attachmentPoint;
            Visibility visibility;
            switch (_oClientType)
            {
                case OClientTypes.Person:
                    visibility = Visibility.Individual;
                    break;

                case OClientTypes.Group:
                    visibility = Visibility.Group;
                    break;

                case OClientTypes.Corporate:
                    visibility = Visibility.Corporate;
                    break;

                default:
                    visibility = Visibility.All;
                    break;
            }
            button.Visibility = visibility;

            button.ReportInitializer =
                report =>
                {
                    report.SetParamValue("user_id", User.CurrentUser.Id);
                    if (_credit != null) report.SetParamValue("contract_id", _credit.Id);
                    if (_saving != null) report.SetParamValue("saving_id", _saving.Id);
                    if (_guarantee != null) report.SetParamValue("guarantee_id", _guarantee.Id);
                };
            button.LoadReports();

            //from extension
            foreach (var item in PrintButtonContextMenuStrips)
            {
                var menuItems = item.GetContextMenuStrip(_client, _credit, _guarantee, _saving, attachmentPoint.ToString());
                if (menuItems == null) continue;

                foreach (var menuItem in menuItems)
                {
                    button.Menu.Items.Add(menuItem);
                }
            }
        }