Ejemplo n.º 1
0
 /*********
 ** Public Methods
 *********/
 /// <summary>Constructs an instance.</summary>
 /// <param name="objectId">The id of the outerwear object.</param>
 /// <param name="type">The type of outerwear.</param>
 /// <param name="effects">The effects the outerwear has when equipped.</param>
 /// <param name="equippedTexture">The spritesheet of the outerwear on the farmer when it's equipped.</param>
 public OuterwearData(int objectId, OuterwearType type, OuterwearEffects effects, Texture2D equippedTexture)
 {
     ObjectId        = objectId;
     Type            = type;
     Effects         = effects ?? new OuterwearEffects();
     EquippedTexture = equippedTexture;
 }
Ejemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            OuterwearType outerwearType = db.OuterwearTypes.Find(id);

            db.OuterwearTypes.Remove(outerwearType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "OuterwearTypeID,OuterwearTypeName")] OuterwearType outerwearType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(outerwearType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(outerwearType));
 }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "OuterwearTypeID,OuterwearTypeName")] OuterwearType outerwearType)
        {
            if (ModelState.IsValid)
            {
                db.OuterwearTypes.Add(outerwearType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(outerwearType));
        }
Ejemplo n.º 5
0
        // GET: OuterwearTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OuterwearType outerwearType = db.OuterwearTypes.Find(id);

            if (outerwearType == null)
            {
                return(HttpNotFound());
            }
            return(View(outerwearType));
        }