示例#1
0
            protected override void finish(int winning_index)
            {
                TypeCurrency result = new TypeCurrency();

                result.key = winning_index;
                switch (winning_index)
                {
                case 0:
                {
                    Debug.Assert(field0.have_value);
                    result.choice0 = field0.value;
                    break;
                }

                case 1:
                {
                    Debug.Assert(field1.have_value);
                    result.choice1 = field1.value;
                    break;
                }

                default:
                {
                    Debug.Assert(false);
                    break;
                }
                }
                handle_result(result);
            }
示例#2
0
 ///<summary> Constructor Class </summary>
 ///<param name="value"> monetary value that it has </param>
 ///<param name="typeCurrency"> Type currency </param>
 ///<example>Coin,Bill</example>
 ///<param name="currency">  </param>
 public Money(double value, TypeCurrency typeCurrency, Currency currency)
 {
     this.Currency     = currency;
     this.TypeCurrency = typeCurrency;
     this.Value        = value;
     this.Quantity     = 0;
 }
示例#3
0
 public HolderCurrency(HolderCurrency other)
 {
     have_data = other.haveData();
     data      = other.referenced();
     if (have_data)
     {
     }
 }
示例#4
0
 public HolderCurrency(TypeCurrency init_data)
 {
     have_data = true;
     data      = init_data;
     if (have_data)
     {
     }
 }
示例#5
0
 /// <summary>
 /// function that runs through the singleton list
 /// </summary>
 /// <param name="value"></param>
 /// <param name="typeCurrency"></param>
 /// <returns>
 /// true: if you found a value with the repeated type
 /// false: if you didn't find it
 /// </returns>
 public bool isEqual(double value, TypeCurrency typeCurrency)
 {
     foreach (Money money in this.singleton.getMoney())
     {
         if (money.Value == value && money.TypeCurrency.Equals(typeCurrency))
         {
             MessageBox.Show("Ya existe un billete con este valor", "Valor repetido", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return(true);
         }
     }
     return(false);
 }
示例#6
0
    private void  fromJSONCurrency(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        TypeCurrency or_result = new TypeCurrency();
        bool         or_done   = false;

        if (!or_done)
        {
            try
            {
                JSONStringValue json_string = json_value.string_value();
                if (json_string == null)
                {
                    throw new Exception("The value for ??? is not a string.");
                }
                or_result.choice0 = json_string.getData();
                or_result.key     = 0;
                or_done           = true;
            }
            catch (Exception)
            {
            }
        }
        if (!or_done)
        {
            try
            {
                or_result.key = 1;
                or_done       = true;
            }
            catch (Exception)
            {
            }
        }
        if (!or_done)
        {
            throw new Exception("The value for field Currency of StockFundamentalsSetJSON is not one of the allowed values.");
        }
        setCurrency(or_result);
        switch (or_result.key)
        {
        case 0:
            break;

        case 1:
            break;

        default:
            Debug.Assert(false);
            break;
        }
    }
示例#7
0
    public void setCurrency(TypeCurrency new_value)
    {
        flagHasCurrency = true;
        switch (new_value.key)
        {
        case 0:
            break;

        case 1:
            break;

        default:
            Debug.Assert(false);
            break;
        }
        storeCurrency = new_value;
    }
示例#8
0
 protected override void handle_result(TypeCurrency result)
 {
     top.value.Add(result);
 }
示例#9
0
 protected override void handle_result(TypeCurrency result)
 {
     //@@@        Debug.Assert(!have_value);
     have_value = true;
     value      = new HolderCurrency(result);
 }
示例#10
0
 protected abstract void handle_result(TypeCurrency result);