public BudgetCalculatorItem AddItem(string name, CalculatorValueType valueType, CalculatorOperatorType operatorType = CalculatorOperatorType.None, decimal?value = null, int foreignId = 0) { var item = new BudgetCalculatorItem { Name = name, ValueType = valueType, OperatorType = operatorType, ForeignId = foreignId, Value = value, Equation = this, }; Items.Add(item); return(item); }
private void AddItem() { if (!Model.Items.Contains(Model.CurrentItem)) { CalculatorValueType valueType = CalculatorValueType.Operator; if (!IsOperatorElementVisible) { valueType = (CalculatorValueType)SelectedValueType.Value; } int foreignId = GetForeignId(); Model.AddItem(valueType, SelectedOperatorType, UserValue, foreignId); } }
public static string ToName(this CalculatorValueType valueType) { switch (valueType) { case CalculatorValueType.BudgetIncomesValue: return("Suma wszystkich dochodów"); case CalculatorValueType.BudgetIncomesValueOfType: return("Suma dochodów typu"); case CalculatorValueType.BudgetTotalRevenuesValue: return("Suma wszystkich wpływów budżetowych"); case CalculatorValueType.BudgetSavingsValue: return("Suma wszystkich zewnętrznych źródeł"); case CalculatorValueType.BudgetSavingsValueOfType: return("Suma zewnętrznych źródłeł typu"); case CalculatorValueType.BudgetExpensesValueOfType: return("Suma wydatków określonego typu"); case CalculatorValueType.BudgetExpensesWithDescription: return("Suma wydatków zawierających opis"); case CalculatorValueType.BudgetPlanValue: return("Suma całego planu budżetowego"); case CalculatorValueType.BudgetPlanValueOfCategory: return("Suma planu budżetowego dla kategorii"); case CalculatorValueType.BudgetPlanValueOfGroup: return("Suma planu budżetowego dla grupy"); case CalculatorValueType.CalculatorEquationValue: return("Wynik innego równania"); case CalculatorValueType.UserValue: return("Wartość wprowadzona ręcznie"); case CalculatorValueType.Operator: return("Operator"); default: throw new ArgumentOutOfRangeException(string.Format("Undefined name for: {0}", valueType.ToString())); } }
public BudgetCalculatorItem AddItem(CalculatorValueType valueType, CalculatorOperatorType operatorType, decimal?value, int foreignId) { CurrentItem = _equation.AddItem(string.Empty, valueType, operatorType, value, foreignId); return(CurrentItem); }
public BudgetCalculatorItem AddItem(CalculatorValueType valueType, CalculatorOperatorType operatorType, decimal? value, int foreignId) { CurrentItem = _equation.AddItem(string.Empty, valueType, operatorType, value, foreignId); return CurrentItem; }
public BudgetCalculatorItem AddItem(string name, CalculatorValueType valueType, CalculatorOperatorType operatorType = CalculatorOperatorType.None, decimal? value = null, int foreignId = 0) { var item = new BudgetCalculatorItem { Name = name, ValueType = valueType, OperatorType = operatorType, ForeignId = foreignId, Value = value, Equation = this, }; Items.Add(item); return item; }