Exemple #1
0
 public static AspNetUser GetAspNetUser(string userId)
 {
     using (btfbEntities db = new btfbEntities())
     {
         return(db.AspNetUsers.First(u => u.Id == userId));
     }
 }
Exemple #2
0
 public List <Model> GetModelsFromMake(int makeId)
 {
     try
     {
         using (btfbEntities db = new btfbEntities())
         {
             return(db.Models.Where(x => x.MakeId == makeId).ToList());
         }
     }
     catch
     {
         return(null);
     }
 }
Exemple #3
0
 public Make GetMake(int makeId)
 {
     try
     {
         using (btfbEntities db = new btfbEntities())
         {
             return(db.Makes.Include("Models").OrderBy(x => x.Make1).FirstOrDefault(x => x.Id == makeId));
         }
     }
     catch
     {
         return(null);
     }
 }
Exemple #4
0
 public List <Make> GetMakes()
 {
     try
     {
         using (btfbEntities db = new btfbEntities())
         {
             return(db.Makes.Include("Models").OrderBy(x => x.Make1).ToList());
         }
     }
     catch
     {
         return(null);
     }
 }
Exemple #5
0
 public List <State> GetStates()
 {
     try
     {
         using (btfbEntities db = new btfbEntities())
         {
             return(db.States.OrderBy(x => x.Abbr).ToList());
         }
     }
     catch
     {
         return(null);
     }
 }
Exemple #6
0
        public UsersDTO GetUser(string userId)
        {
            using (btfbEntities db = new btfbEntities())
            {
                AspNetUser user    = db.AspNetUsers.FirstOrDefault(u => u.Id == userId);
                UsersDTO   userDto = new UsersDTO();
                if (user != null)
                {
                    userDto.firstName = user.FirstName;
                    userDto.lastName  = user.LastName;
                    userDto.phone     = user.PhoneNumber;
                    userDto.email     = user.Email;
                }

                return(userDto);
            }
        }