Exemplo n.º 1
0
        public StatEnumItem(string value)
        {
            if (DataValidation.IsNameValid(value) == false)
            {
                throw new ArgumentException($"{nameof(value)} is invalid {value}");
            }

            Item = value;
        }
        /// <summary>
        /// Creares Purchase object for curtain date
        /// </summary>
        /// <param name="date"></param>
        public Purchase(DateTime date)
        {
            if (DataValidation.IsDateValid(date) == false)
            {
                throw new ArgumentException($"Invalid date {date}");
            }

            Date  = date;
            Types = new List <GoodType>();
            Goods = new Dictionary <Good, int>();
        }
Exemplo n.º 3
0
        public GoodType(string newType)
        {
            if (string.IsNullOrWhiteSpace(newType))
            {
                throw new ArgumentException($"Invalid type {newType}");
            }

            if (DataValidation.IsCharCapital(newType) == false)
            {
                newType = string.Concat(newType[0].ToString().ToUpper(), newType.Substring(1));
            }

            Item = newType.Trim();
        }
Exemplo n.º 4
0
        public ValueItem(decimal value, StatEnumItem statEnum)
        {
            if (DataValidation.IsValueValid(value) == false)
            {
                throw new ArgumentException($"{nameof(value)} is invalid {value}. Probably it's too big");
            }

            if (statEnum is null)
            {
                throw new ArgumentNullException($"{nameof(statEnum)} can't be null!");
            }

            EnumType = statEnum;
            GetTotal = value;
        }