public void Switch(ExpenseItem item) { if (item.IsExp()) { if (!this.exp.Contains(item)) { return; } this.exp.Remove(item); item.SwitchType(); this.inc.Add(item); } else { if (!this.inc.Contains(item)) { return; } this.inc.Remove(item); item.SwitchType(); this.exp.Add(item); } this.OnPropertyRaised("updated"); }
public void ModExpAt(ExpenseItem item, int index) { if (!item.IsExp()) { throw new Exception("Wrong type mate! Exp - expected"); } this.exp[index] = item; this.OnPropertyRaised("updated"); }
public void RemoveItem(ExpenseItem item) { if (item.IsExp()) { this.exp.Remove(item); } else { this.inc.Remove(item); } this.OnPropertyRaised("updated"); }
public void SwitchInc(int index) { ExpenseItem item = new ExpenseItem( this.inc[index].Title, this.inc[index].Desc, this.inc[index].Val, "exp" ); this.inc.RemoveAt(index); this.exp.Add(item); this.OnPropertyRaised("updated"); }
public void ModIncAt(ExpenseItem item, int index) { if (!item.IsInc()) { throw new Exception("Wrong type mate! Inc - expected"); } this.inc[index] = new ExpenseItem( item.Title, item.Desc, item.Val, item.Type); this.OnPropertyRaised("updated"); }