Пример #1
0
    void BindPeopleList()
    {
        People_Service.ListMyPeople(t =>
        {
            PeopleView.OnItemClicked = OnPeopleClicked;
            List <EPeople> plist     = t.GetData() as List <EPeople>;
            plist = plist.Where(c => c.State == PeopleState.Normal).ToList();
            PeopleView.BindData <EPeople>("PeopleMsgItem", plist, (i, e) =>
            {
                i.name = "PeopleMsgItem_" + e.PeopleID;
                i.transform.Find("Name").GetComponent <Text>().text = e.PeopleName;

                App.Instance.ShowImage(i.transform.Find("Icon").GetComponent <RawImage>(), e.PeopleFace, 11);

                if (TipsList != null && TipsList.Count(c => c.Type == MessageType.OneToOne && c.OwnerID == e.PeopleID) > 0)
                {
                    i.transform.Find("tips").gameObject.SetActive(true);
                }
                else
                {
                    i.transform.Find("tips").gameObject.SetActive(false);
                }
            });
        });
    }
Пример #2
0
 private void BindData()
 {
     People_Service.ListMyPeople(t =>
     {
         ListView.BindData <EPeople>("PeopleItem", t.GetData() as List <EPeople>, (i, e) =>
         {
             i.name = "PeopleItem_" + e.PeopleID + "_" + e.ID;
             i.transform.Find("Name").GetComponent <Text>().text = e.PeopleName;
             if (e.State == Lemon.Team.Entity.Enum.PeopleState.Request)
             {
                 i.transform.Find("Phone").GetComponent <Text>().text = "请求中";// user.Phone;
             }
             else
             {
                 i.transform.Find("Phone").GetComponent <Text>().text = "";
             }
             if (e.State == Lemon.Team.Entity.Enum.PeopleState.NeedConfirm)
             {
                 GameObject tgbtn = i.transform.Find("tgbtn").gameObject;
                 GameObject jjbtn = i.transform.Find("jjbtn").gameObject;
                 tgbtn.SetActive(true);
                 jjbtn.SetActive(true);
                 EventListener.Get(tgbtn).onClick = OnTGBtnClicked;
                 EventListener.Get(jjbtn).onClick = OnJJBtnClicked;
             }
             else
             {
                 i.transform.Find("tgbtn").gameObject.SetActive(false);
                 i.transform.Find("jjbtn").gameObject.SetActive(false);
             }
             App.Instance.ShowImage(i.transform.Find("Icon").GetComponent <RawImage>(), e.PeopleFace, 11);
         });
     });
 }
Пример #3
0
 private void BindData()
 {
     People_Service.ListMyPeople(p =>
     {
         List <EPeople> myPeople = p.GetData() as List <EPeople>;
         User_Service.SearchUser(SearchWord.text, u =>
         {
             List <EUser> plist = u.GetData() as List <EUser>;
             ListView.BindData <EUser>("PeopleSearchItem", plist, (i, e) =>
             {
                 i.name = "PlanItem_" + e.ID;
                 i.transform.Find("Name").GetComponent <Text>().text  = e.Name;
                 i.transform.Find("Phone").GetComponent <Text>().text = e.Phone;
                 if (myPeople.Any(c => c.PeopleID == e.ID))
                 {
                     i.transform.Find("Button").GetComponent <Button>().gameObject.SetActive(false);
                 }
                 else
                 {
                     i.transform.Find("Button").GetComponent <Button>().gameObject.SetActive(true);
                     EventListener.Get(i.transform.Find("Button").gameObject).onClick = OnBtnAddClicked;
                 }
                 App.Instance.ShowImage(i.transform.Find("Icon").GetComponent <RawImage>(), e.Face, 11);
             });
         });
     });
 }
Пример #4
0
 void OnAddClicked(GameObject g)
 {
     People_Service.ListMyPeople(p =>
     {
         List <EKeyName> userList = new List <EKeyName>();
         List <EPeople> plist     = p.GetData() as List <EPeople>;
         plist = plist.Where(c => c.State == PeopleState.Normal).ToList();
         plist.ForEach(u =>
         {
             userList.Add(new EKeyName()
             {
                 ID = u.PeopleID, Name = u.PeopleName, Other = u.PeopleFace
             });
         });
         EUser myself = Session.CurrentUser;
         userList.Add(new EKeyName()
         {
             ID = myself.ID, Name = myself.Name, Other = myself.Face
         });
         App.Instance.DialogBox.Show("选择成员", "Page_UserSelected", "", 300, 500, gg =>
         {
             DialogPage dpg = App.Instance.DialogBox.ContentPage.GetComponent <DialogPage>();
             string uid     = dpg.SelectedData;
             if (!string.IsNullOrEmpty(uid))
             {
                 ProjectTeam_Service.ListByProjectID(EProject.ID, tm =>
                 {
                     List <EProjectTeam> teamList = tm.GetData() as List <EProjectTeam>;
                     if (!teamList.Any(c => c.UserID == int.Parse(uid)))
                     {
                         EProjectTeam teamItem = new EProjectTeam();
                         teamItem.ProjectID    = EProject.ID;
                         teamItem.UserID       = int.Parse(uid);
                         BaseOperation_Service.Create <EProjectTeam>(teamItem, t =>
                         {
                             BindData();
                         });
                     }
                 });
             }
         }, null, userList);
     });
 }