Пример #1
0
 public static AspNetUsers getProfile(string userID)
 {
     using (var db = new bygnuEntities())
     {
         return(db.AspNetUsers.Find(userID));
     }
 }
Пример #2
0
 public static IList <product> searchProducts(string searchStr)
 {
     using (var db = new bygnuEntities())
     {
         return(db.product
                .OrderBy(x => x.name)
                .Where(x => x.name.Contains(searchStr))
                .ToList());
     }
 }
Пример #3
0
 public static IList <product> getDiscounted()
 {
     using (var db = new bygnuEntities())
     {
         return(db.product
                .OrderBy(x => x.name)
                .Where(x => x.isDiscounted == true)
                .Take(6)
                .ToList());
     }
 }
Пример #4
0
 public static IList <product> getTopOffers()
 {
     using (var db = new bygnuEntities())
     {
         return(db.product
                .OrderBy(x => x.name)
                .Where(x => x.isTopOffer == true)
                .Take(2)
                .ToList());
     }
 }
Пример #5
0
 public static IList <product> getProductList(int starting, int limit, string category)
 {
     using (var db = new bygnuEntities())
     {
         return(db.product
                .Include("category")
                .OrderBy(x => x.name)
                .Where(x => x.category.name.Equals(category))
                .Skip(starting)
                .Take(limit)
                .ToList());
     }
 }
Пример #6
0
        public static void updateProfile(AspNetUsers user)
        {
            using (var db = new bygnuEntities())
            {
                AspNetUsers UserRecord = db.AspNetUsers.Find(user.Id);

                UserRecord.FirstName   = user.FirstName;
                UserRecord.LastName    = user.LastName;
                UserRecord.Email       = user.Email;
                UserRecord.PhoneNumber = user.PhoneNumber;
                UserRecord.CompanyName = user.CompanyName;

                db.SaveChanges();
            }
        }
Пример #7
0
 public static ICollection <category> getCategoryList()
 {
     using (var db = new bygnuEntities()) {
         return(db.category.ToList());
     }
 }