| | |
| | | { |
| | | public class MemberList : FrameLayout |
| | | { |
| | | public MemberList() |
| | | { |
| | | Tag = "Logic"; |
| | | } |
| | | Button selectedIcon = new Button(); |
| | | public static Action action; |
| | | public static bool edit=false; |
| | | Dictionary<string, string> deviceConditionsInfo = new Dictionary<string, string>(); |
| | | Dictionary<string, string> userdictionary = new Dictionary<string, string>(); |
| | | |
| | | public void Show(CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo=null) |
| | | public async void Show(CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo=null) |
| | | { |
| | | |
| | | if (!edit) |
| | | { |
| | | deviceConditionsInfo.Add("Type", "1"); |
| | |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | X = Application.GetRealWidth(176), |
| | | Width = Application.GetRealWidth(400), |
| | | Width = Application.GetRealWidth(600), |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.userlist, |
| | |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | this.AddChidren(middle); |
| | | |
| | | if (Send.UserList.Count == 0) |
| | | { |
| | | var allMemberslist = await Send.AllMembers(common.DeviceAddr); |
| | | Send.UserList.AddRange(allMemberslist); |
| | | } |
| | | foreach (var user in Send.UserList) |
| | | { |
| | | |
| | |
| | | lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * user.UserIdMode.Count) + 20 + 50); |
| | | for (int i = 0; i < user.UserIdMode.Count; i++) |
| | | { |
| | | var userid = user.UserIdMode[i]; |
| | | var userifon = user.UserIdMode[i]; |
| | | var doorlockfra = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | |
| | | }; |
| | | doorlockRow.AddChidren(doorlockBtn); |
| | | //(1按键/3卡/15指纹) |
| | | string[] s = userid.Split('_'); |
| | | switch (s[1]) |
| | | switch (userifon.OpenMode.ToString()) |
| | | { |
| | | case "0": |
| | | { |
| | |
| | | { |
| | | deviceConditionsInfo.Remove("AttriButeData2"); |
| | | } |
| | | deviceConditionsInfo.Add("AttriButeId", s[1]); |
| | | deviceConditionsInfo.Add("AttriButeData2", s[0]); |
| | | deviceConditionsInfo.Add("AttriButeId", userifon.OpenMode.ToString()); |
| | | deviceConditionsInfo.Add("AttriButeData2", userifon.UserId); |
| | | |
| | | if (userdictionary.ContainsKey("Account")) |
| | | { |
| | |
| | | } |
| | | userdictionary.Add("Account", Btntitle.Text+doorlockBtn.Text); |
| | | userdictionary.Add("Type", "1"); |
| | | userdictionary.Add("UserId", s[0]); |
| | | userdictionary.Add("UserId", userifon.UserId); |
| | | }; |
| | | doorlockRow.MouseUpEventHandler += doorlockclick; |
| | | doorlockBtn.MouseUpEventHandler += doorlockclick; |
| | | doorlockSelected.MouseUpEventHandler += doorlockclick; |
| | | doorlockfra.MouseUpEventHandler += doorlockclick; |
| | | if (edit) |
| | | if (edit&&editdeviceConditionsInfo!=null) |
| | | { |
| | | if (editdeviceConditionsInfo["AttriButeData2"] == s[1]) |
| | | deviceConditionsInfo = editdeviceConditionsInfo; |
| | | if (editdeviceConditionsInfo["AttriButeData2"] == userifon.UserId.ToString()) |
| | | { |
| | | selectedIcon.Visible = false; |
| | | selectedIcon = doorlockSelected; |
| | | doorlockSelected.Visible = true; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | Btncomplete.MouseUpEventHandler += (sender3, e3) => |
| | | { |
| | | |
| | | if (SelectedDeviceStatuscondition != "") |
| | | { |
| | | |
| | | bool add = false; |
| | | for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++) |
| | | { |
| | | if (Common.Logic.CurrentLogic.Conditions[i]["Type"] == "1") |
| | |
| | | Common.Logic.CurrentLogic.Accounts.Insert(j, userdictionary); |
| | | } |
| | | } |
| | | return; |
| | | add = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | Common.Logic.CurrentLogic.Accounts.Add(userdictionary); |
| | | Common.Logic.CurrentLogic.Conditions.Add(deviceConditionsInfo); |
| | | if (!add) |
| | | { |
| | | Common.Logic.CurrentLogic.Accounts.Add(userdictionary); |
| | | Common.Logic.CurrentLogic.Conditions.Add(deviceConditionsInfo); |
| | | } |
| | | |
| | | } |
| | | else |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |