private static string GetContactPointInfo(ExternalPractitionerContactPointDetail cp)
        {
            var builder = new StringBuilder();

            builder.AppendFormat("Description: {0}", cp.Description);
            builder.AppendLine();
            builder.AppendFormat(SR.FormatPhone, cp.CurrentPhoneNumber == null ? "" : TelephoneFormat.Format(cp.CurrentPhoneNumber));
            builder.AppendLine();
            builder.AppendFormat(SR.FormatFax, cp.CurrentFaxNumber == null ? "" : TelephoneFormat.Format(cp.CurrentFaxNumber));
            builder.AppendLine();
            builder.AppendFormat(SR.FormatAddress, cp.CurrentAddress == null ? "" : AddressFormat.Format(cp.CurrentAddress));
            builder.AppendLine();
            builder.AppendFormat(SR.FormatEmail, cp.CurrentEmailAddress == null ? "" : cp.CurrentEmailAddress.Address);
            return(builder.ToString());
        }
 /// <summary>
 /// Formats the specified Telephone number (must be a non-formatted 10-digit string).
 /// </summary>
 /// <param name="telephone"></param>
 /// <returns></returns>
 public string FormatStringTelephone(string telephone)
 {
     return(TelephoneFormat.Format(telephone, TextFieldMasks.TelephoneNumberFullMask));
 }
            /// <summary>
            /// Formats the specified Telephone number (must be a JSML encoded <see cref="TelephoneDetail"/> object).
            /// </summary>
            /// <param name="jsml"></param>
            /// <returns></returns>
            public string FormatTelephone(string jsml)
            {
                var telephoneDetail = JsmlSerializer.Deserialize <TelephoneDetail>(jsml);

                return(telephoneDetail == null ? "" : TelephoneFormat.Format(telephoneDetail));
            }
            public ExternalPractitionerContactPointTable()
                : base(NumRows)
            {
                var activeColumn = new TableColumn <ExternalPractitionerContactPointDetail, bool>(SR.ColumnActive,
                                                                                                  cp => !cp.Deactivated, SetDeactivatedStatus, 0.1f);

                var defaultColumn = new TableColumn <ExternalPractitionerContactPointDetail, bool>(SR.ColumnDefault,
                                                                                                   cp => cp.IsDefaultContactPoint, MakeDefaultContactPoint, 0.1f);

                var nameColumn = new TableColumn <ExternalPractitionerContactPointDetail, string>(SR.ColumnName,
                                                                                                  cp => cp.Name, 0.3f);

                var descriptionColumn = new TableColumn <ExternalPractitionerContactPointDetail, string>(SR.ColumnDescription,
                                                                                                         cp => cp.Description, 0.5f);

                var phoneColumn = new TableColumn <ExternalPractitionerContactPointDetail, string>(SR.ColumnPhone,
                                                                                                   cp => string.Format(SR.FormatPhone, cp.CurrentPhoneNumber == null ? "" : TelephoneFormat.Format(cp.CurrentPhoneNumber)),
                                                                                                   1.0f, PhoneRow);

                var faxColumn = new TableColumn <ExternalPractitionerContactPointDetail, string>(SR.ColumnFax,
                                                                                                 cp => string.Format(SR.FormatFax, cp.CurrentFaxNumber == null ? "" : TelephoneFormat.Format(cp.CurrentFaxNumber)),
                                                                                                 1.0f, FaxRow);

                var addressColumn = new TableColumn <ExternalPractitionerContactPointDetail, string>(SR.ColumnAddress,
                                                                                                     cp => string.Format(SR.FormatAddress, cp.CurrentAddress == null ? "" : AddressFormat.Format(cp.CurrentAddress)),
                                                                                                     1.0f, AddressRow);

                var emailColumn = new TableColumn <ExternalPractitionerContactPointDetail, string>(SR.ColumnEmail,
                                                                                                   cp => string.Format(SR.FormatEmail, cp.CurrentEmailAddress == null ? "" : cp.CurrentEmailAddress.Address),
                                                                                                   1.0f, EmailRow);

                this.Columns.Add(activeColumn);
                this.Columns.Add(defaultColumn);
                this.Columns.Add(nameColumn);
                this.Columns.Add(descriptionColumn);
                this.Columns.Add(phoneColumn);
                this.Columns.Add(faxColumn);
                this.Columns.Add(addressColumn);
                this.Columns.Add(emailColumn);
            }
Beispiel #5
0
 public TelephoneNumberTable()
 {
     this.Columns.Add(new TableColumn <TelephoneDetail, string>(SR.ColumnType,
                                                                delegate(TelephoneDetail t) { return(t.Type.Value); },
                                                                1.1f));
     this.Columns.Add(new TableColumn <TelephoneDetail, string>(SR.ColumnNumber,
                                                                delegate(TelephoneDetail pn) { return(TelephoneFormat.Format(pn)); },
                                                                2.2f));
     this.Columns.Add(new DateTableColumn <TelephoneDetail>(SR.ColumnExpiryDate,
                                                            delegate(TelephoneDetail pn) { return(pn.ValidRangeUntil); },
                                                            0.9f));
 }