private void BindTransferOne(ListViewControl listview, System.DateTime date) { TaskTransfer_Service.ListByTaskID(TheTask.ID, t => { List <ETaskTransfer> plist = t.GetData() as List <ETaskTransfer>; plist = plist.Where(c => c.CreateTime >= date && c.CreateTime < date.AddDays(1)).ToList(); listview.BindData <ETaskTransfer>("TaskTransferOneItem", plist, (i, e) => { i.name = "TaskTransferOneItem_" + e.ID; App.Instance.ShowImage(i.transform.Find("Icon").GetComponent <RawImage>(), e.AppointFace, 11); i.transform.Find("Name").GetComponent <Text>().text = e.AppointName; i.transform.Find("Idea").GetComponent <Text>().text = e.Note; i.transform.Find("Time").GetComponent <Text>().text = e.CreateTime.ToString("hh:mm"); if (e.AssignedPersonID != 0) { i.transform.Find("ToOther").gameObject.SetActive(true); i.transform.Find("DoProcess").gameObject.SetActive(false); i.transform.Find("ToOther").Find("Name (1)").GetComponent <Text>().text = e.AssignedName; App.Instance.ShowImage(i.transform.Find("ToOther").Find("Icon (2)").GetComponent <RawImage>(), e.AppointFace, 11); } else { i.transform.Find("ToOther").gameObject.SetActive(false); i.transform.Find("DoProcess").gameObject.SetActive(true); i.transform.Find("DoProcess").Find("Name (1)").GetComponent <Text>().text = e.StepName; } }, false); }); }
private void AddData() { TaskTransfer_Service.ListByUserID(Session.UserID, (PageIndex + 1), PageSize, t => { List <ETaskTransfer> plist = t.GetData() as List <ETaskTransfer>; TaskTransferList.AddRange(plist); List <System.DateTime> datelist = TaskTransferList.GroupBy(c => c.CreateTime.Date).Select(c => c.Key).OrderByDescending(c => c).ToList(); datelist = datelist.Where(c => !TransferList.DataList.Any(b => (System.DateTime)b == c)).ToList(); TransferList.AddData(datelist.Select(c => (object)c).ToList()); if (plist.Count >= 0) { PageIndex++; } }); }
private void BindData() { TaskTransfer_Service.ListByTaskID(TheTask.ID, t => { List <ETaskTransfer> plist = t.GetData() as List <ETaskTransfer>; List <System.DateTime> datelist = plist.GroupBy(c => c.CreateTime.Date).Select(c => c.Key).OrderByDescending(c => c).ToList(); TransferList.BindData <System.DateTime>("TaskTransferItem", datelist, (i, e) => { i.name = "TaskTransferItem_" + e.Date.ToString(); i.transform.Find("Day").GetComponent <Text>().text = e.Date.ToString("yyyy.MM.dd"); BindTransferOne(i.transform.Find("Panel").Find("TransferOneList").GetComponent <ListViewControl>(), e.Date); int rowCount = plist.Count(c => c.CreateTime >= e.Date && c.CreateTime < e.Date.AddDays(1)); i.GetComponent <LayoutElement>().preferredHeight = rowCount * (53 + 15); }, false); }); }
private void BindData() { TaskTransfer_Service.ListByUserID(Session.UserID, PageIndex, PageSize, t => { TaskTransferList = t.GetData() as List <ETaskTransfer>; List <System.DateTime> datelist = TaskTransferList.GroupBy(c => c.CreateTime.Date).Select(c => c.Key).OrderByDescending(c => c).ToList(); List <object> objlist = datelist.Select(c => (object)c).ToList(); TransferList.BindData("MyFootprintItem", objlist, (i, gg) => { System.DateTime e = (System.DateTime)gg; i.name = "MyFootprintItem_" + e.Date.ToString(); i.transform.Find("Day").GetComponent <Text>().text = e.Date.ToString("yyyy.MM.dd"); BindTransferOne(i.transform.Find("Panel").Find("TransferOneList").GetComponent <ListViewControl>(), e.Date); int rowCount = TaskTransferList.Count(c => c.CreateTime >= e.Date && c.CreateTime < e.Date.AddDays(1)); i.GetComponent <LayoutElement>().preferredHeight = rowCount * 70 + 15; }, false); }); }