private async Task QuitOrDeclineTeamNotify(long teamId, User user, UserTeam userTeam)
        {
            var ownerId = await context.Teams.GetOwnerId(teamId);

            var items = new List <NoticeItem>
            {
                NoticeItem.User(user),
                NoticeItem.Team(userTeam.Team)
            };

            switch (userTeam.UserAction)
            {
            case UserActionEnum.RejectedTeamRequest:
                await notificationSender.Send(ownerId, NotifyType.Destructive,
                                              "{0} отказался от приглашения в команду {1}", user.Photo100, items);

                break;

            case UserActionEnum.QuitTeam:
                await notificationSender.Send(ownerId, NotifyType.Destructive,
                                              "{0} вышел из команды {1}", user.Photo100, items);

                break;
            }
        }
Exemplo n.º 2
0
    private void GetNotice()
    {
        http_notice.HttpSuccessCallBack.Addlistener((ReturnHttpMessage msg) =>
        {
            if (msg.Data["ok"].ToString() == "ok")
            {
                GameManager.GetGameManager.ClearChild(noticeItemContentParent);
                JsonData tbl = msg.Data["tbl"];

                foreach (JsonData item in tbl)
                {
                    GameObject go       = ObjectPool.GetInstance().GetObj(noticeItem, noticeItemContentParent);
                    NoticeItem nItem    = go.GetComponent <NoticeItem>();
                    nItem.titleTxt.text = item["title"].ToString();
                    nItem.backgroundBtn.onClick.RemoveAllListeners();
                    nItem.backgroundBtn.onClick.AddListener(() =>
                    {
                        GameManager.GetGameManager.OpenWindow(WindowBASE_noticeDetail);
                        transform_NoticeDetail.GetDetail(item);
                    });
                }
            }
        });
        http_notice.Get();
    }
        private async Task JoinTeamNotify(long teamId, User user, Team team)
        {
            var ownerId = await context.Teams.GetOwnerId(teamId);

            await notificationSender.Send(ownerId, NotifyType.Destructive,
                                          "{0} принял приглашение в команду {1}", user.Photo100,
                                          NoticeItem.User(user),
                                          NoticeItem.Team(team));
        }
 private async Task SetTeamNotify(long userId, Team dbTeam, UserActionEnum userActionToSet)
 {
     if (userActionToSet == UserActionEnum.ConsideringOffer)
     {
         await notificationSender.Send(userId, NotifyType.Add,
                                       "Вас пригласили в команду {0}",
                                       dbTeam.Image.DataURL,
                                       NoticeItem.Team(dbTeam));
     }
 }
Exemplo n.º 5
0
    public void Show(NoticeItem noticeItem)
    {
        var preferredDescription = noticeItem.description;

        if (GameContext.IsNavigationEnabled && !String.IsNullOrEmpty(noticeItem.gamepadDescription))
        {
            preferredDescription = noticeItem.gamepadDescription;
        }
        this.Show(preferredDescription, noticeItem.duration);
    }
Exemplo n.º 6
0
        public ActionResult CreateNotice(string title, string description, string reward, string postedby, string expiration)
        {
            NoticeItem notice = new NoticeItem();

            notice.Title = title;

            //{Title: title, Body: description, Reward: reward, PostedBy: postedby, Expiration: expiration}
            AdventureTime.notice.AddNotice(new NoticeItem());

            return(RedirectToAction("Index"));
        }
Exemplo n.º 7
0
        public void InsertOnePlaceholder()
        {
            var message = "Вас пригласили в команду {0}";
            var items   = new List <NoticeItem>
            {
                NoticeItem.Team(27, "Super puper Team")
            };

            message = PlaceholderBuilder.Build(message, items);

            message.Should().Be("Вас пригласили в команду #[Team27]");
        }
Exemplo n.º 8
0
        /// <summary>
        /// お知らせ
        /// </summary>
        public static async Task<NoticeItem> getNotice(int itemID)
        {
            var notice = JsonConvert.DeserializeObject<NoticeItemObject>(await APIManager.NoticeItem(itemID));

            var result = 
                    new NoticeItem
                    {
                        Date = DateTimeHelper.DiffTimeString(notice.published_at, DateTime.UtcNow),
                        Title = notice.title,
                        Text = notice.body
                    };
            return result;
        }
