Exemple #1
0
        public ActionResult GetBps(string bpType)
        {
            var businessPartnerType = (BusinessPartnerTypes)Convert.ToInt32(bpType);
            var criteria            = new SearchCriteria <BusinessPartnerDTO>();

            criteria.FiList.Add(b => b.BusinessPartnerType == businessPartnerType);

            IEnumerable <BusinessPartnerDTO> bps = new BusinessPartnerService(true)
                                                   .GetAll(criteria);
            IList <ListViewModel> bpVms = bps.Select(bpDTO => new ListViewModel()
            {
                Name = bpDTO.DisplayName,
                Id   = bpDTO.Id
            }).ToList();

            return(Json(bpVms, JsonRequestBehavior.AllowGet));
        }