Exemplo n.º 1
0
        protected override void RegisterSettings()
        {
            SkinManager.EnableFormSkinsIfNotVista();

            if (Config.IsDebug)
            {
                UserLookAndFeel.Default.SkinName = "Office 2010 Black";
            }
            else
            {
                UserLookAndFeel.Default.SkinName = "Office 2010 Blue";
            }
            Dialog.DefaultTitle = "Shomrei Torah Billing";

            //TODO: Register HebrewDate editor

            RegisterRowDetail <Person>(p => new Forms.PersonDetails(p)
            {
                MdiParent = MainForm
            }.Show());
            RegisterRowDetail <Pledge>(p => new Forms.PledgeEditPopup(p).Show(MainForm));
            RegisterRowDetail <Payment>(p => new Forms.PaymentEditPopup(p).Show(MainForm));

            SeatingReservation.Schema.ToString();            //Force static ctor
            RegisterRowDetail <SeatingReservation>(p => new Events.Seating.SeatingReservationPopup(p).Show(MainForm));

            GridManager.RegisterColumn(Pledge.Schema.Columns["UnlinkedAmount"],
                                       new ColumnController(c => {
                c.DisplayFormat.FormatType   = FormatType.Numeric;
                c.DisplayFormat.FormatString = "c";

                c.MaxWidth = 85;
                c.SummaryItem.DisplayFormat = "{0:c} Total Unpaid-for";
                c.SummaryItem.SummaryType   = SummaryItemType.Sum;
            })
                                       );

            GridManager.RegisterBehavior(Deposit.Schema,
                                         DeletionBehavior.WithMessages <Deposit>(
                                             singular: d => "Are you sure you want to delete this " + d.Amount.ToString("c", CultureInfo.CurrentCulture) + " deposit?\r\nThe payments will not be deleted.",
                                             plural: deposits => "Are you sure you want to delete "
                                             + (deposits.Count().ToString(CultureInfo.InvariantCulture) + " pledges containing "
                                                + deposits.Sum(p => p.Amount).ToString("c", CultureInfo.CurrentCulture) + "?\r\nThe payments in the deposits will not be deleted.")
                                             ));

            GridManager.RegisterColumn((SmartGridColumn sgc) => {
                return(sgc.View.GetSourceSchema() == SeatingReservation.Schema && sgc.FieldName == "Person");
            }, new MissingPersonController());
            RegisterLookupValidation();
        }
Exemplo n.º 2
0
        static TriggerButton()
        {
            EditorRepository.Register(StagedPayment.AmountColumn, EditorRepository.CurrencyEditor);
            EditorRepository.Register(StagedPayment.AccountColumn, EditorRepository.AccountEditor);

            GridManager.RegisterColumn(StagedPayment.MethodColumn, MaxWidth(70));
            GridManager.RegisterColumn(StagedPayment.AccountColumn, MaxWidth(100));
            GridManager.RegisterColumn(StagedPayment.CommentsColumn, new CommentsColumnController());
            GridManager.RegisterColumn(
                StagedPayment.AmountColumn,
                new ColumnController(c => {
                c.DisplayFormat.FormatType   = FormatType.Numeric;
                c.DisplayFormat.FormatString = "c";

                c.MaxWidth = 85;
                c.SummaryItem.DisplayFormat = "{0:c} Total";
                c.SummaryItem.SummaryType   = SummaryItemType.Sum;
            })
                );

            GridManager.RegisterBehavior(StagedPayment.Schema,
                                         DeletionBehavior.WithMessages <StagedPayment>(
                                             singular: p => $"Are you sure you don't want to import this {p.Amount:c} payment?",
                                             plural: payments => $"Are you sure you want to don't want to import {payments.Count()} " +
                                             $"payments totaling {payments.Sum(p => p.Amount):c}?"
                                             )
                                         );

            GridManager.RegisterBehavior(StagedPerson.Schema,
                                         DeletionBehavior.WithMessages <StagedPerson>(
                                             singular: p => $"Are you sure you don't want to import {p.FullName}, with {p.StagedPayments.Count} payments?",
                                             plural: people => $"Are you sure you want to don't want to import {people.Count()} people with " +
                                             $"payments totaling {people.Sum(p => p.StagedPayments.Sum(pp => pp.Amount)):c}?"
                                             )
                                         );
        }