コード例 #1
0
    private bool ValidateInput()
    {
        List <string> errors = new List <string>();

        if (String.IsNullOrEmpty(ExternalAttributeDropDownListEx.SelectedValue))
        {
            errors.Add(GetString("sf.mapping.noexternalattributeselected"));
        }
        foreach (EntityAttributeModel attributeModel in AttributeModels.Where(x => !x.IsNullable && !x.HasDefaultValue))
        {
            MappingEditorItem control = null;
            if (MappingItems.TryGetValue(attributeModel.Name, out control))
            {
                if (control.MappingItem == null)
                {
                    string error = String.Format(GetString("sf.mapping.requiredattributemappingmissing"), attributeModel.Label);
                    errors.Add(error);
                }
            }
        }
        if (errors.Count > 0)
        {
            SalesForceError.Report(GetString("sf.mapping.validationerror"), errors);
            return(false);
        }

        return(true);
    }
コード例 #2
0
    protected void AttributeRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        EntityAttributeModel attributeModel = e.Item.DataItem as EntityAttributeModel;
        MappingEditorItem    control        = e.Item.FindControl("MappingEditorItemControl") as MappingEditorItem;

        control.EntityModel          = EntityModel;
        control.EntityAttributeModel = attributeModel;
        control.FormInfo             = FormInfo;
        control.ConverterFactory     = AttributeValueConverterFactory;
        control.SourceMappingItem    = SourceMapping.GetItem(attributeModel.Name);
        control.Initialize();
        MappingItems.Add(attributeModel.Name, control);
    }