/// <summary> /// 完了の状態を変更します。 /// </summary> /// <param name="item"></param> public void ModifyIsComplete(GroupItem item) { item.DebugWriteJson(); App.Client.ModifyIsComplete(item); }
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); } }
public GroupViewModel(GroupItem model) { _model = model; }
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())); } }
/// <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); }
public void ModifyIsComplete(GroupItem group) { var newComplete = !group.IsCompleted; // 逆にする _databaseAccessor.UpdateGroupIsCompleted(group.Gid, newComplete); group.ModifyIsComplete(newComplete); }
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}); }