protected override void Init() { base.Init(); PageTitle.Init("成员信息", App.Instance.Theme.TitleBgColor, App.Instance.Theme.TitleFontColor, BtnBack); PageTitle.AddButton("", App.Instance.ImageManger.ImageList[2], DeletePeople); int userid = this.GetPar <int>(0); IsPeopleOrTeam = this.GetPar <bool>(1); int projectID = this.GetPar <int>(2); if (IsPeopleOrTeam) { People_Service.GetMyOnePeople(userid, t => { EPeople = t.GetData() as EPeople; BindData(); }); } else { ProjectTeam_Service.GetByProjectID(userid, projectID, t => { ETeamOne = t.GetData() as EProjectTeam; BindData(); }); } }
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); }); }
public static EProject CreateProject(EProject obj, int userid) { EProject newObj = DBBase.Create(obj) as EProject; EProjectTeam projectTeam = new EProjectTeam() { UserID = userid, ProjectID = newObj.ID }; DBBase.Create(projectTeam); EProjectTaskStep projectStep1 = new EProjectTaskStep() { ProjectID = newObj.ID, Name = "新任务", Value = 1 }; DBBase.Create(projectStep1); EProjectTaskStep projectStep2 = new EProjectTaskStep() { ProjectID = newObj.ID, Name = "已完成", Value = 2 }; DBBase.Create(projectStep2); return(newObj); }
public MyResult GetByProjectID(int par0, int par1) { EProjectTeam teamOne = DBBase.QueryCustom <EProjectTeam>("select p.*,u.`Name`as UserName,u.Face as UserFace from projectteam p LEFT JOIN `user` u ON p.UserID=u.ID where p.UserID=" + par0 + " and p.ProjectID=" + par1).FirstOrDefault(); return(ServiceResult(teamOne)); }