private void LoadLicenseTypes(EditEntitlementModel model) { var availableLicanseTypes = EntitlementsProvider.GetLicenseTypes(); model.AvailableLicanseTypes = availableLicanseTypes.Select(t => new SelectListItem { Text = t.Name, Value = t.Id.ToString() }); }
private static void AddEntitlementsToModel(decimal clientId, EntitlementsModel model, List <EEntitlement> entitlements) { List <ELicenseType> licTypes = EntitlementsProvider.GetLicenseTypes(); List <EditEntitlementModel> entModels = new List <EditEntitlementModel>(); foreach (EEntitlement dbEnt in entitlements) { var entModel = new EditEntitlementModel() { LicenseTypeName = licTypes.FirstOrDefault(l => l.Id == dbEnt.LicenseTypeId).Name }; entModels.Add(entModel.LoadEntitlement(dbEnt)); entModel.Projectname = ProjectsProvider.GetProject(entModel.ProjectId).ProjectName; } model.Entitlemens = entModels; model.ClientId = clientId; model.ClientInternalName = ClientsProvider.GetClient(clientId).Name; }