Exemple #1
0
        public ActionResult Create([Bind(Include = "Id,Number,Color,Weight,IsAvailable,PurchaseDate,Price,Image,Guid,XML,Blob,FileName,TimeStamp,CategoryId,Model")] Item item)
        {
            if (ModelState.IsValid)
            {
                db.Items.Add(item);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Name", item.CategoryId);
            return(View(item));
        }
Exemple #2
0
        private void Expertiment(Item item)
        {
            String s     = item.Color;
            String color = (String)s.Clone();

            item.Color = color;
            int result = db.SaveChanges();
        }