Exemplo n.º 9
0
        public void InsertTwoPlaceholder()
        {
            var message = "Вас пригласили в команду {0} по рекомендации пользователя {1}";
            var items   = new List <NoticeItem>
            {
                NoticeItem.Team(27, "Super puper Team"),
                NoticeItem.User(666, "Milkov")
            };

            message = PlaceholderBuilder.Build(message, items);

            message.Should().Be("Вас пригласили в команду #[Team27] по рекомендации пользователя #[User666]");
        }
Exemplo n.º 10
0
 public void InitListTree()
 {
     if (this.m_ntitems != null)
     {
         this.treeList2.Nodes.Clear();
         for (int i = 0; i < this.m_ntitems.Count; i++)
         {
             NoticeItem item     = this.m_ntitems[i];
             object[]   nodeData = new object[] { i, item.invcode, item.invname, item.spectypegraphid, item.plannum.ToString() };
             this.treeList2.AppendNode(nodeData, -1, 0, 0, 0).Tag = i;
         }
         this.GenRouteS();
     }
 }
        private async Task RejectedOrRemoveUserNotify(long userId, Team team, UserActionEnum userAction)
        {
            var requestUserId = HttpContext.User.Identity.Name;

            var teamItem = NoticeItem.Team(team);
            var user     = await context.Users.FirstOrDefaultAsync(u => u.Id == userId);

            if (requestUserId != userId.ToString())
            {
                switch (userAction)
                {
                case UserActionEnum.RejectedTeamRequest:
                    await notificationSender.Send(userId, NotifyType.Destructive,
                                                  "Команда {0} отклонила вашу заявку", team.Image.DataURL, teamItem);

                    break;

                case UserActionEnum.QuitTeam:
                    await notificationSender.Send(userId, NotifyType.Destructive,
                                                  "Команда {0} исключила вас из списка участников", team.Image.DataURL, teamItem);

                    break;
                }
            }
            else
            {
                var items = new List <NoticeItem> {
                    NoticeItem.User(user), teamItem
                };
                var ownerId = await context.Teams.GetOwnerId(team.Id);

                switch (userAction)
                {
                case UserActionEnum.RejectedTeamRequest:
                    await notificationSender.Send(ownerId, NotifyType.Destructive,
                                                  "{0} отказался от приглашения в команду {1}", user.Photo100, items);

                    break;

                case UserActionEnum.QuitTeam:
                    await notificationSender.Send(ownerId, NotifyType.Destructive,
                                                  "{0} вышел из команды {1}", user.Photo100, items);

                    break;
                }
            }
        }
Exemplo n.º 12
0
 public void UpdateNoticeDate(List <AnnouncementData> annoucesList)
 {
     m_NoticeTrans.GetChild(3).gameObject.SetActive(false);
     m_NoticeTrans.GetChild(2).gameObject.SetActive(false);
     for (byte i = 0; i < annoucesList.Count; i++)
     {
         AnnouncementData data = new AnnouncementData();
         data.Title   = annoucesList[i].Title;
         data.Date    = annoucesList[i].Date;
         data.Content = annoucesList[i].Content;
         GameObject go = GameObject.Instantiate(m_NoticeLabelItem);
         m_NoticeTrans.GetChild(1).GetChild(1).GetComponent <UIGrid>().AddChild(go.transform);
         go.GetComponent <UILabel>().text = data.Title + " " + data.Date;
         go.transform.localScale          = Vector3.one;
         NoticeItem item = new NoticeItem(go, data.Content, m_NoticeTrans);
         go.SetActive(true);
     }
 }
        private async Task JoinTeamNotify(long userId, Team team, User user, UserActionEnum wasAction)
        {
            var teamItem = NoticeItem.Team(team);
            var ownerId  = await context.Teams.GetOwnerId(team.Id);

            switch (wasAction)
            {
            case UserActionEnum.ConsideringOffer:
                await notificationSender.Send(ownerId, NotifyType.Destructive,
                                              "{0} принял приглашение вступить в команду {1}", user.Photo100,
                                              NoticeItem.User(user), teamItem);

                break;

            case UserActionEnum.SentRequest:
                await notificationSender.Send(userId, NotifyType.Destructive,
                                              "Команда {0} добавила вас в список участников", team.Image.DataURL,
                                              teamItem);

                break;
            }
        }