protected override void UpdateObject() { if (m_SubstituteId > 0) { DalSubstitute.LoadByPrimaryKey(m_SubstituteId); } else { DalSubstitute.AddNew(); } DalSubstitute.UserId = m_UserId; DalSubstitute.AvailabilityTimeStart = m_AvailabilityTimeStart; DalSubstitute.AvailabilityTimeEnd = m_AvailabilityTimeEnd; DalSubstitute.AvailabilityWeekDays = m_AvailabilityWeekDays; DalSubstitute.Save(); if (m_SubstituteId == 0) { m_SubstituteId = DalSubstitute.SubstituteId; } }