Beispiel #1
0
        public void UpdateBrand(Brand b)
        {
            AdamDatabaseEntities2 ed1 = new AdamDatabaseEntities2();

            ed.Entry(b).State = System.Data.EntityState.Modified;
            ed.SaveChanges();
        }
Beispiel #2
0
        public void AddProductReviews(ProductReview review)
        {
            AdamDatabaseEntities2 ed1 = new AdamDatabaseEntities2();

            ed1.ProductReviews.Add(review);
            ed1.SaveChanges();
        }
Beispiel #3
0
        public void SaveReview(ProductReview pr)
        {
            AdamDatabaseEntities2 ed1 = new AdamDatabaseEntities2();

            ed1.Configuration.ProxyCreationEnabled = false;
            ed1.ProductReviews.Add(pr);
            ed1.SaveChanges();
        }
Beispiel #4
0
        public void AddFeatureSentiment(FeatureSentiment fs)
        {
            AdamDatabaseEntities2 ed1 = new AdamDatabaseEntities2();

            ed1.Configuration.ProxyCreationEnabled = false;
            ed1.FeatureSentiments.Add(fs);
            ed1.SaveChanges();
        }
Beispiel #5
0
        //Add Product Details
        public int AddProductDetails(Product product, string type)
        {
            AdamDatabaseEntities2 ed1 = new AdamDatabaseEntities2();;

            ed1.Configuration.ProxyCreationEnabled = false;
            product.CategoryId = GetCategoryIdToSaveProduct(product, type);
            product.BrandId    = GetBrandIdToSaveProduct(product, product.CategoryId);
            ed1.Products.Add(product);
            ed1.SaveChanges();
            return(product.Id);
        }
Beispiel #6
0
        public void AddBrandFollower(BrandFollower follower)
        {
            AdamDatabaseEntities2 ed1 = new AdamDatabaseEntities2();

            try
            {
                ed1.BrandFollowers.Add(follower);
                ed1.SaveChanges();
            }catch (Exception)
            {
            }
        }
Beispiel #7
0
        public bool AddSignUpDetail(string fname, string lname, string email, string password)
        {
            AdamDatabaseEntities2 ed1 = new AdamDatabaseEntities2();

            try
            {
                Customer c = new Customer();
                c.FirstName = fname;
                c.LastName  = lname;
                c.Email     = email;
                c.Password  = password;
                c.Location  = "Pakistan";
                ed1.Customers.Add(c);
                ed1.SaveChanges();
                return(true);
                //Customer c = ed1.Customers.First(x => x.Email.Equals(email) && x.Password.Equals(password) && x.LastName.Equals(lname) && x.FirstName.Equals(fname));
            }
            catch (Exception)
            {
                return(false);
            }
        }