Пример #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 ConfirmButton_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(ClientIdentifierTextBox.Text) || String.IsNullOrEmpty(ClientSecretTextBox.Text))
     {
         SalesForceError.Report(GetString("sf.authorization.missingconsumerinput"));
     }
     else
     {
         Credentials.ClientId     = ClientIdentifierTextBox.Text;
         Credentials.ClientSecret = ClientSecretTextBox.Text;
         try
         {
             StoreParameters();
             SalesForceAuthorizationHelper authorizationHelper = new SalesForceAuthorizationHelper(Credentials.ClientId, Credentials.ClientSecret, RedirectUrl);
             string authorizationUrl = authorizationHelper.GetAuthorizationUrl(ParametersId);
             Response.Redirect(authorizationUrl, false);
         }
         catch (Exception exception)
         {
             HandleError(exception);
         }
     }
 }
Пример #3
0
 private void HandleError(Exception exception)
 {
     SalesForceError.Report(exception);
     EventLogProvider.LogException("Salesforce.com Connector", "MappingEditorPage", exception);
 }
Пример #4
0
 private void HandleError(Exception exception)
 {
     SalesForceError.Report(exception);
     EventLogProvider.LogException("Salesforce.com Connector", "ScoreFormControl", exception);
 }
Пример #5
0
 private void HandleError(Exception exception)
 {
     SalesForceError.Report(exception);
     Service.Resolve <IEventLogService>().LogException("Salesforce.com Connector", "MappingFormControl", exception);
 }
Пример #6
0
 private void HandleError(Exception exception)
 {
     SalesForceError.Report(exception);
     EventLogProvider.LogException("Salesforce.com Connector", "AuthorizationSetupPage", exception);
 }
Пример #7
0
 private void HandleError(Exception exception)
 {
     SalesForceError.Report(exception);
     Service.Resolve <IEventLogService>().LogException("Salesforce.com Connector", "AuthorizationSetupPage", exception);
 }