public string AddCardWithoutNotify(AddCardInfo info) { try { string rooms = string.Join(",", info.ERIDs); for (int i = 0; i < info.ERIDs.ToArray().Length; i++) { Exchange(info.MCNSID, info.ERIDs[i], info.CardNo, info.Name, info.StartDate, info.EndDate); } return "0:success!" + rooms; } catch (Exception ex) { return "-1:" + ex.Message + "," + ex.StackTrace; } }
public string AddCard(AddCardInfo info) { string rooms = string.Join(",", info.ERIDs); // return "0: add " + info.CardNo + " to " + rooms + " success!"; try { for (int i = 0; i < info.ERIDs.ToArray().Length; i++) { Exchange(info.MCNSID, info.ERIDs[i], info.CardNo, info.Name, info.StartDate, info.EndDate); } SecureService.SecureServiceClient client = new SecureService.SecureServiceClient(new System.ServiceModel.InstanceContext(this)); client.NotifyDBChange(SecureService.DBChangedConstant.AuthorityChanged,""); return "0:success!"+rooms; } catch (Exception ex) { return "-1:" + ex.Message+","+ex.StackTrace; } }
public string AddCard(AddCardInfo[] infos) { //string rooms = ""; string.Join(",", info.ERIDs); // return "0: add " + info.CardNo + " to " + rooms + " success!"; List<string> list = new List<string>(); try { foreach (AddCardInfo info in infos) { for (int i = 0; i < info.ERIDs.ToArray().Length; i++) { string roleid = R23Exchange(info.MCNSID, info.ERIDs[i], info.CardNo, info.Name, info.StartDate, info.EndDate); list.Add(roleid); } } SecureService.SecureServiceClient client = new SecureService.SecureServiceClient(new System.ServiceModel.InstanceContext(this)); if(list.Count>0) client.NotifyDBChange(SecureService.DBChangedConstant.AuthorityChanged,string.Join("," ,list.ToArray())); return "0:success!"; } catch (Exception ex) { return "-1:" + ex.Message + "," + ex.StackTrace; } }