Beispiel #1
0
        public ActionResult Add([Bind(Include = "Id,Weight,Volume,ConstructionMaterial,Contents,CurrentLocation,DateCreated")] Bag bag)
        {
            bag.DateCreated = DateTime.Now;

            if (bag.Contents == null)
            {
                bag.Contents = "";
            }

            if (ModelState.IsValid)
            {
                service.Create(bag);

                return(RedirectToAction("Index"));
            }

            return(View(bag));
        }