Exemplo n.º 1
0
        public ActionResult Add(Product product)
        {
            db.Products.Add(product);
            db.SaveChanges();


            return(RedirectToAction("Index"));
        }
        public ActionResult Add(Basket basket)
        {
            if (ModelState.IsValid)
            {
                db.Baskets.Add(basket);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(basket));
        }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "IDUser,Password,ConfirmPassword,Surname,Name,Patronymic,BirthDay,Mail,Phone,Address")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(user);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(user));
        }
        public ActionResult Add(Order order)
        {
            if (ModelState.IsValid)
            {
                db.Orders.Add(order);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(order));
        }
Exemplo n.º 5
0
 public virtual void Add(Basket entity)
 {
     dbSet.Add(entity);
     db.SaveChanges();
 }
 public virtual void Add(Product entity)
 {
     dbSet.Add(entity);
     db.SaveChanges();
 }
Exemplo n.º 7
0
 public virtual void Add(Order entity)
 {
     dbSet.Add(entity);
     db.SaveChanges();
 }
 public void Save()
 {
     _db.SaveChanges();
 }