/// <summary> /// Записывает ReleaseToService в CorrectiveAction в завсимоти от существования данного(this) обекта в базе данных /// </summary> /// <param name="releaseToService"></param> private void SetReleaseToService(CertificateOfReleaseToService releaseToService) { if (_releaseToServiceCollection == null) { _releaseToServiceCollection = new BaseRecordCollection <CertificateOfReleaseToService>(); } if (releaseToService != null) { if (_certificateOfReleaseToService != null || _releaseToServiceCollection.Count > 0) { _releaseToServiceCollection.Clear(); _releaseToServiceCollection.Add(releaseToService); } else { _releaseToServiceCollection.Add(releaseToService); } } }
/// <summary> /// Возвращает CorrectiveAction в зависимоти от условия существоваяния в базе данных /// </summary> /// <returns></returns> private CertificateOfReleaseToService GetReleaseToService() { if (_releaseToServiceCollection == null) { _releaseToServiceCollection = new BaseRecordCollection <CertificateOfReleaseToService>(); } if (_releaseToService == null) { if (_releaseToServiceCollection.Count == 0) { _releaseToService = new CertificateOfReleaseToService(); AddReleaseToService(_releaseToService); } else { _releaseToService = _releaseToServiceCollection[0]; } } return(_releaseToService); }
/// <summary> /// Возвращает CorrectiveAction в зависимоти от условия существоваяния в базе данных /// </summary> /// <returns></returns> private CertificateOfReleaseToService GetReleaseToService() { if (_releaseToServiceCollection == null) { _releaseToServiceCollection = new BaseRecordCollection <CertificateOfReleaseToService>(); } if (_certificateOfReleaseToService == null) { if (_releaseToServiceCollection.Count == 0) { _certificateOfReleaseToService = new CertificateOfReleaseToService { RecordDate = DateTimeExtend.GetCASMinDateTime() }; _releaseToServiceCollection.Add(_certificateOfReleaseToService); } else { _certificateOfReleaseToService = _releaseToServiceCollection[0]; } } return(_certificateOfReleaseToService); }
/// <summary> /// Записывает ReleaseToService в базу данных /// </summary> private void AddReleaseToService(CertificateOfReleaseToService releaseToService) { _releaseToServiceCollection.Add(releaseToService); // ((ICRSContains)this).CRSID = _releaseToService.ID; }