| | |
| | | } |
| | | } |
| | | var accounts = new JArray(); |
| | | foreach (var dictionary in logic.Accounts) { |
| | | foreach (var dictionary in logic.Accounts) |
| | | { |
| | | var Type = int.Parse(dictionary["Type"]); |
| | | switch (Type) |
| | | { |
| | | case 1: { |
| | | case 1: |
| | | { |
| | | /// |
| | | } break; |
| | | if (logic.LogicType == 1) |
| | | { |
| | | var accounts1 = new JObject |
| | | { |
| | | ["Type"] = int.Parse(dictionary["Type"]), |
| | | ["Account"] = dictionary["Account"], |
| | | |
| | | }; |
| | | accounts.Add(accounts1); |
| | | } |
| | | } |
| | | break; |
| | | case 7: |
| | | { |
| | | var location = new JObject |
| | |
| | | { "IsEnable", logic.IsEnable} , |
| | | { "LogicName", logic.LogicName}, |
| | | { "Relationship",logic.Relationship} , |
| | | { "LogicType",logic.LogicType} , |
| | | { "LogicCustomPushText",logic.LogicCustomPushText} , |
| | | { "TimeAttribute", timeAttribute} , |
| | | { "Conditions", conditions }, |
| | |
| | | logic.Relationship = int.Parse(Logicifon["Relationship"].ToString()); |
| | | logic.TimeAttribute = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.TimeAttributeObj>(Logicifon["TimeAttribute"].ToString()); |
| | | logic.Conditions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(Logicifon["Conditions"].ToString()); |
| | | logic.Accounts = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(Logicifon["Accounts"].ToString()); |
| | | List<Dictionary<string, object>> listactions = new List<Dictionary<string, object>>(); |
| | | listactions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(Logicifon["Actions"].ToString()); |
| | | |
| | |
| | | public static List<DoorLock> ReadDoorLock(Residential lockifon) |
| | | { |
| | | List<DoorLock> list = new List<DoorLock>(); |
| | | System.Net.WebClient webClient = new System.Net.WebClient(); |
| | | System.Net.WebClient webClient = new System.Net.WebClient(); |
| | | System.Collections.Specialized.NameValueCollection postValues = new System.Collections.Specialized.NameValueCollection(); |
| | | postValues.Add("RequestVersion", CommonPage.RequestVersion); |
| | | postValues.Add("LoginAccessToken", lockifon.Token); |
| | |
| | | return DoorLockLocalUserId + "_" + OpenLockMode.ToString(); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public class Residential |
| | | { |
| | | public string Id = string.Empty; |
| | | public bool IsOthreShare; |
| | | public string MainUserDistributedMark = string.Empty; |
| | | public string Url = string.Empty; |
| | | public string Token = string.Empty; |
| | | public bool IsOtherAccountCtrl; |
| | | public string doorlockmac; |
| | | } |
| | | |
| | | public class MembershipIfon |
| | |
| | | |
| | | public static List<MembershipIfon> UserList = new List<MembershipIfon>(); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | } |
| | | } |