Esempio n. 1
0
        public DealBlankApiModel PrepareNewDeal()
        {
            var apiModel = new DealBlankApiModel();

            apiModel.priorities = _priorityRepository.GetAllPriorities().Select(c => new PrioritySelectionApiModel()
            {
                id = c.ID, name = c.Name, selected = false
            }).ToList();
            apiModel.stages = _dealRepository.GetAllStages().Select(c => new StageLinkApiModel()
            {
                id = c.ID, name = c.Name, probability = c.Probability.GetValueOrDefault(), selected = false, passed = false
            }).ToList();
            apiModel.lostReasons = _dealRepository.GetAllLostReason().Select(c => new LostReasonLinkApiModel()
            {
                id = c.ID, reason = c.Reason, selected = false
            }).ToList();
            return(apiModel);
        }