コード例 #1
0
    /// <summary>
    /// Initializes the form with the required dependencies and the specified CMS contact.
    /// </summary>
    protected void InitializeDataComForm()
    {
        IDataComConfiguration configuration = DataComHelper.GetConfiguration();
        ContactInfo           contactInfo   = EditedObject as ContactInfo;

        ContactForm.ParametersIdentifier         = BuyParametersIdentifier;
        ContactForm.FormInformation              = DataComHelper.GetContactFormInfo();
        ContactForm.EntityInfo                   = DataComHelper.GetContactEntityInfo();
        ContactForm.EntityMapping                = configuration.GetContactMapping();
        ContactForm.EntityAttributeMapperFactory = DataComHelper.GetContactAttributeMapperFactory();
        ContactForm.Entity = Contact;
        ContactForm.EntityAttributeFormatter = DataComHelper.GetEntityAttributeFormatter();
        ContactForm.BuyContactEnabled        = (credentialProvider.GetCredential() != null);
        ContactForm.DefaultFieldLayout       = FieldLayoutEnum.ThreeColumns;
        ContactForm.DefaultFormLayout        = FormLayoutEnum.SingleTable;
        ContactForm.Restore(contactInfo);
    }