public List <UtilityModel <uint> > GetPermits()
 {
     using (var db = DB.GetContext())
     {
         return(DriverLicenseRepository.GetPermits(db)
                .Select(p => new UtilityModel <uint>(p.PermitID, p.PermitName))
                .ToList());
     }
 }
Ejemplo n.º 2
0
 private void RefreshPermits()
 {
     using (var db = DB.GetContext())
     {
         this.Permits.Clear();
         var perms = DriverLicenseRepository.GetPermits(db)
                     .Select(p => new UtilityModel <uint>(p.PermitID, p.PermitName));
         this.Permits.AddRange(perms);
         var check = this.Permits.Where(p => this.ActiveModel.Permits.Any(pp => pp.PermitID == p.Value));
         foreach (var permit in check)
         {
             permit.IsCheck = true;
         }
     }
 }