| | |
| | | |
| | | Btncomplete.MouseUpEventHandler += (sender3, e3) => |
| | | { |
| | | string userIdstr = "", openModestr=""; |
| | | var deviceConditionsInfo = new Dictionary<string, string>(); |
| | | var userdictionary = new Dictionary<string, string>(); |
| | | deviceConditionsInfo.Add("Type", "1"); |
| | |
| | | userdictionary.Add("Account",accountname); |
| | | userdictionary.Add("Type", "1"); |
| | | userdictionary.Add("UserId", userId); |
| | | |
| | | if (edit) |
| | | { |
| | | openModestr = editdeviceConditionsInfo["AttriButeId"]; |
| | | userIdstr = editdeviceConditionsInfo["AttriButeData2"]; |
| | | } |
| | | else |
| | | { |
| | | openModestr = deviceConditionsInfo["AttriButeId"]; |
| | | userIdstr = deviceConditionsInfo["AttriButeData2"]; |
| | | } |
| | | if (SelectedDeviceStatuscondition != "") |
| | | { |
| | | bool add = false; |
| | |
| | | { |
| | | if ((Common.Logic.CurrentLogic.Conditions[i]["MacAddr"] == common.DeviceAddr) && (Common.Logic.CurrentLogic.Conditions[i]["Epoint"] == common.DeviceEpoint.ToString())) |
| | | { |
| | | if (Common.Logic.CurrentLogic.Conditions[i]["AttriButeId"] == editdeviceConditionsInfo["AttriButeId"] && Common.Logic.CurrentLogic.Conditions[i]["AttriButeData2"] == editdeviceConditionsInfo["AttriButeData2"]) |
| | | if (Common.Logic.CurrentLogic.Conditions[i]["AttriButeId"] == openModestr && Common.Logic.CurrentLogic.Conditions[i]["AttriButeData2"] == userIdstr) |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.RemoveAt(i); |
| | | Common.Logic.CurrentLogic.Conditions.Insert(i, deviceConditionsInfo); |
| | | for (int j = 0; j < Common.Logic.CurrentLogic.Accounts.Count; j++) |
| | | { |
| | | if (Common.Logic.CurrentLogic.Accounts[j]["UserId"] == editdeviceConditionsInfo["AttriButeData2"]) |
| | | if (Common.Logic.CurrentLogic.Accounts[j]["UserId"] == userIdstr) |
| | | { |
| | | Common.Logic.CurrentLogic.Accounts.RemoveAt(j); |
| | | Common.Logic.CurrentLogic.Accounts.Insert(j, userdictionary); |