Example #1
0
        /// <summary>
        ///     完了の状態を変更します。
        /// </summary>
        /// <param name="item"></param>
        public void ModifyIsComplete(GroupItem item)
        {
            item.DebugWriteJson();

            App.Client.ModifyIsComplete(item);
        }
Example #2
0
        public void DeleteGroup(GroupItem group)
        {
            using (var tran = _databaseAccessor.BeginTransaction())
            {
                _databaseAccessor.UpdateUnGroup(group.Gid);
                _databaseAccessor.DeleteGroup(group.Gid);

                tran.Commit();
                GroupItems.Remove(group);
                _log.Info("Delete Group. Gid:{0} GroupName:{1} ", group.Gid, group.GroupName);
            }
        }
Example #3
0
 public GroupViewModel(GroupItem model)
 {
     _model = model;
 }
Example #4
0
 public void ValidateRegistGroup(string keyword, GroupItem ownGroup = null)
 {
     var sameKeywordGroups = GetMatchKeywordGroups(keyword);
     if (ownGroup != null) sameKeywordGroups = sameKeywordGroups.Where(x => x.GID != ownGroup.Gid);  // グループ更新のときは自分を除く。
     if (sameKeywordGroups.Any())
     {
         // 同じキーワードのグループがすでに存在したらエラー
         throw new MovselexException(string.Format(Properties.Resources.ErrorMessageRegistedDuplicateKeyword, keyword.ToLower()));
     }
 }
Example #5
0
        /// <summary>
        /// グループ情報を変更します。
        /// </summary>
        /// <param name="group"></param>
        /// <param name="newGroupName"></param>
        /// <param name="keyword"></param>
        public void ModifyGroup(GroupItem group, string newGroupName, string keyword)
        {
            ValidateRegistGroup(keyword, group);
            var oldGroupName = group.GroupName;
            group.ModifyNameAndKeyword(newGroupName, keyword);
            _databaseAccessor.UpdateGroup(group);
            _databaseAccessor.UpdateLibraryReplaceGroupName(group.Gid, oldGroupName, group.GroupName);

        }
Example #6
0
 public void ModifyIsComplete(GroupItem group)
 {
     var newComplete = !group.IsCompleted; // 逆にする
     _databaseAccessor.UpdateGroupIsCompleted(group.Gid, newComplete);
     group.ModifyIsComplete(newComplete);
 }
Example #7
0
        public void ModifyRating(GroupItem group, RatingType rating)
        {

            using (var tran = _databaseAccessor.BeginTransaction())
            {
                var ids = _databaseAccessor.SelectIdFromGid(group.Gid);
                foreach (var id in ids)
                {
                    _databaseAccessor.UpdateLibraryRating(id, rating);
                }
                tran.Commit();
            }

            group.ModifyIsFavorite(rating == RatingType.Favorite);
        }
 public void UpdateGroup(GroupItem @group)
 {
     SqlExecuter.Execute(SQLResource.UpdateGroup,
         new {Gid = group.Gid, GroupName = group.GroupName, Keyword = group.Keyword});
 }