Пример #1
0
 public PartMetal()
 {
     MetalType   = new MetalType();
     MetalFinish = new MetalFinish();
     SetDefaults();
     //   Part = new Part();
 }
Пример #2
0
 public MetalAccount(string clientAccount, string clientName, MetalType metal, uint balance, decimal price) : base(clientAccount, clientName)
 {
     _type         = metal;
     _metalBalance = balance;
     _priceRate    = price;
     this.IncreaseBalance((decimal)(_metalBalance * _priceRate));
 }
Пример #3
0
        public SalesSupply(MetalType metalType, int metalAmount, DateTime deadline, ContactInfo contact)
        {
            MetalType          = metalType;
            MetalAmount        = metalAmount;
            HighestPrice       = 0;
            Deadline           = deadline;
            ContactInfo        = contact;
            HighestBuyingOffer = null;

            ImgFolderPath = "C:/Users/Louise Helene Hamle/source/repos/Lesson22Assignment/Auction/AuctionLibrary/Img";

            if (MetalType == MetalType.Guld)
            {
                ImgPath = ImgFolderPath + "/Guld.png";
            }
            else if (MetalType == MetalType.Sølv)
            {
                ImgPath = ImgFolderPath + "/Sølv.png";
            }
            else if (MetalType == MetalType.Platin)
            {
                ImgPath = ImgFolderPath + "/Platin.png";
            }
            else
            {
                ImgPath = ImgFolderPath + "/Palladium.png";
            }
        }
Пример #4
0
 public ArmorMetadata(float armorRating, int durability, MetalType metal, ItemTypesServer.ItemTypeRaw itemType, ArmorSlot slot)
 {
     ArmorRating = armorRating;
     Durability  = durability;
     Metal       = metal;
     ItemType    = itemType;
     Slot        = slot;
 }
Пример #5
0
 public WeaponMetadata(float damage, int durability, MetalType metalType, WeaponType weaponType, ItemTypesServer.ItemTypeRaw item)
 {
     Damage     = damage;
     Metal      = metalType;
     WeaponType = weaponType;
     ItemType   = item;
     Durability = durability;
 }
Пример #6
0
        public void OpenMetalAccount(MetalType type, uint initAmount, decimal price)
        {
            var account    = "ACC" + AccountType.Metal.ToString() + (_openedAccountsCount + 1).ToString() + type.ToString() + _number.ToString();
            var newAccount = new MetalAccount(account, _name, type, initAmount, price);

            MetalAccounts.Add(newAccount);
            _openedAccountsCount++;
        }
Пример #7
0
        public ActionResult DeleteConfirmed(int id)
        {
            MetalType metalType = db.MetalTypes.Find(id);

            db.MetalTypes.Remove(metalType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #8
0
 public Metal(string name, int to_hit, int damage, int ac, double costmod, MetalType type)
 {
     Name = name;
     ToHit = to_hit;
     Damage = damage;
     ArmorClass = ac;
     CostMultiplier = costmod;
     Type = type;
 }
Пример #9
0
 public Metal(string name, int toHit, int damage, int ac, double costmod, MetalType type)
 {
     Name           = name;
     ToHit          = toHit;
     Damage         = damage;
     ArmorClass     = ac;
     CostMultiplier = costmod;
     Type           = type;
 }
Пример #10
0
 public ActionResult Edit([Bind(Include = "id,MetTypeName")] MetalType metalType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(metalType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(metalType));
 }
Пример #11
0
        public ActionResult Create([Bind(Include = "id,MetTypeName")] MetalType metalType)
        {
            if (ModelState.IsValid)
            {
                db.MetalTypes.Add(metalType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(metalType));
        }
Пример #12
0
 public void AddMaterial(MetalType mat)
 {
     if (mat == MetalType.Copper)
     {
         copper.Add(mat);
     }
     else if (mat == MetalType.Zinc)
     {
         zinc.Add(mat);
     }
 }
Пример #13
0
        // GET: MetalTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MetalType metalType = db.MetalTypes.Find(id);

            if (metalType == null)
            {
                return(HttpNotFound());
            }
            return(View(metalType));
        }
Пример #14
0
 public void OpenMetalAccount(MetalType type, uint initAmount, decimal price)
 {
     try
     {
         if (price <= 0)
         {
             throw new InvalidOperationException("Курс не может быть отрицательным или нулевым!");
         }
         var account    = "ACC" + (int)AccountType.MetalAccount + (_openedAccountsCount + 1).ToString() + (int)type + _number.ToString();
         var newAccount = new MetalAccount(account, _name, type, initAmount, price);
         _accounts.Add(newAccount);
         _openedAccountsCount++;
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Пример #15
0
 public MetalAccount(string clientAccount, string clientName, MetalType metal, uint weight, decimal price) : base(clientAccount, clientName)
 {
     try
     {
         _type         = metal;
         _metalBalance = weight;
         if (price <= 0)
         {
             throw new InvalidOperationException("Курс не может быть отрицательным или нулевым!");
         }
         _priceRate = price;
         this.IncreaseBalance((decimal)(_metalBalance * _priceRate));
     }
     catch (InvalidOperationException)
     {
         throw;
     }
     catch (Exception)
     {
         throw new Exception("Произошла какая-то ошибка!");
     }
 }
Пример #16
0
        /// <summary>
        /// Metodo responsavel por calcular o numero de credito galactico.
        /// Data de Criação: 07/05/2017
        /// </summary>
        /// <param name="metalType">Tipo de Metal</param>
        /// <param name="romanNumber">Numero em Romano</param>
        /// <returns></returns>
        private static double CalculateGalacticCredit(MetalType metalType, string romanNumber)
        {
            var integer = Roman.ConvertRomanToInteger(romanNumber);

            switch (metalType)
            {
            case MetalType.None:
                return(integer);

            case MetalType.Iron:
                return(195.5 * integer);

            case MetalType.Gold:
                return(14450 * integer);

            case MetalType.Silver:
                return(17 * integer);

            default:
                return(0);
            }
        }
Пример #17
0
 /// <summary>
 /// Adiona um metal ao inventário
 /// </summary>
 /// <param name="metalType">Elemento metal</param>
 /// <param name="amount">Quantidade</param>
 public void AddMetal(MetalType metalType, int amount)
 {
     metal[metalType] += amount;
 }
Пример #18
0
 public Metal()
 {
     _metalType = MetalType.None;
 }
Пример #19
0
 public Metal(MetalType mt)
 {
     _metalType = mt;
 }