Exemple #1
0
        public ContactMaint()
        {
            PXUIFieldAttribute.SetRequired <Contact.lastName>(Contact.Cache, true);

            PXUIFieldAttribute.SetDisplayName <BAccountR.acctCD>(Caches[typeof(BAccountR)], Messages.BAccountCD);
            PXUIFieldAttribute.SetDisplayName <BAccountR.acctName>(Caches[typeof(BAccountR)], Messages.BAccountName);

            // HACK graph can contain separate caches for BAccount and BAccountR, so force display names for BAccount cache
            PXUIFieldAttribute.SetDisplayName <BAccount.acctCD>(Caches[typeof(BAccount)], Messages.BAccountCD);
            PXUIFieldAttribute.SetDisplayName <BAccount.acctName>(Caches[typeof(BAccount)], Messages.BAccountName);

            Activities.GetNewEmailAddress =
                () =>
            {
                var contact = Contact.Current;
                return(contact != null && !string.IsNullOrWhiteSpace(contact.EMail)
                                                ? PXDBEmailAttribute.FormatAddressesWithSingleDisplayName(contact.EMail, contact.DisplayName)
                                                : String.Empty);
            };

            PXUIFieldAttribute.SetEnabled <EPLoginTypeAllowsRole.rolename>(Roles.Cache, null, false);
            Roles.Cache.AllowInsert = false;
            Roles.Cache.AllowDelete = false;
            PXUIFieldAttribute.SetVisible <CRMarketingListMember.format>(Subscriptions.Cache, null, false);

            PXUIFieldAttribute.SetVisible <Contact.languageID>(ContactCurrent.Cache, null, PXDBLocalizableStringAttribute.HasMultipleLocales);
        }
Exemple #2
0
        public LeadMaint()
        {
            PXUIFieldAttribute.SetRequired <Contact.status>(Lead.Cache, true);
            PXUIFieldAttribute.SetRequired <Contact.lastName>(Lead.Cache, true);

            PXUIFieldAttribute.SetDisplayName <BAccount.acctCD>(bAccountBasic.Cache, Messages.BAccountCD);
            PXUIFieldAttribute.SetDisplayName <BAccount.acctName>(bAccountBasic.Cache, Messages.BAccountName);

            PXUIFieldAttribute.SetEnabled <Contact.assignDate>(Lead.Cache, Lead.Cache.Current, false);

            Activities.GetNewEmailAddress =
                () =>
            {
                var contact = Lead.Current;
                return(contact != null && !string.IsNullOrWhiteSpace(contact.EMail)
                                                ? PXDBEmailAttribute.FormatAddressesWithSingleDisplayName(contact.EMail, contact.DisplayName)
                                                : String.Empty);
            };
            if (this.IsImport && !this.IsExport)
            {
                Lead.WhereNew <Where <Contact.contactType, Equal <ContactTypesAttribute.lead> > >();
                Lead.OrderByNew <OrderBy <Asc <Contact.majorStatus, Desc <Contact.duplicateStatus, Asc <Contact.contactID> > > > >();
            }
            PXUIFieldAttribute.SetVisible <CRMarketingListMember.format>(Subscriptions.Cache, null, false);
        }
Exemple #3
0
        public ProjectTaskEntry()
        {
            if (Setup.Current == null)
            {
                throw new PXException(Messages.SetupNotConfigured);
            }

            Activities.GetNewEmailAddress =
                () =>
            {
                PMProject current = Project.Select();
                if (current != null)
                {
                    Contact customerContact = PXSelectJoin <Contact, InnerJoin <BAccount, On <BAccount.defContactID, Equal <Contact.contactID> > >, Where <BAccount.bAccountID, Equal <Required <BAccount.bAccountID> > > > .Select(this, current.CustomerID);

                    if (customerContact != null && !string.IsNullOrWhiteSpace(customerContact.EMail))
                    {
                        return(PXDBEmailAttribute.FormatAddressesWithSingleDisplayName(customerContact.EMail, customerContact.DisplayName));
                    }
                }
                return(String.Empty);
            };
        }
Exemple #4
0
        protected List <MailAddress> GenerateAddress(Contact employeeContact, Users user)
        {
            string displayName = null;
            string address     = null;

            if (user != null && user.PKID != null)
            {
                var userDisplayName = user.FullName.With(_ => _.Trim());
                if (!string.IsNullOrEmpty(userDisplayName))
                {
                    displayName = userDisplayName;
                }
                var userAddress = user.Email.With(_ => _.Trim());
                if (!string.IsNullOrEmpty(userAddress))
                {
                    address = userAddress;
                }
            }
            if (employeeContact != null && employeeContact.BAccountID != null)
            {
                var employeeDisplayName = employeeContact.DisplayName.With(_ => _.Trim());
                if (!string.IsNullOrEmpty(employeeDisplayName))
                {
                    displayName = employeeDisplayName;
                }
                var employeeAddress = employeeContact.EMail.With(_ => _.Trim());
                if (!string.IsNullOrEmpty(employeeAddress))
                {
                    address = employeeAddress;
                }
            }
            return(string.IsNullOrEmpty(address)
                                ? null
                                : EmailParser.ParseAddresses(
                       PXDBEmailAttribute.FormatAddressesWithSingleDisplayName(address, displayName)
                       ));
        }