Ejemplo n.º 1
0
        public ActionResult EditClothingType(ClothingType clothingType)
        {
            // LINQ example
            ClothingType clothingTypeOld = (from ClothingType ct in _database
                                            where ct.Id == clothingType.Id
                                            select ct).First();

            clothingTypeOld.Description = clothingType.Description;
            clothingTypeOld.Name = clothingType.Name;
            clothingTypeOld.Color = clothingType.Color;
            clothingTypeOld.DatePurchased = clothingType.DatePurchased;
            _database.Store(clothingTypeOld);
            return RedirectToAction("Index");
        }
Ejemplo n.º 2
0
 public ActionResult CreateClothingType(ClothingType clothingType)
 {
     clothingType.Id = Guid.NewGuid().ToString();
     _database.Store(clothingType);
     return RedirectToAction("Index");
 }