/// <summary>キャラクターを登録します。(非同期)</summary>
        /// <param name="character">登録するキャラクターを表すBleachCharacter。</param>
        /// <returns>登録件数を表すint。</returns>
        public async Task <int> RegistCharacterAsync(BleachCharacter character)
        {
            var sql = new StringBuilder(300);

            sql.AppendLine(" INSERT INTO CHARACTERS( ");
            sql.AppendLine(" 	  CHARACTER_NAME ");
            sql.AppendLine(" 	, KANA ");
            sql.AppendLine(" 	, ORGANIZATION ");
            sql.AppendLine(" ) VALUES ( ");
            sql.AppendLine(" 	  :Name ");
            sql.AppendLine(" 	, :Furigana ");
            sql.AppendLine(" 	, :OrganizationId ");
            sql.AppendLine(" ) ");

            return(await this.Connection.ExecuteAsync(sql.ToString(), character));
        }
示例#2
0
        /// <summary>コンストラクタ。</summary>
        /// <param name="dialogService">Prismのダイアログサービスを表すIDialogService。</param>
        public MainWindowViewModel(IDialogService dialogService, IOpenFileDialogService fileDialogService)
        {
            this.dlgService            = dialogService;
            this.character             = new BleachCharacter();
            this.openFileDialogService = fileDialogService;

            this.ShowMessageButtonCommand = new ReactiveCommand()
                                            .WithSubscribe(this.onShowMessageButtonCommand);
            this.DialogMessage = new ReactivePropertySlim <string>(string.Empty);

            this.ShowBleachDialogCommand = new ReactiveCommand()
                                           .WithSubscribe(() => this.showBleachDialog());

            this.BlearchCharacterCode = this.character.Code;
            this.BlearchCharacterCode.Where(v => v.Length == 3)
            .Subscribe(v => this.onCharacterCode(v));

            this.BleachCharacterName = this.character.Name
                                       .ToReadOnlyReactiveProperty();
        }
        /// <summary>コンストラクタ。</summary>
        /// <param name="dialogService">Prismのダイアログサービスを表すIDialogService。</param>
        public MainWindowViewModel(IDialogService dialogService, ICommonDialogService comDlgService)
        {
            this.dlgService          = dialogService;
            this.commonDialogService = comDlgService;
            this.character           = new BleachCharacter();

            this.ShowMessageButtonCommand = new ReactiveCommand()
                                            .WithSubscribe(this.onShowMessageButtonCommand)
                                            .AddTo(this.disposables);

            this.DialogMessage = new ReactivePropertySlim <string>(string.Empty)
                                 .AddTo(this.disposables);

            this.ShowBleachDialogCommand = new ReactiveCommand()
                                           .WithSubscribe(() => this.showBleachDialog())
                                           .AddTo(this.disposables);

            this.ShowOpenFileDialogCommand = new ReactiveCommand()
                                             .WithSubscribe(() => this.onShowOpenFileDialog())
                                             .AddTo(this.disposables);

            this.ShowFolderBrowsDialogCommand = new ReactiveCommand()
                                                .WithSubscribe(() => this.onShowFolderBrowsDialog())
                                                .AddTo(this.disposables);

            this.BlearchCharacterCode = this.character.Code
                                        .AddTo(this.disposables);
            this.BlearchCharacterCode.Where(v => v.Length == 0 || v.Length == 3)
            .Subscribe(_ => this.agent.SetCharacterValues(this.character));

            this.BleachCharacterName = this.character.Name
                                       .ToReadOnlyReactivePropertySlim()
                                       .AddTo(this.disposables);

            this.OpenFileName = new ReactivePropertySlim <string>(string.Empty)
                                .AddTo(this.disposables);

            this.FolderPath = new ReactivePropertySlim <string>(string.Empty)
                              .AddTo(this.disposables);
        }
        public BlearchItemViewModel(BleachCharacter character)
        {
            this.targetCharacter = character;

            this.Code = this.targetCharacter.Code
                        .ToReadOnlyReactivePropertySlim()
                        .AddTo(this.disposables);

            this.Yomigana = this.targetCharacter.Yomigana
                            .ToReadOnlyReactivePropertySlim()
                            .AddTo(this.disposables);

            this.Name = this.targetCharacter.Name
                        .ToReadOnlyReactivePropertySlim()
                        .AddTo(this.disposables);

            this.Zanpakuto = this.targetCharacter.Zanpakuto
                             .ToReadOnlyReactivePropertySlim()
                             .AddTo(this.disposables);

            this.Bankai = this.targetCharacter.Bankai
                          .ToReadOnlyReactivePropertySlim()
                          .AddTo(this.disposables);
        }