public JsonResult GetMoreFollowing(MyPageGroupEditViewModel.NewGroupModel new_group)
        {
            MyPageGroupEditViewModel viewModel = new MyPageGroupEditViewModel();

            long memberId = GetMemberID();

            if (new_group != null)
            {
                viewModel.NewGroup = new_group;
            }
            else
            {
                viewModel.NewGroup = new MyPageGroupEditViewModel.NewGroupModel
                {
                    GroupID = 0,
                    GroupName = string.Empty,
                    FollowerSearchString = string.Empty,
                    GroupMembers = new List<MemberModel>(),
                    FollowMembers = new List<MemberModel>(),
                    GroupMemberIDList = null
                };
            }

            viewModel.NewGroup.MemberId = memberId;

            if (memberId > 0)
            {
                viewModel = this.workerService.GetViewModel(
                   viewModel.NewGroup,
                   MyPageGroupEditViewModel.INITIAL_PAGE_SIZE,
                   this.systemDatetimeService.TargetYear,
                   this.systemDatetimeService.TargetMonth);
            }

            return Json(viewModel, JsonRequestBehavior.AllowGet);
        }
        public JsonResult UpdateGroup(MyPageGroupEditViewModel.AddGroupModel addGroupModel)
        {
            long loginMemberId = GetMemberID();

            var group_id = addGroupModel.GroupID;

            try
            {
                /////////////////////////////////////////////////////////
                //入力チェック
                if (loginMemberId <= 0 && group_id <= 0)
                {
                    addGroupModel.ErrorMessage = "グループを編集できません。";
                    return Json(addGroupModel, JsonRequestBehavior.AllowGet);
                }

                var group = (from g in com.Groups
                                    where g.GroupID == group_id
                                    select g).FirstOrDefault();
                if (group == null)
                {
                    addGroupModel.ErrorMessage = "グループがありません。";
                    return Json(addGroupModel, JsonRequestBehavior.AllowGet);
                }

                /////////////////////////////////////////////////////////
                //グループ情報を更新する
                group.GroupName = addGroupModel.GroupName;
                group.ModifiedAccountID = loginMemberId.ToString();
                group.ModifiedDate = DateTime.Now;

                /////////////////////////////////////////////////////////
                //グループメンバーの更新
                using (var dbContextTransaction = com.Database.BeginTransaction())
                {
                    try
                    {

                        //既存メンバーを一旦削除
                        //TODO 将来削除対象のみ削除するように変更
                        var existingMembers = from g in com.GroupMember
                                        where g.GroupID == group_id
                                        select g;

                        foreach (var gm in existingMembers)
                        {
                            com.GroupMember.Remove(gm);
                        }

                        com.SaveChanges();

                        //メンバーに自身を追加
                        if (addGroupModel.MemberIDs == null)
                            addGroupModel.MemberIDs = new List<long> { };

                        if (!addGroupModel.MemberIDs.Contains(loginMemberId))
                            addGroupModel.MemberIDs.Add(loginMemberId);

                        //通知メールのタイトルと本文を取得
                        NoticeInfo noticeInfo = (from ni in com.NoticeInfo
                                                    where ni.MailDelivCondID == 4 && ni.NoticeClass == 3
                                                    select ni).FirstOrDefault();
                        string title = noticeInfo.Title;
                        string body = noticeInfo.Body;

                        //追加メンバーの一覧からグループメンバーを新規追加
                        //TODO 将来新規追加対象のみ追加するように変更
                        foreach (long newMemberId in addGroupModel.MemberIDs)
                        {
                            var newGroupMember = new GroupMember
                            {
                                GroupID = group_id,
                                MemberID = newMemberId,
                                CreatedAccountID = loginMemberId.ToString(),
                                CreatedDate = DateTime.Now

                            };
                            com.GroupMember.Add(newGroupMember);

                            //新規に追加する会員向けにメール通知
                            if (!IsNewMember(newMemberId, loginMemberId, existingMembers))
                                continue;

                            NoticeInfoForMyPage notice = new NoticeInfoForMyPage();

                            notice.ClassClass = NoticeInfoForMyPage.CLS_GROUP;
                            notice.AddGroup = (from gm in com.Member where gm.MemberId == loginMemberId select gm.Nickname).FirstOrDefault();
                            notice.GroupID = group_id.ToString();
                            notice.Group = (from g in com.Groups where g.GroupID == group_id select g.GroupName).FirstOrDefault();
                            notice.Nickname = (from gm in com.Member where gm.MemberId == loginMemberId select gm.Nickname).FirstOrDefault();

                            notice.setTitle(NoticeInfoForMyPage.CLS_GROUP, title);
                            notice.setBody(NoticeInfoForMyPage.CLS_GROUP, body);

                            MyPageCommon.SendMail(newMemberId, notice.Title, notice.Body);

                            //新規に追加する会員向けにお知らせ配信対象を生成
                            var newNotice = new NoticeDeliverySubject
                            {
                                NoticeId = Convert.ToInt32(noticeInfo.NoticeId),
                                MemberId = Convert.ToInt32(newMemberId),
                                ClassClass = 7,
                                UniqueID = Convert.ToInt32(loginMemberId),  //グループに入れた会員IDを保存
                                UniqueID2 = Convert.ToInt32(group_id),
                                AlreadyReadFlg = false,
                                NoticeDeliveryStatus = 1,
                                CreatedAccountID = loginMemberId.ToString(),
                                CreatedDate = DateTime.Now
                            };
                            com.NoticeDeliverySubject.Add(newNotice);

                        }
                        com.SaveChanges();

                        dbContextTransaction.Commit();
                    }
                    catch (Exception)
                    {
                        dbContextTransaction.Rollback();
                    }
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }

            return Json(addGroupModel, JsonRequestBehavior.AllowGet);
        }
        /// <summary>
        /// GET: /mypage/group/{id}/edit/
        /// </summary>
        /// <param name="group_id"></param>
        /// <param name="page"></param>
        public ActionResult Index(int group_id, int? page)
        {
            //Todo:認証処理 AOPでやりたい。 一旦Session変数を参照し判定(フォーム認証部分も本来なら見るべき。)
            if (Session["CurrentUser"] == null)
            {
                return RedirectToActionPermanent("Login", "Member", new { area = string.Empty });
            }

            var viewModel = new MyPageGroupEditViewModel();

            long memberId = GetMemberID();

            if (memberId <= 0 || group_id <= 0) return View(viewModel);

            viewModel.NewGroup = new MyPageGroupEditViewModel.NewGroupModel {MemberId = memberId};

            var group = (com.Groups.Where(g => g.GroupID == group_id)).FirstOrDefault();

            if (group == null) return View(viewModel);

            viewModel.NewGroup.GroupID = group_id;
            viewModel.NewGroup.GroupName = group.GroupName;
            viewModel.NewGroup.FollowerSearchString = string.Empty;

            viewModel =  this.workerService.GetViewModel(
                viewModel.NewGroup,
                MyPageGroupEditViewModel.INITIAL_PAGE_SIZE,
                this.systemDatetimeService.TargetYear,
                this.systemDatetimeService.TargetMonth);

            return View(viewModel);
        }