| | |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Newtonsoft.Json; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | |
| | | var page = new AddGroupControlPage(null, |
| | | (newGC) => |
| | | { |
| | | ReadGroupControlList(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | LoadGroupControlView(); |
| | | }); |
| | | }, () => { }); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | |
| | | { |
| | | try |
| | | { |
| | | FunctionList.List.groupControls.Clear(); |
| | | FunctionList.List.groupControls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | //FunctionList.List.groupControls.Clear(); |
| | | //FunctionList.List.groupControls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | |
| | | try |
| | | { |
| | | var groupControlList = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | var readSidList = new List<string>(); |
| | | foreach (var temp in groupControlList) |
| | | { |
| | | FunctionList.List.groupControls.Clear(); |
| | | readSidList.Add(temp.userDeviceGroupControlId); |
| | | if (readSidList.Count >= 20) |
| | | { |
| | | var data = ApiUtlis.Ins.HttpRequest.GetGroupControInfo(readSidList); |
| | | if (data != null) |
| | | { |
| | | if (data.Code == StateCode.SUCCESS) |
| | | { |
| | | var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); |
| | | FunctionList.List.groupControls.AddRange(groupControlInfoList); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | readSidList.Clear(); |
| | | } |
| | | } |
| | | if (readSidList.Count > 0) |
| | | { |
| | | var data = ApiUtlis.Ins.HttpRequest.GetGroupControInfo(readSidList); |
| | | if (data != null) |
| | | { |
| | | if (data.Code == StateCode.SUCCESS) |
| | | { |
| | | var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); |
| | | FunctionList.List.groupControls.AddRange(groupControlInfoList); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | readSidList.Clear(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"读取组控列表失败:{ex.Message}"); |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |