protected void UpdateView() { nameTxt.text = Name; phoneTxt.text = Phone; pwdTxt.text = Password; GetSchoolMsg msg = new GetSchoolMsg(NetDataManager.Instance.user.school_id); MsgManager.Instance.NetMsgCenter.NetGetSchoolById(msg, (respond) => { var school = JsonHelper.DeserializeObject <List <School> >(respond.data); if (school != null && school.Count != 0) { schoolTxt.text = school[0].school_name; } }); GetSubjectByIdMsg sbjMsg = new GetSubjectByIdMsg(NetDataManager.Instance.user.subject_id); MsgManager.Instance.NetMsgCenter.NetGetSubjectById(sbjMsg, (respond) => { var sbj = JsonHelper.DeserializeObject <Subject>(respond.data); if (sbj != null) { subjectTxt.text = sbj.subject_name; } }); }
private void UpdateView() { GetUserByIdMsg userMsg = new GetUserByIdMsg(invitation.post_user); MsgManager.Instance.NetMsgCenter.NetGetUserById(userMsg, (respond) => { var user = JsonHelper.DeserializeObject <User>(respond.data); nameTxt.text = user.username; }); titleTxt.text = "标题 " + invitation.invitation_title; contentTxt.text = "内容 " + invitation.content; dateTxt.text = invitation.create_time; if (isCommnuty) { GetSubjectByIdMsg sbjMsg = new GetSubjectByIdMsg(invitation.plate); MsgManager.Instance.NetMsgCenter.NetGetSubjectById(sbjMsg, (respond) => { var sbj = JsonHelper.DeserializeObject <Subject>(respond.data); if (sbj == null) { return; } tagTxt.text = "#" + sbj.subject_name; }); } else { GetSchoolMsg schoolMsg = new GetSchoolMsg(invitation.school_id); MsgManager.Instance.NetMsgCenter.NetGetSchoolById(schoolMsg, (respond) => { var school = JsonHelper.DeserializeObject <School>(respond.data); if (school == null) { return; } tagTxt.text = "#" + school.school_name; }); } GetCommentMsg msg = new GetCommentMsg(invitation.invitation_id); MsgManager.Instance.NetMsgCenter.NetGetComment(msg, (respond) => { var list = JsonHelper.DeserializeObject <List <Comment> >(respond.data); commentNumTxt.text = list.Count.ToString(); }); }
private void UpdateView() { GetSchoolMsg msg = new GetSchoolMsg(invitation.school_id); MsgManager.Instance.NetMsgCenter.NetGetSchoolById(msg, (respond) => { var school = JsonHelper.DeserializeObject <List <School> >(respond.data); if (school != null && school.Count != 0) { schoolTxt.text = school[0].school_name; } titleTxt.text = invitation.invitation_title; contentTxt.text = invitation.content; var x = content.sizeDelta.x; var y = contentTxt.preferredHeight; content.sizeDelta = new Vector2(x, y); }); }