Beispiel #1
0
        private async void AddNewDepositCommandAction(object obj)
        {
            var form     = new AddNewDepositView();
            var viemodel = new AddNewDepositViewModel(SelectedCustomer)
            {
                WindowClose = form.Close
            };

            form.DataContext = viemodel;
            form.ShowDialog();
            if (viemodel.Saved)
            {
                DepositSource.Add((Deposit)viemodel);
                SelectedCustomer.SisaSaldo = await context.GetSisaSaldo(SelectedCustomer.Id);
            }
            DepositViewSource.Refresh();
        }
Beispiel #2
0
        private async void LoadDataSelectedCustomer()
        {
            try
            {
                await Task.Delay(200);

                var datas = await context.GetDepositsOfCustomer(SelectedCustomer);

                DepositSource.Clear();
                foreach (var item in datas)
                {
                    DepositSource.Add(item);
                }
                DepositViewSource.Refresh();
                DebetDepositGetData(SelectedCustomer.Id);
                SelectedCustomer.SisaSaldo = await context.GetSisaSaldo(SelectedCustomer.Id);
            }
            catch (Exception ex)
            {
                Helpers.ShowErrorMessage(ex.Message);
            }
        }