public async Task<IActionResult> Edit(int id, [Bind("JewelleryTypeID,JewelleryTypeName")] JewelleryType jewelleryType)
        {
            if (id != jewelleryType.JewelleryTypeID)
            {
                return NotFound();
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(jewelleryType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!JewelleryTypeExists(jewelleryType.JewelleryTypeID))
                    {
                        return NotFound();
                    }
                    else
                    {
                        throw;
                    }
                }
                return RedirectToAction(nameof(Index));
            }
            return View(jewelleryType);
        }
 public async Task<IActionResult> Create([Bind("JewelleryTypeID,JewelleryTypeName")] JewelleryType jewelleryType)
 {
     if (ModelState.IsValid)
     {
         _context.Add(jewelleryType);
         await _context.SaveChangesAsync();
         return RedirectToAction(nameof(Index));
     }
     return View(jewelleryType);
 }
Exemplo n.º 3
0
 public ItemType(JewelleryType jewelleryType, EquipSlot itemSlot)
     : this(BaseType.Jewellery, (int)jewelleryType)
 {
     if (itemSlot >= EquipSlot.Neck && itemSlot <= EquipSlot.FingerB)
         this.itemSlot = itemSlot;
     else throw new ArgumentException("Item slot given is not jewellery!");
 }
Exemplo n.º 4
0
        public Ring(RingMaterialType r, JewelleryType e, int level)
        {
            int strBuff = 0;
            int dexBuff = 0;
            int ConBuff = 0;

            texture = 'R';

            if (level < 2)
            {
                name = r.ToString() + " Ring of " + e.ToString();
            }
            else
            {
                name = r.ToString() + " Ring of " + e.ToString() + " +" + level;
            }

            maxStackSize     = 1;
            currentStackSize = 1;

            value = 20;

            if (r == RingMaterialType.Copper)
            {
                effectMulitplier = 1;
                weight           = 0.3f;
                value           -= 10 * level;
            }
            else if (r == RingMaterialType.Silver)
            {
                effectMulitplier = 2;
                weight           = 0.3f;
            }
            else if (r == RingMaterialType.Gold)
            {
                effectMulitplier = 3;
                weight           = 0.3f;
                value           += 10 * level;
            }

            if (e == JewelleryType.Str)
            {
                strBuff += (1 + effectMulitplier) * level;
            }
            else if (e == JewelleryType.Dex)
            {
                dexBuff += (1 + effectMulitplier) * level;
            }
            else if (e == JewelleryType.Con)
            {
                ConBuff += (1 + effectMulitplier) * level;
            }
            else if (e == JewelleryType.Wis)
            {
                WisBuff += (1 + effectMulitplier) * level;
            }
            else if (e == JewelleryType.Int)
            {
                IntelBuff += (1 + effectMulitplier) * level;
            }
        }