Пример #1
0
        private async void EditScheduleAction(object obj)
        {
            try
            {
                ScheduleBussines scheduleContext = new ScheduleBussines();
                var schedules = await scheduleContext.GetScheduleById(ManifestSelected.SchedulesId);

                if (schedules != null)
                {
                    var form = new Views.AddNewSchecule(schedules);
                    form.ShowDialog();
                    var vm = (AddNewScheduleViewModel)form.DataContext;
                    if (vm.Success && vm.SchedulteCreated != null)
                    {
                        ManifestSelected.PlaneName = vm.SchedulteCreated.PlaneName;
                        ManifestSelected.Tanggal   = vm.SchedulteCreated.Tanggal;
                    }
                    SourceView.Refresh();
                }
            }
            catch (Exception ex)
            {
                Helpers.ShowErrorMessage(ex.Message);
            }
        }
Пример #2
0
        private void addNewScheduleAction(object obj)
        {
            var form = new Views.AddNewSchecule();

            form.ShowDialog();
            var vm = form.DataContext as AddNewScheduleViewModel;

            if (vm.Success && vm.SchedulteCreated != null)
            {
                SourceSchedules.Add(vm.SchedulteCreated);
                ScheduleSelected = vm.SchedulteCreated;
            }
        }
Пример #3
0
        private void AddNewJadwalAction(object obj)
        {
            var form = new Views.AddNewSchecule();

            form.ShowDialog();
            var vm = (AddNewScheduleViewModel)form.DataContext;

            if (vm.Success && vm.SchedulteCreated != null)
            {
                Source.Add(vm.SchedulteCreated);
            }
            SourceView.Refresh();
        }
Пример #4
0
        private void EditSchedule(object obj)
        {
            var form = new Views.AddNewSchecule(SelectedSchedule);

            form.ShowDialog();
            var vm = (AddNewScheduleViewModel)form.DataContext;

            if (vm.Success && vm.SchedulteCreated != null)
            {
                SelectedSchedule.FlightNumber = vm.SchedulteCreated.FlightNumber;
                SelectedSchedule.Capasities   = vm.SchedulteCreated.Capasities;
                SelectedSchedule.Start        = vm.SchedulteCreated.Start;
                SelectedSchedule.End          = vm.SchedulteCreated.End;
            }
            SourceView.Refresh();
        }