Example #1
0
        /// <summary>
        /// 項目追加処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddActionCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            List <CsvComparisonViewModel.CsvRecord> vmList = new List <CsvComparisonViewModel.CsvRecord>(this.WVM.SelectedCsvComparisonVMList.Where((vm) => !vm.ActionId.HasValue).Select((vm) => vm.Record));

            if (vmList.Count() == 1)
            {
                CsvComparisonViewModel.CsvRecord record = vmList[0];
                ActionRegistrationWindow         arw    = new ActionRegistrationWindow(this.builder, this.WVM.SelectedBookVM.Id.Value, record);
                arw.Registrated += async(sender2, e2) => {
                    foreach (int value in e2.Value)
                    {
                        await this.ChangeIsMatchAsync(value, true);
                    }
                    await this.UpdateComparisonInfoAsync();

                    this.ActionsStatusChanged?.Invoke(this, new EventArgs());
                };
                arw.ShowDialog();
            }
            else
            {
                ActionListRegistrationWindow alrw = new ActionListRegistrationWindow(this.builder, this.WVM.SelectedBookVM.Id.Value, vmList);
                alrw.Registrated += async(sender2, e2) => {
                    foreach (int value in e2.Value)
                    {
                        await this.ChangeIsMatchAsync(value, true);
                    }
                    await this.UpdateComparisonInfoAsync();

                    this.ActionsStatusChanged?.Invoke(this, new EventArgs());
                };
                alrw.ShowDialog();
            }
        }
Example #2
0
        /// <summary>
        /// 帳簿項目の新規登録のために <see cref="ActionRegistrationWindow"/> クラスの新しいインスタンスを初期化します。
        /// </summary>
        /// <param name="builder">DAOビルダ</param>
        /// <param name="selectedBookId">選択された帳簿ID</param>
        /// <param name="selectedRecord">選択されたCSVレコード</param>
        public ActionRegistrationWindow(DaoBuilder builder, int selectedBookId, CsvComparisonViewModel.CsvRecord selectedRecord)
        {
            this.builder          = builder;
            this.selectedBookId   = selectedBookId;
            this.selectedMonth    = null;
            this.selectedDate     = null;
            this.selectedRecord   = selectedRecord;
            this.selectedActionId = null;

            this.InitializeComponent();
            this.LoadWindowSetting();

            this.WVM.RegMode = RegistrationMode.Add;
            this.WVM.AddedByCsvComparison = true;
        }