public ActionResult Create([Bind(Include = "Id,UserName,Password,IsActive,CreationDate")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(user);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(user));
        }
        public ActionResult Create([Bind(Include = "Id,EstimateDate,DeliveryDate,DeliveryValue,QuantityDelivered,CreationDate")] ShippingDelivery shippingDelivery)
        {
            if (ModelState.IsValid)
            {
                db.ShippingDeliveries.Add(shippingDelivery);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(shippingDelivery));
        }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,Name,Genre,ReleaseYear,Price,CreationDate")] Product product)
        {
            if (ModelState.IsValid)
            {
                db.Products.Add(product);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(product));
        }
        public ActionResult Create([Bind(Include = "Id,Name,Cnpj,Phone,Email,CreationDate")] Provider provider)
        {
            if (ModelState.IsValid)
            {
                db.Providers.Add(provider);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(provider));
        }
Пример #5
0
        public ActionResult Create([Bind(Include = "Id,Name,Cpf,PhoneNumber,Salary,IsManager,CreationDate")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                db.Employees.Add(employee);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(employee));
        }
Пример #6
0
        public ActionResult Create([Bind(Include = "Id,TotalAmmount,AvailableAmmount,ProductId,CreationDate")] Stock stock)
        {
            if (ModelState.IsValid)
            {
                db.Stocks.Add(stock);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ProductId = new SelectList(db.Products, "Id", "Name", stock.ProductId);
            return(View(stock));
        }