private void btnExportOrgContacts_Click(object sender, EventArgs e)
        {
            var dataset = from p in db.CRM_PersonOrganisations
                          where !p.CRM_Organisation.IsArchived
                          where !p.CRM_Person.IsArchived
                          let Role = p.CRM_Role.Name
                                     orderby p.CRM_Organisation.Name
                                     select new
            {
                p.CRM_OrganisationID,
                p.CRM_Organisation.Name,
                p.Title,
                p.Firstname,
                p.Lastname,
                Role,
                p.Email,
                p.Telephone,
                p.OrgAddress1,
                p.OrgAddress2,
                p.OrgAddress3,
                p.OrgPostcode
            };

            CSVExport.GenericExport(dataset.ToArray(), "org-contacts");
        }
예제 #2
0
        protected void btnExportLearningContacts_Click(object sender, EventArgs e)
        {
            var constituents = Learning();

            var dataset = from p in db.CRM_Persons
                          where db.CRM_FormFieldResponses.Any(r =>
                                                              r.CRM_FormFieldItemID != null && constituents.Contains((int)r.CRM_FormFieldItemID) &&
                                                              r.TargetReference == p.Reference)
                          let constituentOutput = p.ConstituentTypeOutput(db, " ")
                                                  where !p.IsArchived
                                                  select new {
                p.Title,
                p.Firstname,
                p.Lastname,
                p.IsAnnualPassHolder,
                p.PrimaryEmail,
                p.CalculatedSalutation,
                constituentOutput,
                p.PrimaryAddressLine1,
                p.PrimaryAddressLine2,
                p.PrimaryAddressLine3,
                p.PrimaryAddressLine4,
                p.PrimaryAddressLine5,
                p.PrimaryAddressTown,
                p.PrimaryAddressCounty,
                p.PrimaryAddressPostcode,
                p.PrimaryAddressCountry,
                p.NextExpiryDate,
                p.IsDoNotEmail,
                p.IsDoNotMail
            };

            CSVExport.GenericExport(dataset.ToArray(), "learning-contacts");
        }
예제 #3
0
        protected void btnExportByInterest_Click(object sender, EventArgs e)
        {
            //var dataset = from p in db.CRM_Persons
            //              where !p.IsArchived
            //              let Responses = db.CRM_FormFieldResponses.Where(r => r.TargetReference == p.Reference && r.CRM_FormFieldID == 1)
            //              select new ExportByInterestHelper{
            //                  Person = p,
            //                  Responses = Responses
            //              };

            //List<CRM_FormFieldItem> items = db.CRM_FormFieldItems.Where(r => r.CRM_FormFieldID == 1).ToList(); // Constituents

            //CSVExport.ContactsByInterest(dataset.ToList(), items, Response);

            var dataset = from p in db.CRM_Persons
                          where db.CRM_FormFieldResponses.Any(r =>
                                                              r.CRM_FormFieldItemID != null && ddlInterest.SelectedValue == ((int)r.CRM_FormFieldItemID).ToString() &&
                                                              r.TargetReference == p.Reference)
                          let constituentOutput = p.ConstituentTypeOutput(db, " ")
                                                  where !p.IsArchived
                                                  select new
            {
                p.Title,
                p.Firstname,
                p.Lastname,
                p.IsAnnualPassHolder,
                p.PrimaryEmail,
                p.CalculatedSalutation,
                p.PrimaryAddressLine1,
                p.PrimaryAddressLine2,
                p.PrimaryAddressLine3,
                p.PrimaryAddressLine4,
                p.PrimaryAddressLine5,
                p.PrimaryAddressTown,
                p.PrimaryAddressCounty,
                p.PrimaryAddressPostcode,
                p.PrimaryAddressCountry,
                p.NextExpiryDate,
                p.IsDoNotEmail,
                p.IsDoNotMail,
                constituentOutput
            };

            CSVExport.GenericExport(dataset.ToArray(), "byinterest-contacts");
        }
예제 #4
0
        protected void btnExportExhibitionPostal_Click(object sender, EventArgs e)
        {
            var constituents = ExhibitionPostals();

            var dataset = from p in (from p in db.CRM_Persons
                                     where !p.IsArchived
                                     where db.CRM_FormFieldResponses.Any(r =>
                                                                         r.CRM_FormFieldItemID != null &&
                                                                         constituents.Contains((int)r.CRM_FormFieldItemID) &&
                                                                         r.TargetReference == p.Reference)
                                     where !p.IsDoNotMail
                                     select p
                                     ).ToList().DistinctOnRelations().DistinctOnNamePostcode()
                          where !p.IsAnnualPassHolder
                          let ConstituentType = p.ConstituentTypeOutput(db, ", ")
                                                select new {
                ConstituentType,
                p.RelationshipSaltuation,
                p.Title,
                p.Firstname,
                p.Lastname,
                p.OrganisationRole,
                p.OrganisationName,
                p.PrimaryAddressLine1,
                p.PrimaryAddressLine2,
                p.PrimaryAddressLine3,
                p.PrimaryAddressCounty,
                p.PrimaryAddressPostcode,
                p.PrimaryAddressCountry,
                p.PrimaryEmail
            };



            CSVExport.GenericExport(dataset.ToArray(), "exhibition-postals");
        }
 protected void btnExport_Click(object sender, EventArgs e)
 {
     DQManager = new DataQueryManager(Type, ViewID);
     DQManager.IncludeDataReference = rbMailOut.Checked || rbEmail.Checked;
     CSVExport.GenericExport(DQManager.GetSchema(), FilterDownForMail(FormData()), Response, DQManager.GetDataTable().TableReference);
 }