Exemplo n.º 1
0
        public string Converter(string text)
        {
            decimal value         = DecimalConverter.Instance().Converter(text.ToString());
            string  currencyValue = (value / 100).ToString("C");

            if (text != currencyValue)
            {
                text = currencyValue;
            }

            return(text);
        }
Exemplo n.º 2
0
        private bool CanRegisterNewDebit()
        {
            decimal decimalValue = DecimalConverter.Instance().Converter(Value);

            if (_expenseControl != null)
            {
                if (decimalValue > DecimalConverter.Instance().Converter(_expenseControl.AvailableValue))
                {
                    Toast($"Saldo insuficiente");
                    return(false);
                }
            }

            if (decimalValue > 0 && SelectedCategory != null)
            {
                return(true);
            }

            return(false);
        }
        private bool CanRegisterOrUpdate()
        {
            decimal decimalValue = DecimalConverter.Instance().Converter(Value);

            if (isEditing)
            {
                if (decimalValue > 0 && SelectedDate.Year >= expenseControl.BeginYear &&
                    SelectedDate.Month >= expenseControl.BeginMonth && SelectedDate.Day >= expenseControl.BeginDay &&
                    !string.IsNullOrEmpty(Title))
                {
                    return(true);
                }
            }
            else
            {
                if (decimalValue > 0 && SelectedDate.Year >= DateTime.Now.Year &&
                    SelectedDate.Month >= DateTime.Now.Month && SelectedDate.Day >= DateTime.Now.Day && !string.IsNullOrEmpty(Title))
                {
                    return(true);
                }
            }
            return(false);
        }