private DataOneRegistationInfo GetRegInfo(string sn) { DataOneRegistationInfo oneInfo = Uc_CareRegisters.Find( delegate(DataOneRegistationInfo tmp) { return(tmp.Sn == sn); }); return(oneInfo); }
private void OnCmdSaveTo(bool isReregister) { List <LedRegistationInfo> list = new List <LedRegistationInfo>(); ServerResponseCode strResult = ServerResponseCode.ScreenAlreadyExists; foreach (DataOneRegistationInfo oneInfo in Uc_CareRegisters) { if (string.IsNullOrEmpty(oneInfo.Led_name)) { strResult = ServerResponseCode.SnEmpty; list.Clear(); break; } list.Add(GetLedRegistationInfo(oneInfo)); } if (list.Count > 0) { if (isReregister) { foreach (LedRegistationInfo regInfo in list) { regInfo.IsReregistering = true; } } strResult = MonitorAllConfig.Instance().SaveResgiterTo(UserId, list, list[0].IsReregistering); if (strResult == ServerResponseCode.ScreenRegisteredSuccessfully) { foreach (LedRegistationInfo regInfo in list) { DataOneRegistationInfo oneInfo = Uc_CareRegisters.Find(a => a.Sn == regInfo.sn_num); LedRegistationInfoResponse ledReg = MonitorAllConfig.Instance().LedRegistationUiList.Find(a => a.SN == regInfo.sn_num); ledReg.IsRegisted = true; ledReg.Name = oneInfo.Led_name; ledReg.User = UserId; ledReg.Latitude = oneInfo.Latitude; ledReg.Longitude = oneInfo.Longitude; oneInfo.IsRegister = true; oneInfo.UserId = UserId; } MonitorAllConfig.Instance().LedRegistationInfoEventMethod(false); } } Messenger.Default.Send <string>(strResult.ToString(), MsgToken.MSG_NOTIFYDIALOG_OK); }