Ejemplo n.º 1
0
    protected void wzEnterInfo_StepChanged(object sender, EventArgs e)
    {
        switch (wzEnterInfo.ActiveStepIndex)
        {
        // MS-5360
        case 0:
            DeleteCurrentForm();
            break;

        case 1:
            CustomFieldSet1.Harvest();
            // MS-5360
            targetInstance      = APIExtensions.SaveObject(targetInstance);
            CurrentFormID.Value = targetInstance["ID"].ToString();
            CustomFieldSet2.MemberSuiteObject = targetInstance;
            CustomFieldSet2.Bind();
            break;

        case 2:
            SubmitForm();
            if (ConciergeAPI.CurrentEntity == null && targetForm.AnonymousSubmissionCompletionUrl != null)
            {
                wzEnterInfo.FinishDestinationPageUrl = targetForm.AnonymousSubmissionCompletionUrl;
            }

            wzEnterInfo.DisplayCancelButton = false;

            break;
        }
    }
Ejemplo n.º 2
0
    private void SubmitForm()
    {
        targetInstance = APIExtensions.SaveObject(targetInstance);

        // ok, log an activity
        if (ConciergeAPI.CurrentEntity != null)
        {
            if (targetForm.ActivityType != null)
            {
                msActivity a = CreateNewObject <msActivity>();
                a.Type   = targetForm.ActivityType;
                a.Name   = targetForm.Name;
                a.Date   = DateTime.Now;
                a.Entity = ConciergeAPI.CurrentEntity.ID;
                SaveObject(a);
            }

            // ok, send an email
            if (!string.IsNullOrWhiteSpace(targetForm.ConfirmationEmail))
            {
                using (var api = GetServiceAPIProxy())
                {
                    var emailTemplate = api.Get(targetForm.ConfirmationEmail).ResultValue.ConvertTo <msEmailTemplateContainer>();
                    api.SendTransactionalEmail(emailTemplate.Name, CurrentEntity.ID, null);
                }
            }
        }
    }
Ejemplo n.º 3
0
 protected T SaveObject <T>(T msoObjectToSave) where T : msAggregate
 {
     return(APIExtensions.SaveObject <T>(msoObjectToSave));
 }