Ejemplo n.º 1
0
 public void AddDebtorCommandExecute()
 {
     //var newDebitor = new Debitors("Insert name");
     //Is AddView, naming error
     _iDialogService.ShowDialog("AddView", null, r =>
     {
         if (r.Result == ButtonResult.OK)
         {
             DebitorsCreditors.Add(((App)Application.Current).Debitor);
         }
     });
 }
Ejemplo n.º 2
0
        private void OpenFileCommandExecuteTxt()
        {
            OpenFileDialog fs = new OpenFileDialog(); // { Filter = "Json (.json)|.json" };

            fs.ShowDialog();

            filename = fs.FileName;

            if (filename != "")
            {
                string jsonString = File.ReadAllText(filename);

                DebitorsCreditors.Clear();
                DebitorsCreditors = JsonSerializer.Deserialize <ObservableCollection <Debitors> >(jsonString);

                if (DebitorsCreditors != null)
                {
                    foreach (var debitor in DebitorsCreditors)
                    {
                        debitor.Debts.RemoveAt(debitor.Debts.Count - 1);
                    }
                }
            }
        }
Ejemplo n.º 3
0
 private void RemoveDebitorCommand()
 {
     DebitorsCreditors.RemoveAt(CurrentIndex);
 }