public void UpdateUserAppointment(UserAppointmentPB pb) { //Debug.LogError(pb); var userappointmentVo = new UserAppointmentVo(pb); if (_userAppointmentVo.Count == 0 || _userAppointmentVo.Find(x => x.AppointmentId == userappointmentVo.AppointmentId) == null) { _userAppointmentVo.Add(userappointmentVo); return; } foreach (var v in _userAppointmentVo) { if (v.AppointmentId == userappointmentVo.AppointmentId) { v.ActiveGateInfos = userappointmentVo.ActiveGateInfos; v.ActiveState = userappointmentVo.ActiveState; // v.ClearState = userappointmentVo.ClearState; v.CreateTime = userappointmentVo.CreateTime; v.FinishGateInfos = userappointmentVo.FinishGateInfos; v.LastModifyTime = userappointmentVo.LastModifyTime; // v.NailUpState = userappointmentVo.NailUpState; v.UserId = userappointmentVo.UserId; } } }
public UserAppointmentVo(UserAppointmentPB res) { UserId = res.UserId; AppointmentId = res.AppointmentId; ActiveState = res.ActiveState; ActiveGateInfos = new List <int>(); FinishGateInfos = new List <int>(); foreach (var v in res.ActiveGates) { ActiveGateInfos.Add(v); } foreach (var v in res.FinishGates) { FinishGateInfos.Add(v); } // ClearState = res.ClearState; // NailUpState = res.NailUpState; CreateTime = res.CreateTime; LastModifyTime = res.LastModifyTime; }