public DataReturnVersion CreateDataReturnVersion(Scheme scheme, int complianceYear, int quarter, bool isSubmitted = true, DataReturn dataReturn = null, WeeeCollectedReturnVersion weeeCollectedReturnVersion = null) { if (dataReturn == null) { dataReturn = GetOrCreateDataReturn(scheme, complianceYear, quarter); } Guid dataReturnVersionId = IntegerToGuid(GetNextId()); var dataReturnVersion = new DataReturnVersion { Id = dataReturnVersionId, DataReturn = dataReturn, DataReturnId = dataReturn.Id, CreatedDate = DateTime.UtcNow }; if (isSubmitted) { dataReturnVersion.SubmittedDate = DateTime.UtcNow; dataReturnVersion.SubmittingUserId = GetOrCreateUser("Testuser").Id; dataReturn.CurrentDataReturnVersionId = dataReturnVersionId; dataReturn.CurrentDataReturnVersion = dataReturnVersion; } if (weeeCollectedReturnVersion != null) { dataReturnVersion.WeeeCollectedReturnVersion = weeeCollectedReturnVersion; } model.DataReturnVersions.Add(dataReturnVersion); return(dataReturnVersion); }
public DataReturnUpload CreateDataReturnUpload(Scheme scheme, DataReturnVersion dataReturnVersion = null) { int dataReturnUploadId = GetNextId(); DataReturnUpload dataReturnUpload = new DataReturnUpload { Id = IntegerToGuid(dataReturnUploadId), SchemeId = scheme.Id, Scheme = scheme, Data = string.Format("<SchemeReturn{0} />", dataReturnUploadId), Date = DateTime.UtcNow, ProcessTime = TimeSpan.Zero }; if (dataReturnVersion != null) { dataReturnUpload.DataReturnVersionId = dataReturnVersion.Id; dataReturnUpload.DataReturnVersion = dataReturnVersion; if (dataReturnVersion.DataReturn != null) { dataReturnUpload.ComplianceYear = dataReturnVersion.DataReturn.ComplianceYear; dataReturnUpload.Quarter = dataReturnVersion.DataReturn.Quarter; } } model.DataReturnUploads.Add(dataReturnUpload); return(dataReturnUpload); }
public EeeOutputAmount CreateEeeOutputAmount(DataReturnVersion dataReturnVersion, RegisteredProducer registeredProducer, string obligationType, int weeeCategory, decimal tonnage) { var eeeOutputAmount = CreateEeeOutputAmount(registeredProducer, obligationType, weeeCategory, tonnage); AddEeeOutputAmount(dataReturnVersion, eeeOutputAmount); return(eeeOutputAmount); }
public void AddWeeeDeliveredAmount(DataReturnVersion dataReturnVersion, WeeeDeliveredAmount weeeDeliveredAmount) { if (dataReturnVersion.WeeeDeliveredReturnVersion == null) { dataReturnVersion.WeeeDeliveredReturnVersion = CreateWeeeDeliveredReturnVersion(); } AddWeeeDeliveredAmount(dataReturnVersion.WeeeDeliveredReturnVersion, weeeDeliveredAmount); }
public void AddEeeOutputAmount(DataReturnVersion dataReturnVersion, EeeOutputAmount eeeOutputAmount) { if (dataReturnVersion.EeeOutputReturnVersion == null) { dataReturnVersion.EeeOutputReturnVersion = CreateEeeOutputReturnVersion(); } AddEeeOutputAmount(dataReturnVersion.EeeOutputReturnVersion, eeeOutputAmount); }
public WeeeCollectedAmount CreateWeeeCollectedAmount(DataReturnVersion dataReturnVersion, string obligationType, int weeeCategory, decimal tonnage) { var weeeCollectedAmount = new WeeeCollectedAmount { Id = IntegerToGuid(GetNextId()), ObligationType = obligationType, Tonnage = tonnage, WeeeCategory = weeeCategory }; AddWeeeCollectedAmount(dataReturnVersion, weeeCollectedAmount); return(weeeCollectedAmount); }
public WeeeDeliveredAmount CreateWeeeDeliveredAmount(DataReturnVersion dataReturnVersion, AeDeliveryLocation location, string obligationType, int weeeCategory, decimal tonnage) { var weeeDeliveredAmount = new WeeeDeliveredAmount { Id = IntegerToGuid(GetNextId()), AeDeliveryLocationId = location.Id, AeDeliveryLocation = location, ObligationType = obligationType, Tonnage = tonnage, WeeeCategory = weeeCategory }; AddWeeeDeliveredAmount(dataReturnVersion, weeeDeliveredAmount); return(weeeDeliveredAmount); }
public WeeeDeliveredAmount CreateWeeeDeliveredAmount(DataReturnVersion dataReturnVersion, AeDeliveryLocation location, string obligationType, int weeeCategory, decimal tonnage) { var weeeDeliveredAmount = new WeeeDeliveredAmount { Id = IntegerToGuid(GetNextId()), AeDeliveryLocationId = location.Id, AeDeliveryLocation = location, ObligationType = obligationType, Tonnage = tonnage, WeeeCategory = weeeCategory }; AddWeeeDeliveredAmount(dataReturnVersion, weeeDeliveredAmount); return weeeDeliveredAmount; }
public WeeeCollectedAmount CreateWeeeCollectedAmount(DataReturnVersion dataReturnVersion, string obligationType, int weeeCategory, decimal tonnage) { var weeeCollectedAmount = new WeeeCollectedAmount { Id = IntegerToGuid(GetNextId()), ObligationType = obligationType, Tonnage = tonnage, WeeeCategory = weeeCategory }; AddWeeeCollectedAmount(dataReturnVersion, weeeCollectedAmount); return weeeCollectedAmount; }
public EeeOutputAmount CreateEeeOutputAmount(DataReturnVersion dataReturnVersion, RegisteredProducer registeredProducer, string obligationType, int weeeCategory, decimal tonnage) { var eeeOutputAmount = CreateEeeOutputAmount(registeredProducer, obligationType, weeeCategory, tonnage); AddEeeOutputAmount(dataReturnVersion, eeeOutputAmount); return eeeOutputAmount; }
public DataReturnVersion CreateDataReturnVersion(Scheme scheme, int complianceYear, int quarter, bool isSubmitted = true, DataReturn dataReturn = null, WeeeCollectedReturnVersion weeeCollectedReturnVersion = null) { if (dataReturn == null) { dataReturn = GetOrCreateDataReturn(scheme, complianceYear, quarter); } Guid dataReturnVersionId = IntegerToGuid(GetNextId()); var dataReturnVersion = new DataReturnVersion { Id = dataReturnVersionId, DataReturn = dataReturn, DataReturnId = dataReturn.Id, CreatedDate = DateTime.UtcNow }; if (isSubmitted) { dataReturnVersion.SubmittedDate = DateTime.UtcNow; dataReturnVersion.SubmittingUserId = GetOrCreateUser("Testuser").Id; dataReturn.CurrentDataReturnVersionId = dataReturnVersionId; dataReturn.CurrentDataReturnVersion = dataReturnVersion; } if (weeeCollectedReturnVersion != null) { dataReturnVersion.WeeeCollectedReturnVersion = weeeCollectedReturnVersion; } model.DataReturnVersions.Add(dataReturnVersion); return dataReturnVersion; }
public DataReturnUpload CreateDataReturnUpload(Scheme scheme, DataReturnVersion dataReturnVersion = null) { int dataReturnUploadId = GetNextId(); DataReturnUpload dataReturnUpload = new DataReturnUpload { Id = IntegerToGuid(dataReturnUploadId), SchemeId = scheme.Id, Scheme = scheme, Data = string.Format("<SchemeReturn{0} />", dataReturnUploadId), Date = DateTime.UtcNow, ProcessTime = TimeSpan.Zero }; if (dataReturnVersion != null) { dataReturnUpload.DataReturnVersionId = dataReturnVersion.Id; dataReturnUpload.DataReturnVersion = dataReturnVersion; if (dataReturnVersion.DataReturn != null) { dataReturnUpload.ComplianceYear = dataReturnVersion.DataReturn.ComplianceYear; dataReturnUpload.Quarter = dataReturnVersion.DataReturn.Quarter; } } model.DataReturnUploads.Add(dataReturnUpload); return dataReturnUpload; }