public void SetUp() { this.transactionScope = new TransactionScope(); this.authoriseHistoryRepository = new AuthoriseHistoryRepository(ConfigurationManager.ConnectionStrings["BBOS"].ConnectionString); this.jobRepository = new JobRepository(ConfigurationManager.ConnectionStrings["BBOS"].ConnectionString); this.job = BuildMeA.Job(DateTime.Now, DateTime.Now, DateTime.Now, "jwelkjwejwe", "grid"); this.managementCompany = BuildMeA.ManagementCompany("manconame", "mancocode", "mancoshortname", "rufudbid"); this.manCoDoc = BuildMeA.ManCoDoc(2, 3, "Pub file name", "version", 2); this.parentCompany = BuildMeA.ParentCompany("parent company name"); this.managementCompany.ParentCompany = this.parentCompany; this.user = BuildMeA.ApplicationUser("user"); this.job.User = this.user; }
private Int32 SaveJob( String userId, Boolean requiresAdditionalSetUp, String fundInfo, String sortCode, String accountNumber, String chequeNumber, ManCoDoc mancoDoc, Int32 jobStatusTypeId) { Int32 jobId; try { String additionalInfo = String.Empty; if (requiresAdditionalSetUp) { var additionalSetupInfo = new AdditionalSetupInfo { AccountNumber = accountNumber, ChequeNumber = chequeNumber, SortCode = sortCode, FundInfo = fundInfo }; var xmlSerializer = new XmlSerializer(additionalSetupInfo.GetType()); var textWriter = new StringWriter(); xmlSerializer.Serialize(textWriter, additionalSetupInfo); additionalInfo = textWriter.ToString(); } jobId = this.jobRepository.InsertJob(mancoDoc.ManCoDocID, String.Empty, additionalInfo, userId, jobStatusTypeId); } catch (Exception e) { throw new DocProcessingException("Unable to insert job", e); } return(jobId); }
private SubmitFile SaveFiles( String manCo, String docTypeCode, IEnumerable <String> files, String inputPath, Int32 jobId, ManCoDoc mancoDoc, IList <EnvironmentServerEntity> enviroments) { foreach (var file in files) { try { this.inputFileRepository.InsertFile(file, inputPath, jobId, mancoDoc.ManCoDocID); } catch (Exception e) { throw new DocProcessingException("Unable to insert input file", e); } } var submitFile = new SubmitFile { JobID = jobId.ToString(), ManCoCode = manCo, DocType = docTypeCode, Environment = enviroments.Single().EnvironmentType, EnvironmentID = enviroments.Single().EnvironmentTypeId.ToString() }; return(submitFile); }
public GroupDataRightBuilder WithManCoDoc(ManCoDoc manCoDoc) { Instance.ManCoDoc = manCoDoc; return(this); }