Exemple #1
0
        private void LoadWizardData(Contact client)
        {
            TempData["ClientId"] = client.Id;

            Steps = StepMapper.ToSteps(client).OrderBy(x => x.Position).ToList();

            for (var i = 0; i < Steps.Count; i++)
            {
                TempData.Set($"Step{i}", Steps[i]);
            }
        }
Exemple #2
0
        private Contact ProcessSteps(StepViewModel finalStep)
        {
            for (var i = 0; i < Steps.Count; i++)
            {
                var data = TempData.Peek($"Step{i}");
                JsonConvert.PopulateObject((string)data, Steps[i]);
            }

            Steps[CurrentStepIndex] = finalStep;

            var contact = new Contact();

            if (TempData.Peek("ClientId") != null)
            {
                contact.Id = (int)TempData["ClientId"];
            }

            StepMapper.EnrichClient(contact, Steps);
            return(contact);
        }