static AdReminderEmail()
        {
            #region Create Schema
            Schema = new TypedSchema<AdReminderEmail>("ReminderEmailLog");

            Schema.PrimaryKey = RowIdColumn = Schema.Columns.AddValueColumn("RowId", typeof(Guid), null);
            RowIdColumn.Unique = true;
            RowIdColumn.AllowNulls = false;

            RecipientColumn = Schema.Columns.AddForeignKey("Recipient", MelaveMalkaInvitation.Schema, "ReminderEmailLogs");
            RecipientColumn.AllowNulls = false;

            DateColumn = Schema.Columns.AddValueColumn("Date", typeof(DateTime), null);
            DateColumn.AllowNulls = false;

            EmailSubjectColumn = Schema.Columns.AddValueColumn("EmailSubject", typeof(String), null);
            EmailSubjectColumn.AllowNulls = false;

            EmailSourceColumn = Schema.Columns.AddValueColumn("EmailSource", typeof(String), null);
            EmailSourceColumn.AllowNulls = false;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "ReminderEmailLog";
            SchemaMapping.SqlSchemaName = "MelaveMalka";

            SchemaMapping.Columns.AddMapping(RowIdColumn, "RowId");
            SchemaMapping.Columns.AddMapping(RecipientColumn, "InviteId");
            SchemaMapping.Columns.AddMapping(DateColumn, "Date");
            SchemaMapping.Columns.AddMapping(EmailSubjectColumn, "EmailSubject");
            SchemaMapping.Columns.AddMapping(EmailSourceColumn, "EmailSource");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
Beispiel #2
0
        static StagedPayment()
        {
            #region Create Schema
            Schema = new TypedSchema<StagedPayment>("StagedPayments");

            Schema.PrimaryKey = StagedPaymentIdColumn = Schema.Columns.AddValueColumn("StagedPaymentId", typeof(Guid), null);
            StagedPaymentIdColumn.Unique = true;
            StagedPaymentIdColumn.AllowNulls = false;

            StagedPersonColumn = Schema.Columns.AddForeignKey("StagedPerson", StagedPerson.Schema, "StagedPayments");
            StagedPersonColumn.AllowNulls = false;

            DateColumn = Schema.Columns.AddValueColumn("Date", typeof(DateTime), null);
            DateColumn.AllowNulls = false;

            MethodColumn = Schema.Columns.AddValueColumn("Method", typeof(String), null);
            MethodColumn.AllowNulls = false;

            CheckNumberColumn = Schema.Columns.AddValueColumn("CheckNumber", typeof(String), null);
            CheckNumberColumn.AllowNulls = true;

            AccountColumn = Schema.Columns.AddValueColumn("Account", typeof(String), null);
            AccountColumn.AllowNulls = false;

            AmountColumn = Schema.Columns.AddValueColumn("Amount", typeof(Decimal), null);
            AmountColumn.AllowNulls = false;

            CommentsColumn = Schema.Columns.AddValueColumn("Comments", typeof(String), null);
            CommentsColumn.AllowNulls = true;

            ExternalIdColumn = Schema.Columns.AddValueColumn("ExternalId", typeof(String), null);
            ExternalIdColumn.AllowNulls = false;

            CompanyColumn = Schema.Columns.AddValueColumn("Company", typeof(String), null);
            CompanyColumn.AllowNulls = true;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "StagedPayments";
            SchemaMapping.SqlSchemaName = "BillingMigration";

            SchemaMapping.Columns.AddMapping(StagedPaymentIdColumn, "StagedPaymentId");
            SchemaMapping.Columns.AddMapping(StagedPersonColumn, "StagedPersonId");
            SchemaMapping.Columns.AddMapping(DateColumn, "Date");
            SchemaMapping.Columns.AddMapping(MethodColumn, "Method");
            SchemaMapping.Columns.AddMapping(CheckNumberColumn, "CheckNumber");
            SchemaMapping.Columns.AddMapping(AccountColumn, "Account");
            SchemaMapping.Columns.AddMapping(AmountColumn, "Amount");
            SchemaMapping.Columns.AddMapping(CommentsColumn, "Comments");
            SchemaMapping.Columns.AddMapping(ExternalIdColumn, "ExternalId");
            SchemaMapping.Columns.AddMapping(CompanyColumn, "Company");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
Beispiel #3
0
        static ImportedPayment()
        {
            #region Create Schema
            Schema = new TypedSchema<ImportedPayment>("ImportedPayments");

            Schema.PrimaryKey = ImportedPaymentIdColumn = Schema.Columns.AddValueColumn("ImportedPaymentId", typeof(Guid), null);
            ImportedPaymentIdColumn.Unique = true;
            ImportedPaymentIdColumn.AllowNulls = false;

            PaymentColumn = Schema.Columns.AddForeignKey("Payment", Payment.Schema, "ImportedPayments");
            PaymentColumn.Unique = true;
            PaymentColumn.AllowNulls = false;

            SourceColumn = Schema.Columns.AddValueColumn("Source", typeof(String), null);
            SourceColumn.AllowNulls = false;

            ExternalIdColumn = Schema.Columns.AddValueColumn("ExternalId", typeof(String), null);
            ExternalIdColumn.AllowNulls = false;

            DateImportedColumn = Schema.Columns.AddValueColumn("DateImported", typeof(DateTime), null);
            DateImportedColumn.AllowNulls = false;

            ImportingUserColumn = Schema.Columns.AddValueColumn("ImportingUser", typeof(String), null);
            ImportingUserColumn.AllowNulls = false;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "ImportedPayments";
            SchemaMapping.SqlSchemaName = "Billing";

            SchemaMapping.Columns.AddMapping(ImportedPaymentIdColumn, "ImportedPaymentId");
            SchemaMapping.Columns.AddMapping(PaymentColumn, "PaymentId");
            SchemaMapping.Columns.AddMapping(SourceColumn, "Source");
            SchemaMapping.Columns.AddMapping(ExternalIdColumn, "ExternalId");
            SchemaMapping.Columns.AddMapping(DateImportedColumn, "DateImported");
            SchemaMapping.Columns.AddMapping(ImportingUserColumn, "ImportingUser");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static SeatingReservation()
        {
            #region Create Schema
            Schema = new TypedSchema<SeatingReservation>("SeatingReservations");

            Schema.PrimaryKey = IdColumn = Schema.Columns.AddValueColumn("Id", typeof(Guid), null);
            IdColumn.Unique = true;
            IdColumn.AllowNulls = false;

            PledgeColumn = Schema.Columns.AddForeignKey("Pledge", Pledge.Schema, "SeatingReservations");
            PledgeColumn.Unique = true;
            PledgeColumn.AllowNulls = false;

            MensSeatsColumn = Schema.Columns.AddValueColumn("MensSeats", typeof(Int32), 0);
            MensSeatsColumn.AllowNulls = false;

            WomensSeatsColumn = Schema.Columns.AddValueColumn("WomensSeats", typeof(Int32), 0);
            WomensSeatsColumn.AllowNulls = false;

            BoysSeatsColumn = Schema.Columns.AddValueColumn("BoysSeats", typeof(Int32), 0);
            BoysSeatsColumn.AllowNulls = false;

            GirlsSeatsColumn = Schema.Columns.AddValueColumn("GirlsSeats", typeof(Int32), 0);
            GirlsSeatsColumn.AllowNulls = false;

            NotesColumn = Schema.Columns.AddValueColumn("Notes", typeof(String), "");
            NotesColumn.AllowNulls = false;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "SeatingReservations";
            SchemaMapping.SqlSchemaName = "Seating";

            SchemaMapping.Columns.AddMapping(IdColumn, "Id");
            SchemaMapping.Columns.AddMapping(PledgeColumn, "PledgeId");
            SchemaMapping.Columns.AddMapping(MensSeatsColumn, "MensSeats");
            SchemaMapping.Columns.AddMapping(WomensSeatsColumn, "WomensSeats");
            SchemaMapping.Columns.AddMapping(BoysSeatsColumn, "BoysSeats");
            SchemaMapping.Columns.AddMapping(GirlsSeatsColumn, "GirlsSeats");
            SchemaMapping.Columns.AddMapping(NotesColumn, "Notes");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static RelativeLink()
        {
            #region Create Schema
            Schema = new TypedSchema<RelativeLink>("Relatives");

            Schema.PrimaryKey = RowIdColumn = Schema.Columns.AddValueColumn("RowId", typeof(Guid), null);
            RowIdColumn.Unique = true;
            RowIdColumn.AllowNulls = false;

            MemberColumn = Schema.Columns.AddForeignKey("Member", Person.Schema, "ForeignRelatives");
            MemberColumn.AllowNulls = false;

            RelativeColumn = Schema.Columns.AddForeignKey("Relative", Person.Schema, "Relatives");
            RelativeColumn.AllowNulls = false;

            RelationTypeColumn = Schema.Columns.AddValueColumn("Relation", typeof(String), null);
            RelationTypeColumn.AllowNulls = false;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "Relatives";
            SchemaMapping.SqlSchemaName = "Data";

            SchemaMapping.Columns.AddMapping(RowIdColumn, "RowId");
            SchemaMapping.Columns.AddMapping(MemberColumn, "MemberId");
            SchemaMapping.Columns.AddMapping(RelativeColumn, "RelativeId");
            SchemaMapping.Columns.AddMapping(RelationTypeColumn, "Relation");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static RaffleTicket()
        {
            #region Create Schema
            Schema = new TypedSchema<RaffleTicket>("RaffleTickets");

            Schema.PrimaryKey = RowIdColumn = Schema.Columns.AddValueColumn("RowId", typeof(Guid), null);
            RowIdColumn.Unique = true;
            RowIdColumn.AllowNulls = false;

            PersonColumn = Schema.Columns.AddForeignKey("Person", Person.Schema, "RaffleTickets");
            PersonColumn.AllowNulls = false;

            DateAddedColumn = Schema.Columns.AddValueColumn("DateAdded", typeof(DateTime), null);
            DateAddedColumn.AllowNulls = false;

            YearColumn = Schema.Columns.AddValueColumn("Year", typeof(Int32), null);
            YearColumn.AllowNulls = false;

            TicketIdColumn = Schema.Columns.AddValueColumn("TicketId", typeof(Int32), null);
            TicketIdColumn.AllowNulls = false;

            PaidColumn = Schema.Columns.AddValueColumn("Paid", typeof(Boolean), null);
            PaidColumn.AllowNulls = false;

            CommentsColumn = Schema.Columns.AddValueColumn("Comments", typeof(String), null);
            CommentsColumn.AllowNulls = true;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "RaffleTickets";
            SchemaMapping.SqlSchemaName = "MelaveMalka";

            SchemaMapping.Columns.AddMapping(RowIdColumn, "RowId");
            SchemaMapping.Columns.AddMapping(PersonColumn, "PersonId");
            SchemaMapping.Columns.AddMapping(DateAddedColumn, "DateAdded");
            SchemaMapping.Columns.AddMapping(YearColumn, "Year");
            SchemaMapping.Columns.AddMapping(TicketIdColumn, "TicketId");
            SchemaMapping.Columns.AddMapping(PaidColumn, "Paid");
            SchemaMapping.Columns.AddMapping(CommentsColumn, "Comments");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static PledgeLink()
        {
            #region Create Schema
            Schema = new TypedSchema<PledgeLink>("PledgeLinks");

            Schema.PrimaryKey = LinkIdColumn = Schema.Columns.AddValueColumn("LinkId", typeof(Guid), null);
            LinkIdColumn.Unique = true;
            LinkIdColumn.AllowNulls = false;

            PledgeColumn = Schema.Columns.AddForeignKey("Pledge", Pledge.Schema, "LinkedPayments");
            PledgeColumn.AllowNulls = false;

            PaymentColumn = Schema.Columns.AddForeignKey("Payment", Payment.Schema, "LinkedPledges");
            PaymentColumn.AllowNulls = false;

            AmountColumn = Schema.Columns.AddValueColumn("Amount", typeof(Decimal), null);
            AmountColumn.AllowNulls = false;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "PledgeLinks";
            SchemaMapping.SqlSchemaName = "Billing";

            SchemaMapping.Columns.AddMapping(LinkIdColumn, "LinkId");
            SchemaMapping.Columns.AddMapping(PledgeColumn, "PledgeId");
            SchemaMapping.Columns.AddMapping(PaymentColumn, "PaymentId");
            SchemaMapping.Columns.AddMapping(AmountColumn, "Amount");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static Pledge()
        {
            #region Create Schema
            Schema = new TypedSchema<Pledge>("Pledges");

            Schema.PrimaryKey = PledgeIdColumn = Schema.Columns.AddValueColumn("PledgeId", typeof(Guid), null);
            PledgeIdColumn.Unique = true;
            PledgeIdColumn.AllowNulls = false;

            PersonColumn = Schema.Columns.AddForeignKey("Person", Person.Schema, "Pledges");
            PersonColumn.AllowNulls = false;

            DateColumn = Schema.Columns.AddValueColumn("Date", typeof(DateTime), null);
            DateColumn.AllowNulls = false;

            TypeColumn = Schema.Columns.AddValueColumn("Type", typeof(String), null);
            TypeColumn.AllowNulls = false;

            SubTypeColumn = Schema.Columns.AddValueColumn("SubType", typeof(String), "");
            SubTypeColumn.AllowNulls = false;

            AccountColumn = Schema.Columns.AddValueColumn("Account", typeof(String), null);
            AccountColumn.AllowNulls = false;

            AmountColumn = Schema.Columns.AddValueColumn("Amount", typeof(Decimal), null);
            AmountColumn.AllowNulls = false;

            NoteColumn = Schema.Columns.AddValueColumn("Note", typeof(String), null);
            NoteColumn.AllowNulls = true;

            CommentsColumn = Schema.Columns.AddValueColumn("Comments", typeof(String), null);
            CommentsColumn.AllowNulls = true;

            ModifiedColumn = Schema.Columns.AddValueColumn("Modified", typeof(DateTime), null);
            ModifiedColumn.AllowNulls = false;

            ModifierColumn = Schema.Columns.AddValueColumn("Modifier", typeof(String), null);
            ModifierColumn.AllowNulls = false;

            ExternalSourceColumn = Schema.Columns.AddValueColumn("ExternalSource", typeof(String), null);
            ExternalSourceColumn.AllowNulls = true;

            ExternalIdColumn = Schema.Columns.AddValueColumn("ExternalId", typeof(Int32), null);
            ExternalIdColumn.AllowNulls = true;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "Pledges";
            SchemaMapping.SqlSchemaName = "Billing";

            SchemaMapping.Columns.AddMapping(PledgeIdColumn, "PledgeId");
            SchemaMapping.Columns.AddMapping(PersonColumn, "PersonId");
            SchemaMapping.Columns.AddMapping(DateColumn, "Date");
            SchemaMapping.Columns.AddMapping(TypeColumn, "Type");
            SchemaMapping.Columns.AddMapping(SubTypeColumn, "SubType");
            SchemaMapping.Columns.AddMapping(AccountColumn, "Account");
            SchemaMapping.Columns.AddMapping(AmountColumn, "Amount");
            SchemaMapping.Columns.AddMapping(NoteColumn, "Note");
            SchemaMapping.Columns.AddMapping(CommentsColumn, "Comments");
            SchemaMapping.Columns.AddMapping(ModifiedColumn, "Modified");
            SchemaMapping.Columns.AddMapping(ModifierColumn, "Modifier");
            SchemaMapping.Columns.AddMapping(ExternalSourceColumn, "ExternalSource");
            SchemaMapping.Columns.AddMapping(ExternalIdColumn, "ExternalID");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static JournalAd()
        {
            #region Create Schema
            Schema = new TypedSchema<JournalAd>("Ads");

            Schema.PrimaryKey = AdIdColumn = Schema.Columns.AddValueColumn("AdId", typeof(Guid), null);
            AdIdColumn.Unique = true;
            AdIdColumn.AllowNulls = false;

            YearColumn = Schema.Columns.AddValueColumn("Year", typeof(Int32), null);
            YearColumn.AllowNulls = false;

            DateAddedColumn = Schema.Columns.AddValueColumn("DateAdded", typeof(DateTime), null);
            DateAddedColumn.AllowNulls = false;

            AdTypeColumn = Schema.Columns.AddValueColumn("AdType", typeof(String), null);
            AdTypeColumn.AllowNulls = false;

            ExternalIdColumn = Schema.Columns.AddValueColumn("ExternalId", typeof(Int32), null);
            ExternalIdColumn.AllowNulls = false;

            CommentsColumn = Schema.Columns.AddValueColumn("Comments", typeof(String), null);
            CommentsColumn.AllowNulls = true;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "Ads";
            SchemaMapping.SqlSchemaName = "MelaveMalka";

            SchemaMapping.Columns.AddMapping(AdIdColumn, "AdId");
            SchemaMapping.Columns.AddMapping(YearColumn, "Year");
            SchemaMapping.Columns.AddMapping(DateAddedColumn, "DateAdded");
            SchemaMapping.Columns.AddMapping(AdTypeColumn, "AdType");
            SchemaMapping.Columns.AddMapping(ExternalIdColumn, "ExternalId");
            SchemaMapping.Columns.AddMapping(CommentsColumn, "Comments");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static Caller()
        {
            #region Create Schema
            Schema = new TypedSchema<Caller>("Callers");

            Schema.PrimaryKey = RowIdColumn = Schema.Columns.AddValueColumn("RowId", typeof(Guid), null);
            RowIdColumn.Unique = true;
            RowIdColumn.AllowNulls = false;

            PersonColumn = Schema.Columns.AddForeignKey("Person", Person.Schema, "Callers");
            PersonColumn.AllowNulls = false;

            DateAddedColumn = Schema.Columns.AddValueColumn("DateAdded", typeof(DateTime), null);
            DateAddedColumn.AllowNulls = false;

            YearColumn = Schema.Columns.AddValueColumn("Year", typeof(Int32), null);
            YearColumn.AllowNulls = false;

            EmailAddressesColumn = Schema.Columns.AddCalculatedColumn<Caller, String>("EmailAddresses", row => String.Join(", ", row.Person.EmailAddresses.Select(e => e.Email)));

            CalleeCountColumn = Schema.Columns.AddCalculatedColumn<Caller, Int32>("CalleeCount", row => row.Callees.Count);
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "Callers";
            SchemaMapping.SqlSchemaName = "MelaveMalka";

            SchemaMapping.Columns.AddMapping(RowIdColumn, "RowId");
            SchemaMapping.Columns.AddMapping(PersonColumn, "PersonId");
            SchemaMapping.Columns.AddMapping(DateAddedColumn, "DateAdded");
            SchemaMapping.Columns.AddMapping(YearColumn, "Year");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static MelaveMalkaSeat()
        {
            #region Create Schema
            Schema = new TypedSchema<MelaveMalkaSeat>("SeatReservations");

            Schema.PrimaryKey = RowIdColumn = Schema.Columns.AddValueColumn("RowId", typeof(Guid), null);
            RowIdColumn.Unique = true;
            RowIdColumn.AllowNulls = false;

            PersonColumn = Schema.Columns.AddForeignKey("Person", Person.Schema, "SeatReservations");
            PersonColumn.AllowNulls = false;

            DateAddedColumn = Schema.Columns.AddValueColumn("DateAdded", typeof(DateTime), null);
            DateAddedColumn.AllowNulls = false;

            YearColumn = Schema.Columns.AddValueColumn("Year", typeof(Int32), null);
            YearColumn.AllowNulls = false;

            MensSeatsColumn = Schema.Columns.AddValueColumn("MensSeats", typeof(Int32), 0);
            MensSeatsColumn.AllowNulls = true;

            WomensSeatsColumn = Schema.Columns.AddValueColumn("WomensSeats", typeof(Int32), 0);
            WomensSeatsColumn.AllowNulls = true;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "SeatReservations";
            SchemaMapping.SqlSchemaName = "MelaveMalka";

            SchemaMapping.Columns.AddMapping(RowIdColumn, "RowId");
            SchemaMapping.Columns.AddMapping(PersonColumn, "PersonId");
            SchemaMapping.Columns.AddMapping(DateAddedColumn, "DateAdded");
            SchemaMapping.Columns.AddMapping(YearColumn, "Year");
            SchemaMapping.Columns.AddMapping(MensSeatsColumn, "MensSeats");
            SchemaMapping.Columns.AddMapping(WomensSeatsColumn, "WomensSeats");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static MelaveMalkaInvitation()
        {
            #region Create Schema
            Schema = new TypedSchema<MelaveMalkaInvitation>("Invitees");

            Schema.PrimaryKey = RowIdColumn = Schema.Columns.AddValueColumn("RowId", typeof(Guid), null);
            RowIdColumn.Unique = true;
            RowIdColumn.AllowNulls = false;

            PersonColumn = Schema.Columns.AddForeignKey("Person", Person.Schema, "Invitees");
            PersonColumn.AllowNulls = false;

            YearColumn = Schema.Columns.AddValueColumn("Year", typeof(Int32), null);
            YearColumn.AllowNulls = false;

            SourceColumn = Schema.Columns.AddValueColumn("Source", typeof(String), null);
            SourceColumn.AllowNulls = false;

            DateAddedColumn = Schema.Columns.AddValueColumn("DateAdded", typeof(DateTime), null);
            DateAddedColumn.AllowNulls = false;

            ShouldCallColumn = Schema.Columns.AddValueColumn("ShouldCall", typeof(Boolean), false);
            ShouldCallColumn.AllowNulls = false;

            CallerColumn = Schema.Columns.AddForeignKey("Caller", Caller.Schema, "Callees");
            CallerColumn.AllowNulls = true;

            CallerNoteColumn = Schema.Columns.AddValueColumn("CallerNote", typeof(String), null);
            CallerNoteColumn.AllowNulls = true;

            AdAmountColumn = Schema.Columns.AddCalculatedColumn<MelaveMalkaInvitation, Decimal>("AdAmount", row => row.Person.Pledges.Where(p => p.ExternalSource == "Journal " + row.Year).Sum(p => p.Amount));

            ShouldEmailColumn = Schema.Columns.AddValueColumn("ShouldEmail", typeof(Boolean), false);
            ShouldEmailColumn.AllowNulls = false;

            EmailSubjectColumn = Schema.Columns.AddValueColumn("EmailSubject", typeof(String), null);
            EmailSubjectColumn.AllowNulls = true;

            EmailSourceColumn = Schema.Columns.AddValueColumn("EmailSource", typeof(String), null);
            EmailSourceColumn.AllowNulls = true;

            EmailAddressesColumn = Schema.Columns.AddCalculatedColumn<MelaveMalkaInvitation, String>("EmailAddresses", row => String.Join(", ", row.Person.EmailAddresses.Select(e => e.Email)));
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "Invitees";
            SchemaMapping.SqlSchemaName = "MelaveMalka";

            SchemaMapping.Columns.AddMapping(RowIdColumn, "RowId");
            SchemaMapping.Columns.AddMapping(PersonColumn, "PersonId");
            SchemaMapping.Columns.AddMapping(YearColumn, "Year");
            SchemaMapping.Columns.AddMapping(SourceColumn, "Source");
            SchemaMapping.Columns.AddMapping(DateAddedColumn, "DateAdded");
            SchemaMapping.Columns.AddMapping(ShouldCallColumn, "ShouldCall");
            SchemaMapping.Columns.AddMapping(CallerColumn, "Caller");
            SchemaMapping.Columns.AddMapping(CallerNoteColumn, "CallerNote");
            SchemaMapping.Columns.AddMapping(ShouldEmailColumn, "ShouldEmail");
            SchemaMapping.Columns.AddMapping(EmailSubjectColumn, "EmailSubject");
            SchemaMapping.Columns.AddMapping(EmailSourceColumn, "EmailSource");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static MelaveMalkaInfo()
        {
            #region Create Schema
            Schema = new TypedSchema<MelaveMalkaInfo>("MelaveMalkaInfo");

            Schema.PrimaryKey = RowIdColumn = Schema.Columns.AddValueColumn("RowId", typeof(Guid), null);
            RowIdColumn.Unique = true;
            RowIdColumn.AllowNulls = false;

            YearColumn = Schema.Columns.AddValueColumn("Year", typeof(Int32), null);
            YearColumn.Unique = true;
            YearColumn.AllowNulls = false;

            AdDeadlineColumn = Schema.Columns.AddValueColumn("AdDeadline", typeof(DateTime), null);
            AdDeadlineColumn.AllowNulls = false;

            MelaveMalkaDateColumn = Schema.Columns.AddValueColumn("MelaveMalkaDate", typeof(DateTime), null);
            MelaveMalkaDateColumn.AllowNulls = false;

            HonoreeColumn = Schema.Columns.AddForeignKey("Honoree", Person.Schema, "Honorees");
            HonoreeColumn.AllowNulls = false;

            SpeakerColumn = Schema.Columns.AddValueColumn("Speaker", typeof(String), null);
            SpeakerColumn.AllowNulls = false;

            HonoreeTitleColumn = Schema.Columns.AddValueColumn("HonoreeTitle", typeof(String), null);
            HonoreeTitleColumn.AllowNulls = false;

            Honoree2Column = Schema.Columns.AddForeignKey("Honoree2", Person.Schema, "MelaveMalkaInfoes");
            Honoree2Column.AllowNulls = true;

            Honoree2TitleColumn = Schema.Columns.AddValueColumn("Honoree2Title", typeof(String), null);
            Honoree2TitleColumn.AllowNulls = true;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "MelaveMalkaInfo";
            SchemaMapping.SqlSchemaName = "MelaveMalka";

            SchemaMapping.Columns.AddMapping(RowIdColumn, "RowId");
            SchemaMapping.Columns.AddMapping(YearColumn, "Year");
            SchemaMapping.Columns.AddMapping(AdDeadlineColumn, "AdDeadline");
            SchemaMapping.Columns.AddMapping(MelaveMalkaDateColumn, "MelaveMalkaDate");
            SchemaMapping.Columns.AddMapping(HonoreeColumn, "Honoree");
            SchemaMapping.Columns.AddMapping(SpeakerColumn, "Speaker");
            SchemaMapping.Columns.AddMapping(HonoreeTitleColumn, "HonoreeTitle");
            SchemaMapping.Columns.AddMapping(Honoree2Column, "Honoree2");
            SchemaMapping.Columns.AddMapping(Honoree2TitleColumn, "Honoree2Title");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static LoggedStatement()
        {
            #region Create Schema
            Schema = new TypedSchema<LoggedStatement>("StatementLog");

            Schema.PrimaryKey = IdColumn = Schema.Columns.AddValueColumn("Id", typeof(Guid), null);
            IdColumn.Unique = true;
            IdColumn.AllowNulls = false;

            PersonColumn = Schema.Columns.AddForeignKey("Person", Person.Schema, "LoggedStatements");
            PersonColumn.AllowNulls = false;

            DateGeneratedColumn = Schema.Columns.AddValueColumn("DateGenerated", typeof(DateTime), null);
            DateGeneratedColumn.AllowNulls = false;

            MediaColumn = Schema.Columns.AddValueColumn("Media", typeof(String), null);
            MediaColumn.AllowNulls = false;

            StatementKindColumn = Schema.Columns.AddValueColumn("StatementKind", typeof(String), null);
            StatementKindColumn.AllowNulls = false;

            StartDateColumn = Schema.Columns.AddValueColumn("StartDate", typeof(DateTime), null);
            StartDateColumn.AllowNulls = false;

            EndDateColumn = Schema.Columns.AddValueColumn("EndDate", typeof(DateTime), null);
            EndDateColumn.AllowNulls = false;

            UserNameColumn = Schema.Columns.AddValueColumn("UserName", typeof(String), null);
            UserNameColumn.AllowNulls = false;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "StatementLog";
            SchemaMapping.SqlSchemaName = "Billing";

            SchemaMapping.Columns.AddMapping(IdColumn, "Id");
            SchemaMapping.Columns.AddMapping(PersonColumn, "PersonId");
            SchemaMapping.Columns.AddMapping(DateGeneratedColumn, "DateGenerated");
            SchemaMapping.Columns.AddMapping(MediaColumn, "Media");
            SchemaMapping.Columns.AddMapping(StatementKindColumn, "StatementKind");
            SchemaMapping.Columns.AddMapping(StartDateColumn, "StartDate");
            SchemaMapping.Columns.AddMapping(EndDateColumn, "EndDate");
            SchemaMapping.Columns.AddMapping(UserNameColumn, "UserName");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static Deposit()
        {
            #region Create Schema
            Schema = new TypedSchema<Deposit>("Deposits");

            Schema.PrimaryKey = DepositIdColumn = Schema.Columns.AddValueColumn("DepositId", typeof(Guid), null);
            DepositIdColumn.Unique = true;
            DepositIdColumn.AllowNulls = false;

            DateColumn = Schema.Columns.AddValueColumn("Date", typeof(DateTime), null);
            DateColumn.AllowNulls = false;

            NumberColumn = Schema.Columns.AddValueColumn("Number", typeof(Int32), null);
            NumberColumn.AllowNulls = false;

            AccountColumn = Schema.Columns.AddValueColumn("Account", typeof(String), null);
            AccountColumn.AllowNulls = false;

            AmountColumn = Schema.Columns.AddCalculatedColumn<Deposit, Decimal>("Amount", row => row.Payments.Sum(p => p.Amount));

            CountColumn = Schema.Columns.AddCalculatedColumn<Deposit, Int32>("Count", row => row.Payments.Count);
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "Deposits";
            SchemaMapping.SqlSchemaName = "Billing";

            SchemaMapping.Columns.AddMapping(DepositIdColumn, "DepositId");
            SchemaMapping.Columns.AddMapping(DateColumn, "Date");
            SchemaMapping.Columns.AddMapping(NumberColumn, "Number");
            SchemaMapping.Columns.AddMapping(AccountColumn, "Account");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static EmailAddress()
        {
            #region Create Schema
            Schema = new TypedSchema<EmailAddress>("EmailAddresses");

            NameColumn = Schema.Columns.AddValueColumn("Name", typeof(String), null);
            NameColumn.AllowNulls = true;

            EmailColumn = Schema.Columns.AddValueColumn("Email", typeof(String), null);
            EmailColumn.Unique = true;
            EmailColumn.AllowNulls = false;

            RandomCodeColumn = Schema.Columns.AddValueColumn("RandomCode", typeof(String), null);
            RandomCodeColumn.AllowNulls = true;

            ActiveColumn = Schema.Columns.AddValueColumn("Active", typeof(Boolean), true);
            ActiveColumn.AllowNulls = false;

            DateAddedColumn = Schema.Columns.AddValueColumn("DateAdded", typeof(DateTime), null);
            DateAddedColumn.AllowNulls = false;

            UseHtmlColumn = Schema.Columns.AddValueColumn("UseHtml", typeof(Boolean), true);
            UseHtmlColumn.AllowNulls = false;

            PersonColumn = Schema.Columns.AddForeignKey("Person", Person.Schema, "EmailAddresses");
            PersonColumn.AllowNulls = true;

            Schema.PrimaryKey = RowIdColumn = Schema.Columns.AddValueColumn("RowId", typeof(Guid), null);
            RowIdColumn.Unique = true;
            RowIdColumn.AllowNulls = false;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "tblMLMembers";
            SchemaMapping.SqlSchemaName = "dbo";

            SchemaMapping.Columns.AddMapping(NameColumn, "Name");
            SchemaMapping.Columns.AddMapping(EmailColumn, "Email");
            SchemaMapping.Columns.AddMapping(RandomCodeColumn, "ID_Code");
            SchemaMapping.Columns.AddMapping(ActiveColumn, "Active");
            SchemaMapping.Columns.AddMapping(DateAddedColumn, "Join_Date");
            SchemaMapping.Columns.AddMapping(UseHtmlColumn, "HTMLformat");
            SchemaMapping.Columns.AddMapping(PersonColumn, "PersonId");
            SchemaMapping.Columns.AddMapping(RowIdColumn, "RowId");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static Payment()
        {
            #region Create Schema
            Schema = new TypedSchema<Payment>("Payments");

            Schema.PrimaryKey = PaymentIdColumn = Schema.Columns.AddValueColumn("PaymentId", typeof(Guid), null);
            PaymentIdColumn.Unique = true;
            PaymentIdColumn.AllowNulls = false;

            PersonColumn = Schema.Columns.AddForeignKey("Person", Person.Schema, "Payments");
            PersonColumn.AllowNulls = false;

            DateColumn = Schema.Columns.AddValueColumn("Date", typeof(DateTime), null);
            DateColumn.AllowNulls = false;

            MethodColumn = Schema.Columns.AddValueColumn("Method", typeof(String), null);
            MethodColumn.AllowNulls = false;

            CheckNumberColumn = Schema.Columns.AddValueColumn("CheckNumber", typeof(String), null);
            CheckNumberColumn.AllowNulls = true;

            AccountColumn = Schema.Columns.AddValueColumn("Account", typeof(String), null);
            AccountColumn.AllowNulls = false;

            AmountColumn = Schema.Columns.AddValueColumn("Amount", typeof(Decimal), null);
            AmountColumn.AllowNulls = false;

            DepositColumn = Schema.Columns.AddForeignKey("Deposit", Deposit.Schema, "Payments");
            DepositColumn.AllowNulls = true;

            CommentsColumn = Schema.Columns.AddValueColumn("Comments", typeof(String), null);
            CommentsColumn.AllowNulls = true;

            ModifiedColumn = Schema.Columns.AddValueColumn("Modified", typeof(DateTime), null);
            ModifiedColumn.AllowNulls = false;

            ModifierColumn = Schema.Columns.AddValueColumn("Modifier", typeof(String), null);
            ModifierColumn.AllowNulls = false;

            ExternalSourceColumn = Schema.Columns.AddValueColumn("ExternalSource", typeof(String), null);
            ExternalSourceColumn.AllowNulls = true;

            ExternalIdColumn = Schema.Columns.AddValueColumn("ExternalId", typeof(Int32), null);
            ExternalIdColumn.AllowNulls = true;

            CompanyColumn = Schema.Columns.AddValueColumn("Company", typeof(String), null);
            CompanyColumn.AllowNulls = true;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "Payments";
            SchemaMapping.SqlSchemaName = "Billing";

            SchemaMapping.Columns.AddMapping(PaymentIdColumn, "PaymentId");
            SchemaMapping.Columns.AddMapping(PersonColumn, "PersonId");
            SchemaMapping.Columns.AddMapping(DateColumn, "Date");
            SchemaMapping.Columns.AddMapping(MethodColumn, "Method");
            SchemaMapping.Columns.AddMapping(CheckNumberColumn, "CheckNumber");
            SchemaMapping.Columns.AddMapping(AccountColumn, "Account");
            SchemaMapping.Columns.AddMapping(AmountColumn, "Amount");
            SchemaMapping.Columns.AddMapping(DepositColumn, "DepositId");
            SchemaMapping.Columns.AddMapping(CommentsColumn, "Comments");
            SchemaMapping.Columns.AddMapping(ModifiedColumn, "Modified");
            SchemaMapping.Columns.AddMapping(ModifierColumn, "Modifier");
            SchemaMapping.Columns.AddMapping(ExternalSourceColumn, "ExternalSource");
            SchemaMapping.Columns.AddMapping(ExternalIdColumn, "ExternalID");
            SchemaMapping.Columns.AddMapping(CompanyColumn, "Company");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
Beispiel #18
0
        static StagedPerson()
        {
            #region Create Schema
            Schema = new TypedSchema<StagedPerson>("StagedPeople");

            Schema.PrimaryKey = StagedPersonIdColumn = Schema.Columns.AddValueColumn("StagedPersonId", typeof(Guid), null);
            StagedPersonIdColumn.Unique = true;
            StagedPersonIdColumn.AllowNulls = false;

            PersonColumn = Schema.Columns.AddForeignKey("Person", Person.Schema, "StagedPeople");
            PersonColumn.AllowNulls = true;

            HisNameColumn = Schema.Columns.AddValueColumn("HisName", typeof(String), null);
            HisNameColumn.AllowNulls = true;

            HerNameColumn = Schema.Columns.AddValueColumn("HerName", typeof(String), null);
            HerNameColumn.AllowNulls = true;

            LastNameColumn = Schema.Columns.AddValueColumn("LastName", typeof(String), null);
            LastNameColumn.AllowNulls = false;

            FullNameColumn = Schema.Columns.AddValueColumn("FullName", typeof(String), null);
            FullNameColumn.AllowNulls = false;

            AddressColumn = Schema.Columns.AddValueColumn("Address", typeof(String), null);
            AddressColumn.AllowNulls = false;

            CityColumn = Schema.Columns.AddValueColumn("City", typeof(String), null);
            CityColumn.AllowNulls = true;

            StateColumn = Schema.Columns.AddValueColumn("State", typeof(String), null);
            StateColumn.AllowNulls = true;

            ZipColumn = Schema.Columns.AddValueColumn("Zip", typeof(String), null);
            ZipColumn.AllowNulls = true;

            PhoneColumn = Schema.Columns.AddValueColumn("Phone", typeof(String), "");
            PhoneColumn.AllowNulls = false;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "StagedPeople";
            SchemaMapping.SqlSchemaName = "BillingMigration";

            SchemaMapping.Columns.AddMapping(StagedPersonIdColumn, "StagedPersonId");
            SchemaMapping.Columns.AddMapping(PersonColumn, "PersonId");
            SchemaMapping.Columns.AddMapping(HisNameColumn, "HisName");
            SchemaMapping.Columns.AddMapping(HerNameColumn, "HerName");
            SchemaMapping.Columns.AddMapping(LastNameColumn, "LastName");
            SchemaMapping.Columns.AddMapping(FullNameColumn, "FullName");
            SchemaMapping.Columns.AddMapping(AddressColumn, "Address");
            SchemaMapping.Columns.AddMapping(CityColumn, "City");
            SchemaMapping.Columns.AddMapping(StateColumn, "State");
            SchemaMapping.Columns.AddMapping(ZipColumn, "Zip");
            SchemaMapping.Columns.AddMapping(PhoneColumn, "Phone");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }
        static Person()
        {
            #region Create Schema
            Schema = new TypedSchema<Person>("MasterDirectory");

            Schema.PrimaryKey = IdColumn = Schema.Columns.AddValueColumn("Id", typeof(Guid), null);
            IdColumn.Unique = true;
            IdColumn.AllowNulls = false;

            YKIDColumn = Schema.Columns.AddValueColumn("YKID", typeof(Int32), null);
            YKIDColumn.AllowNulls = true;

            LastNameColumn = Schema.Columns.AddValueColumn("LastName", typeof(String), null);
            LastNameColumn.AllowNulls = false;

            HisNameColumn = Schema.Columns.AddValueColumn("HisName", typeof(String), null);
            HisNameColumn.AllowNulls = true;

            HerNameColumn = Schema.Columns.AddValueColumn("HerName", typeof(String), null);
            HerNameColumn.AllowNulls = true;

            FullNameColumn = Schema.Columns.AddValueColumn("FullName", typeof(String), null);
            FullNameColumn.AllowNulls = true;

            AddressColumn = Schema.Columns.AddValueColumn("Address", typeof(String), null);
            AddressColumn.AllowNulls = true;

            CityColumn = Schema.Columns.AddValueColumn("City", typeof(String), null);
            CityColumn.AllowNulls = true;

            StateColumn = Schema.Columns.AddValueColumn("State", typeof(String), null);
            StateColumn.AllowNulls = true;

            ZipColumn = Schema.Columns.AddValueColumn("Zip", typeof(String), null);
            ZipColumn.AllowNulls = true;

            PhoneColumn = Schema.Columns.AddValueColumn("Phone", typeof(String), null);
            PhoneColumn.AllowNulls = false;

            SourceColumn = Schema.Columns.AddValueColumn("Source", typeof(String), null);
            SourceColumn.AllowNulls = false;

            SalutationColumn = Schema.Columns.AddValueColumn("Salutation", typeof(String), null);
            SalutationColumn.AllowNulls = false;
            #endregion

            #region Create SchemaMapping
            SchemaMapping = new SchemaMapping(Schema, false);
            SchemaMapping.SqlName = "MasterDirectory";
            SchemaMapping.SqlSchemaName = "Data";

            SchemaMapping.Columns.AddMapping(IdColumn, "Id");
            SchemaMapping.Columns.AddMapping(YKIDColumn, "YKID");
            SchemaMapping.Columns.AddMapping(LastNameColumn, "LastName");
            SchemaMapping.Columns.AddMapping(HisNameColumn, "HisName");
            SchemaMapping.Columns.AddMapping(HerNameColumn, "HerName");
            SchemaMapping.Columns.AddMapping(FullNameColumn, "FullName");
            SchemaMapping.Columns.AddMapping(AddressColumn, "Address");
            SchemaMapping.Columns.AddMapping(CityColumn, "City");
            SchemaMapping.Columns.AddMapping(StateColumn, "State");
            SchemaMapping.Columns.AddMapping(ZipColumn, "Zip");
            SchemaMapping.Columns.AddMapping(PhoneColumn, "Phone");
            SchemaMapping.Columns.AddMapping(SourceColumn, "Source");
            SchemaMapping.Columns.AddMapping(SalutationColumn, "Salutation");
            #endregion
            SchemaMapping.SetPrimaryMapping(SchemaMapping);
        }