public void NotifyAbout(IViewElement message)
        {
            ViewExpensesInfo expensesInfo = (ViewExpensesInfo)message;

            if (expensesInfo != null)
            {
                expensesInfo.ExpensesType = EnumWorker.GetDescriptionFromValue(expensesInfo.ExpensesType);
                if (TabItemName == "Редактирование расхода")
                {
                    ExpensesInfos.Add(expensesInfo);
                    listOfViewObj.Add(expensesInfo);
                    var deleteItem = listOfViewObj.FirstOrDefault(exp => exp.Id == SelectedExpensesInfo.Id);
                    listOfViewObj.Remove(deleteItem);
                    ExpensesInfos.Remove(SelectedExpensesInfo);
                    SelectedExpensesInfo = expensesInfo;
                    SetMaxExpensesValue();
                    TabVisibility  = false;
                    DisplayXamlTab = false;
                }
                else
                {
                    ExpensesInfos.Add(expensesInfo);
                    listOfViewObj.Add(expensesInfo);
                    SetMaxExpensesValue();
                    TabVisibility  = false;
                    DisplayXamlTab = false;
                }
            }
            else
            {
                TabVisibility  = false;
                DisplayXamlTab = false;
            }
        }
Exemplo n.º 2
0
 public IViewElement ConvertToVO()
 {
     return(new ViewExpensesInfo(Id, Expenditure, Comment, СostsDate.ToShortDateString(), EnumWorker.GetDescriptionFromValue(ExpensesType.ToString())));
 }