public static void CreateDefaultPageTemplatesPerTeam(IConsoleRepository ConsoleRepository, TemplatedPage templatedPage, List <Team> teams, Template structureTemplate, Template holdingTemplate) { foreach (var team in teams) { SetPageTemplates(ConsoleRepository, templatedPage, structureTemplate, holdingTemplate, team); } }
public QuoteSheetModule(IConsoleRepository consoleRepository, ISubmissionModule submissionModule, IQuoteSheetData quotesheetData, ICurrentHttpContext httpContext) { this.ConsoleRepository = consoleRepository; this.SubmissionModule = submissionModule; this.QuoteSheetData = quotesheetData; this.HttpContext = httpContext; }
public TemplatesModule(IConsoleRepository consoleRepository, ILogHandler logHandler, ICurrentHttpContext currentHttpContext, IWebSiteModuleManager webSiteModuleManager) { this.LogHandler = logHandler; this.ConsoleRepository = consoleRepository; this.CurrentHttpContext = currentHttpContext; this.WebSiteModuleManager = webSiteModuleManager; }
public UnitOfWork(IConsoleRepository consoleRepository, IFileRepository fileRepository, IDatabaseRepository databaseRepository) { ConsoleRepository = consoleRepository; FileRepository = fileRepository; DatabaseRepository = databaseRepository; }
/// <summary> /// Initializes this instance. /// </summary> static void Initialize() { SystemRepository = Kernel.Get <ISystemRepository>(); ConsoleRepository = Kernel.Get <IConsoleRepository>(); Settings = Kernel.Get <IHyperValidatorSettings>(); HyperSpin = SystemRepository.Get(); ConsoleRepository.GameValidated += ConsoleRepository_GameValidated; ConsoleRepository.ValidationComplete += ConsoleRepository_ValidationComplete; }
public HomeController(ILogger <HomeController> logger, IGameRepository gameRepository, IGenreRepository genreRepository, IConsoleRepository consoleRepository, DataContext context) { _logger = logger; _gameRepository = gameRepository; _genreRepository = genreRepository; _consoleRepository = consoleRepository; _context = context; }
public MainPage() { this.InitializeComponent(); _consolerepository = ServiceFactory.Current.Create <IConsoleRepository>(); _viewmodel = MainViewModel.Current; _viewmodel.Consoles = _consolerepository.GetAll(); _viewmodel.Version = "Version: " + VERSION; this.DataContext = _viewmodel; Window.Current.CoreWindow.KeyUp += PageKeyStroke; GamePad.Current.ButtonChanged += GamePadChanged; GamePad.Current.Start(MainViewModel.Current.Dispatcher); }
public MainPage() { this.InitializeComponent(); _consolerepository = ServiceFactory.Current.Create<IConsoleRepository>(); _viewmodel = MainViewModel.Current; _viewmodel.Consoles = _consolerepository.GetAll(); _viewmodel.Version = "Version: " + VERSION; this.DataContext = _viewmodel; Window.Current.CoreWindow.KeyUp += PageKeyStroke; GamePad.Current.ButtonChanged += GamePadChanged; GamePad.Current.Start(MainViewModel.Current.Dispatcher); }
public GameController(IGameRepository gameRepository, IGenreRepository genreRepository, IConsoleRepository consoleRepository, DataContext context, IWebHostEnvironment webHostEnvironment, ILogger <GameController> logger ) { _gameRepository = gameRepository; _genreRepository = genreRepository; _consoleRepository = consoleRepository; _context = context; _webHostEnvironment = webHostEnvironment; _logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="SystemRepository" /> class. /// </summary> /// <param name="settings">The settings.</param> /// <param name="logger">The logger.</param> /// <param name="directoryUtility">The directory utility.</param> /// <param name="fileUtility">The file utility.</param> /// <param name="pathUtility">The path utility.</param> /// <param name="consoleRepository">The console repository.</param> public SystemRepository( IHyperValidatorSettings settings, ILogger logger, IDirectoryUtility directoryUtility, IFileUtility fileUtility, IPathUtility pathUtility, IConsoleRepository consoleRepository) { Settings = settings; Logger = logger; DirectoryUtility = directoryUtility; FileUtility = fileUtility; PathUtility = pathUtility; ConsoleRepository = consoleRepository; }
public static void Init(TestContext context) { GetMockSubscribeService(); GetMockCurrentHttpContext(); CreateBasicSubmission(); CreateComplexSubmission(); _container = new UnityContainer(); _container.AddNewExtension<EnterpriseLibraryCoreExtension>(); _logHandler = _container.Resolve<LogHandler>(); _consoleRepository = _container.Resolve<ConsoleRepository>(); var mockCurrentHttpContext = new Mock<CurrentHttpContext>(); var user = @"talbotdev\MurrayE"; user = user.Replace(@"\\", @"\"); mockCurrentHttpContext.Setup(h => h.CurrentUser).Returns(new GenericPrincipal(new GenericIdentity(user), null)); mockCurrentHttpContext.Setup(h => h.Context).Returns(MvcMockHelpers.FakeHttpContextWithSession()); }
public InsuredBusinessModule(IInsuredData insuredData, ILogHandler logHandler, IConsoleRepository consoleRepository) { _logHandler = logHandler; _insuredData = insuredData; _consoleRepository = consoleRepository; }
public static void SeedData(IConsoleRepository context) { var domainPrefix = global::Validus.Console.Properties.Settings.Default.DomainPrefix; var AG = new COB { Id = "AG", Narrative = "Direct - Property - Construction", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<COB>(AG); var AR = new COB { Id = "AR", Narrative = "Direct - Property - Rig", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<COB>(AR); var AT = new COB { Id = "AT", Narrative = "Direct - Property - Hull", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<COB>(AT); var CC = new COB { Id = "CC", Narrative = "Direct - Casualty - Construction", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<COB>(CC); var c = new COB { Id = "CA", Narrative = "Cargo", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<COB>(c); var c1 = new COB { Id = "AD", Narrative = "Direct - Property - Contingency", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<COB>(c1); var userWriter1 = new Underwriter { Name = "Alex Colquhoun", Code = "JAC", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<Underwriter>(userWriter1); var userWriter2 = new Underwriter { Name = "Alexandra Davies", Code = "AED", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<Underwriter>(userWriter2); var underWriter = new User { DomainLogon = domainPrefix + @"\defaultunderwriter", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now, UnderwriterCode = "AED" }; context.AddOrUpdate<User>(underWriter); var quoteSheetPerson = new User { DomainLogon = domainPrefix + @"\quoteSheetPerson", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now, UnderwriterCode = "AED" }; context.AddOrUpdate<User>(quoteSheetPerson); // Note - SubmissionStatus - SUBMITTED, QUOTED, FIRM ORDER, DECLINED, WITHDRAWN, ADDL INFO REQST, FIRM ORDER REQST, OTHER OFFICE var masterQuote = new Quote { AccountYear = 2013, COB = c, COBId = c.Id, Currency = "USD", //<??> //QuoteCreated = DateTime.Now, //QuoteLastModified = DateTime.Now, //QuoteLastModifiedBy = underWriter, //QuoteCreatedBy = underWriter, SubscribeReference = "ADC118440A110006", //"AJH105451C12", // Policy Ref SubmissionStatus = "SUBMITTED", EntryStatus = "PARTIAL", PolicyType = "NONMARINE", TechnicalPricingMethod = "MODEL", QuotedPremium = 25000, FacilityRef = "ADC118440A11", IsSubscribeMaster = true, InceptionDate = DateTime.Now, ExpiryDate = DateTime.Now.AddYears(1), QuoteExpiryDate = DateTime.Now.AddDays(30), //OriginatingOfficeId = "LON", MOA = "FA", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var q = new Quote { AccountYear = 2013, COB = c, COBId = c.Id, Currency = "USD", //<??> //QuoteCreated = DateTime.Now, //QuoteLastModified = DateTime.Now, //QuoteLastModifiedBy = underWriter, //QuoteCreatedBy = underWriter, SubscribeReference = "ADC118440A110006", SubmissionStatus = "QUOTED", EntryStatus = "PARTIAL", PolicyType = "NONMARINE", TechnicalPricingMethod = "MODEL", QuotedPremium = 60000, FacilityRef = "ADC118440A11", IsSubscribeMaster = false, InceptionDate = DateTime.Now, ExpiryDate = DateTime.Now.AddYears(1), QuoteExpiryDate = DateTime.Now.AddDays(30), //OriginatingOfficeId = "LON", MOA = "FA", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var q3 = new Quote { AccountYear = 2013, COB = c, COBId = c.Id, Currency = "USD", //<??> //QuoteCreated = DateTime.Now, //QuoteLastModified = DateTime.Now, //QuoteLastModifiedBy = underWriter, //QuoteCreatedBy = underWriter, SubscribeReference = "AJE125510B12", SubmissionStatus = "DECLINED", EntryStatus = "PARTIAL", PolicyType = "NONMARINE", TechnicalPricingMethod = "MODEL", QuotedPremium = 360000, FacilityRef = "ADC118440A11", IsSubscribeMaster = false, InceptionDate = DateTime.Now, ExpiryDate = DateTime.Now.AddYears(1), QuoteExpiryDate = DateTime.Now.AddDays(30), //OriginatingOfficeId = "LON", MOA = "FA", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var q4master = new Quote { AccountYear = 2013, COB = c, COBId = c.Id, Currency = "USD", //<??> //QuoteCreated = DateTime.Now, //QuoteLastModified = DateTime.Now, //QuoteLastModifiedBy = underWriter, //QuoteCreatedBy = underWriter, SubscribeReference = "AJE125510B12", SubmissionStatus = "SUBMITTED", EntryStatus = "PARTIAL", PolicyType = "NONMARINE", TechnicalPricingMethod = "MODEL", QuotedPremium = 100000, FacilityRef = "ADC118440A11", IsSubscribeMaster = true, InceptionDate = DateTime.Now, ExpiryDate = DateTime.Now.AddYears(1), QuoteExpiryDate = DateTime.Now.AddDays(30), //OriginatingOfficeId = "LON", MOA = "FA", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var q5 = new Quote { AccountYear = 2013, COB = c, COBId = c.Id, Currency = "USD", //<??> //QuoteCreated = DateTime.Now, //QuoteLastModified = DateTime.Now, //QuoteLastModifiedBy = underWriter, //QuoteCreatedBy = underWriter, SubscribeReference = "AJE125510B12", SubmissionStatus = "SUBMITTED", EntryStatus = "PARTIAL", PolicyType = "NONMARINE", TechnicalPricingMethod = "MODEL", QuotedPremium = 1000, FacilityRef = "ADC118440A11", IsSubscribeMaster = false, InceptionDate = DateTime.Now, ExpiryDate = DateTime.Now.AddYears(1), QuoteExpiryDate = DateTime.Now.AddDays(30), // OriginatingOfficeId = "LON", MOA = "FA", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var q6master = new Quote { AccountYear = 2013, COB = c, COBId = c.Id, Currency = "USD", //<??> //QuoteCreated = DateTime.Now, //QuoteLastModified = DateTime.Now, //QuoteLastModifiedBy = underWriter, //QuoteCreatedBy = underWriter, SubscribeReference = "AJY087986D12", SubmissionStatus = "SUBMITTED", EntryStatus = "PARTIAL", PolicyType = "NONMARINE", TechnicalPricingMethod = "MODEL", QuotedPremium = 890000, FacilityRef = "ADC118440A11", IsSubscribeMaster = true, InceptionDate = DateTime.Now, ExpiryDate = DateTime.Now.AddYears(1), QuoteExpiryDate = DateTime.Now.AddDays(30), //OriginatingOfficeId = "LON", MOA = "FA", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var q7master = new Quote { AccountYear = 2013, COB = c, COBId = c.Id, Currency = "USD", //<??> //QuoteCreated = DateTime.Now, //QuoteLastModified = DateTime.Now, //QuoteLastModifiedBy = underWriter, //QuoteCreatedBy = underWriter, SubscribeReference = "AJJ144268A12", SubmissionStatus = "ADDL INFO REQST", EntryStatus = "PARTIAL", PolicyType = "NONMARINE", TechnicalPricingMethod = "MODEL", QuotedPremium = 39000, FacilityRef = "ADC118440A11", IsSubscribeMaster = true, InceptionDate = DateTime.Now, ExpiryDate = DateTime.Now.AddYears(1), QuoteExpiryDate = DateTime.Now.AddDays(30), //OriginatingOfficeId = "LON", MOA = "FA", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var quoteSheet1 = new QuoteSheet { Title = "QS_1", Guid = Guid.NewGuid(), IssuedBy = quoteSheetPerson, IssuedDate = DateTime.Now.AddDays(-1), ObjectStore = "Underwriting", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var quoteSheet2 = new QuoteSheet { Title = "QS_2", Guid = Guid.NewGuid(), IssuedBy = quoteSheetPerson, IssuedDate = DateTime.Now.AddDays(-2), ObjectStore = "Underwriting", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var quoteSheet3 = new QuoteSheet { Title = "QS_2", Guid = Guid.NewGuid(), IssuedBy = quoteSheetPerson, IssuedDate = DateTime.Now.AddDays(-3), ObjectStore = "Underwriting", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var quoteSheet4 = new QuoteSheet { Title = "QS_2", Guid = Guid.NewGuid(), IssuedBy = quoteSheetPerson, IssuedDate = DateTime.Now.AddDays(-4), ObjectStore = "Underwriting", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var quoteSheet5 = new QuoteSheet { Title = "QS_2", Guid = Guid.NewGuid(), IssuedBy = quoteSheetPerson, IssuedDate = DateTime.Now.AddDays(-5), ObjectStore = "Underwriting", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var quoteSheet6 = new QuoteSheet { Title = "QS_2", Guid = Guid.NewGuid(), IssuedBy = quoteSheetPerson, IssuedDate = DateTime.Now.AddDays(-6), ObjectStore = "Underwriting", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var quoteSheet7 = new QuoteSheet { Title = "QS_2", Guid = Guid.NewGuid(), IssuedBy = quoteSheetPerson, IssuedDate = DateTime.Now.AddDays(-7), ObjectStore = "Underwriting", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var quoteSheet8 = new QuoteSheet { Title = "QS_2", Guid = Guid.NewGuid(), IssuedBy = quoteSheetPerson, IssuedDate = DateTime.Now.AddDays(-8), ObjectStore = "Underwriting", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var ov = new OptionVersion { Title = "Version 1", VersionNumber = 1, Quotes = new List<Quote> { q, masterQuote }, QuoteSheets = new List<QuoteSheet> { quoteSheet1, quoteSheet2, quoteSheet3, quoteSheet4, quoteSheet5, quoteSheet6 }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var ov2 = new OptionVersion { Title = "Version 2", VersionNumber = 2, Quotes = new List<Quote> { q3, q4master, q5 }, QuoteSheets = new List<QuoteSheet> { quoteSheet7, quoteSheet8 }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var ov3 = new OptionVersion { Title = "Version 3", VersionNumber = 1, Quotes = new List<Quote> { q6master }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var ov4 = new OptionVersion { Title = "Version 4", VersionNumber = 1, Quotes = new List<Quote> { q7master }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var o1 = new Option { Title = "Option 1", Comments = "There is a known issue with this technique where creating databases is not supported on SqlClient provider. Other providers may or may not support this functionality depending on implementation. In general, because of that it is recommended to use unwrapped connections when using DDL APIs (CreateDatabase, DeleteDatabase, DatabaseExists()) as demonstrated in the sample.", OptionVersions = new List<OptionVersion> { ov, ov2 }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var o2 = new Option { Title = "Option 2", Comments = "In order to efficiently manage tracing for the application we need to create a central factory class which will create ObjectContext instances for us. This is the place where we will create tracing provider connection and use it to instantiate ObjectContext. Assuming our Object Context class is called MyContainer, the factory class will be called MyContainerFactory and will have a method called CreateContext, so the usage becomes:", OptionVersions = new List<OptionVersion> { ov3 }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var o3 = new Option { Title = "Option 3", Comments = "Entity Framework/Code First feature released as part of Feature CTP 3 can work with any EF-enabled data provider. In addition to regular providers which target databases, it is possible to use wrapping providers which can add interesting functionality, such as caching and tracing. In this post I’m going to explain how to use EFTracingProvider to produce diagnostic trace of all SQL commands executed by EF in Code First.", OptionVersions = new List<OptionVersion> { ov4 }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var lon = new Office { Id = "LON", Name = "London", Title = "Talbot Underwriting Ltd", Footer = "Talbot Underwriting Ltd is Authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority.", Address = new Address { AddressLine1 = "60 Threadneedle Street", AddressLine2 = "", City = "London", ZipPostalCode = "EC2R 8HP", Country = "England", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var mia = new Office { Id = "MIA", Name = "Miami", Title = "Validus Reaseguros, Inc.", Address = new Address { AddressLine1 = "2601 South Bayshore Drive", AddressLine2 = "Suite 1850, Coconut Grove", City = "Miami", StateProvinceRegion = "Florida", ZipPostalCode = "33133", Country = "U.S.A.", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var lab = new Office { Id = "LAB", Name = "Labuan", Title = "Talbot Risk Services (Labuan) Pte Ltd", Address = new Address { AddressLine1 = "Brighton Place, Ground Floor,", AddressLine2 = "No. U0215, Jalan Bahasa,", City = "Labuan FT", Country = "Malaysia", ZipPostalCode = "87000", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var nyc = new Office { Id = "NYC", Name = "New York", Title = "Talbot Underwriting (US) Ltd. ", Address = new Address { AddressLine1 = "48 Wall Street 17th Floor", AddressLine2 = "", Country = "USA", StateProvinceRegion = "NY", City = "New York", ZipPostalCode = "10005", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var sng = new Office { Id = "SNG", Name = "Singapore", Title = "Talbot Risk Services Pte Ltd", Address = new Address { AddressLine1 = "8 Marina View #14-01", AddressLine2 = "Asia Square Tower 1", City = "Singapore", ZipPostalCode = "018960", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var dubai = new Office { Id = "DUB", Name = "Dubai", Title = "Talbot Underwriting (MENA) Ltd", Footer = "Underwriting Risk Services (Middle East) Ltd ('URSME') is authorised and regulated by the Dubai Financial Services Authority.", Address = new Address { AddressLine1 = "Dubai International Financial Centre", AddressLine2 = "Gate Village Building 10, Level 5", City = "Dubai", Country = "UAE", ZipPostalCode = "PO Box 506809", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var usrl = new Office { Id = "URS", Name = "URSL", Title = "Talbot Underwriting Risk Services Ltd", Footer = "Talbot Underwriting Risk Services Ltd is an appointed representative of Talbot Underwriting Ltd which is Authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority.", Address = new Address { AddressLine1 = "60 Threadneedle Street", AddressLine2 = "", City = "London", Country = "England", ZipPostalCode = "EC2R 8HP", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<Office>(lon); context.AddOrUpdate<Office>(mia); context.AddOrUpdate<Office>(lab); context.AddOrUpdate<Office>(nyc); context.AddOrUpdate<Office>(sng); context.AddOrUpdate<Office>(dubai); context.AddOrUpdate<Office>(usrl); //var userWriter1 = new Underwriter //{ // Name = "Alex Colquhoun", // Code = "JAC", // CreatedBy = "InitialSetup", // CreatedOn = DateTime.Now, // ModifiedBy = "InitialSetup", // ModifiedOn = DateTime.Now //}; //context.AddOrUpdate<Underwriter>(userWriter1); //userWriter2 = new Underwriter //{ // Name = "Alexandra Davies", // Code = "AED", // CreatedBy = "InitialSetup", // CreatedOn = DateTime.Now, // ModifiedBy = "InitialSetup", // ModifiedOn = DateTime.Now //}; //context.AddOrUpdate<Underwriter>(userWriter2); var submissionTypes = new List<SubmissionType> { new SubmissionType { Id = "EN", Title = "EN Submission" }, new SubmissionType { Id = "PV", Title = "PV Submission" }, new SubmissionType { Id = "FI", Title = "FI Submission" }, new SubmissionType { Id = "CA", Title = "CA Submission" }, new SubmissionType { Id = "HM", Title = "HM Submission" }, new SubmissionType { Id = "ME", Title = "ME Submission" }, }; foreach (var submissionType in submissionTypes) { context.AddOrUpdate<SubmissionType>(submissionType); } var submission = new Submission { CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now, InsuredName = "- N/A", BrokerCode = "1111", BrokerPseudonym = "AAA", BrokerSequenceId = 822, InsuredId = 182396, Brokerage = 1, BrokerContact = "ALLAN MURRAY", UnderwriterCode = "AED", UnderwriterContactCode = "JAC", QuotingOfficeId = "LON", Leader = "AG", Domicile = "AD", Title = "Seed Submission", SubmissionTypeId = submissionTypes[0].Id, Options = new List<Option>{ new Option { CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now, Id = 1, Title = "Seed Submission", OptionVersions = new List<OptionVersion>{ new OptionVersion { OptionId = 0, VersionNumber = 0, Comments = "OptionVersion Comments", Title = "Unit Test Submission", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now, Quotes = new List<Quote> { new Quote { COBId = "AD", MOA = "FA", InceptionDate = DateTime.Now, ExpiryDate = DateTime.Now.AddMonths(12), QuoteExpiryDate = DateTime.Now, AccountYear = 2013, Currency = "USD", LimitCCY = "USD", ExcessCCY = "USD", CorrelationToken = Guid.NewGuid(), IsSubscribeMaster = true, PolicyType = "NONMARINE", EntryStatus = "PARTIAL", SubmissionStatus = "SUBMITTED", TechnicalPricingBindStatus = "PRE", TechnicalPricingPremiumPctgAmt = "AMT", TechnicalPricingMethod = "UW" , OriginatingOfficeId = "LON", //Energy_QuoteExtraProperty1 = "Seed Val...", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now } } }} }} }; context.AddOrUpdate<Submission>(submission); var addUser1 = new User { DomainLogon = domainPrefix + @"\DaviesA", IsActive = true, UnderwriterCode = "AED", PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; ////developers var globalTim = new User { DomainLogon = domainPrefix + @"\tim", IsActive = true, AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, AdditionalUsers = new List<User> { addUser1 }, OpenTabs = new List<Tab> { new Tab { Url = "/Submission/CreateSubmission", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, new Tab { Url = "/Submission/_Edit/1", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now } }, UnderwriterCode = "AED", PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<User>(globalTim); var u2 = new User { DomainLogon = domainPrefix + @"\baillief", IsActive = true, FilterCOBs = new List<COB> { c, c1 }, FilterOffices = new List<Office> { lon }, UnderwriterCode = "AED", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, AdditionalUsers = new List<User> { addUser1 }, OpenTabs = new List<Tab> { new Tab { Url = "/Submission/CreateSubmission", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, new Tab { Url = "/Submission/_Edit/1", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now } }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<User>(u2); var u6 = new User { DomainLogon = @"TALBOTDEV\svcUKDEVTFSBuild", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, AdditionalUsers = new List<User> { addUser1 }, UnderwriterCode = "AED", IsActive = true, OpenTabs = new List<Tab> { new Tab { Url = "/Submission/CreateSubmission", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, new Tab { Url = "/Submission/_Edit/1", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now } }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; u6.FilterMembers = new List<User> { u6 }; context.AddOrUpdate<User>(u6); var u5 = new User { DomainLogon = @"GLOBALDEV\anandarr", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, AdditionalUsers = new List<User> { addUser1 }, IsActive = true, UnderwriterCode = "AED", OpenTabs = new List<Tab> { new Tab { Url = "/Submission/CreateSubmission", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, new Tab { Url = "/Submission/_Edit/1", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now } }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; u5.FilterMembers = new List<User> { u5 }; context.AddOrUpdate<User>(u5); var u4 = new User { DomainLogon = domainPrefix + @"\SheppaA", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, AdditionalUsers = new List<User> { addUser1 }, IsActive = true, OpenTabs = new List<Tab> { new Tab { Url = "/Submission/CreateSubmission", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, new Tab { Url = "/Submission/_Edit/1", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now } }, UnderwriterCode = "AED", PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; u4.FilterMembers = new List<User> { u4 }; context.AddOrUpdate<User>(u4); var u3 = new User { DomainLogon = domainPrefix + @"\MurrayE", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, AdditionalUsers = new List<User> { addUser1 }, IsActive = true, OpenTabs = new List<Tab> { new Tab { Url = "/Submission/CreateSubmission", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, new Tab { Url = "/Submission/_Edit/1", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now } }, UnderwriterCode = "AED", PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var u = new User { DomainLogon = domainPrefix + @"\seigelj", IsActive = true, FilterCOBs = new List<COB> { AR, AG, CC, AT }, FilterOffices = new List<Office> { lon, mia, sng, lab, nyc }, FilterMembers = new List<User> { u2, u4, u3, u5, u6, globalTim }, OpenTabs = new List<Tab> { new Tab { Url = "/Submission/CreateSubmission", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, new Tab { Url = "/Submission/_Edit/1", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now } }, UnderwriterCode = "AED", PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<User>(u); u2.AdditionalUsers = new List<User> { u }; // Energy var energyUser1 = new User { DomainLogon = domainPrefix + @"\McDonaldJ", IsActive = true, UnderwriterCode = "AED", FilterCOBs = new List<COB> { AR, AG, CC, AT }, FilterOffices = new List<Office> { lon, mia, sng, lab, nyc }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser2 = new User { DomainLogon = domainPrefix + @"\sarjeat", IsActive = true, UnderwriterCode = "AED", FilterCOBs = new List<COB> { AR, AG, CC, AT }, FilterOffices = new List<Office> { lon, mia, sng, lab, nyc }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser3 = new User { DomainLogon = domainPrefix + @"\MassieZ", IsActive = true, UnderwriterCode = "AED", FilterCOBs = new List<COB> { AR, AG, CC, AT }, FilterOffices = new List<Office> { lon, mia, sng, lab, nyc }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser4 = new User { DomainLogon = domainPrefix + @"\CantwellJ", IsActive = true, UnderwriterCode = "AED", FilterCOBs = new List<COB> { AR, AG, CC, AT }, FilterOffices = new List<Office> { lon, mia, sng, lab, nyc }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser5 = new User { DomainLogon = domainPrefix + @"\GreenM", IsActive = true, UnderwriterCode = "AED", FilterCOBs = new List<COB> { AR, AG, CC, AT }, FilterOffices = new List<Office> { lon, mia, sng, lab, nyc }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser6 = new User { DomainLogon = domainPrefix + @"\EwingtonJ", IsActive = true, UnderwriterCode = "AED", FilterCOBs = new List<COB> { AR, AG, CC, AT }, FilterOffices = new List<Office> { lon, mia, sng, lab, nyc }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser7 = new User { DomainLogon = domainPrefix + @"\ShilingS", IsActive = true, UnderwriterCode = "AED", FilterCOBs = new List<COB> { AR, AG, CC, AT }, FilterOffices = new List<Office> { lon, mia, sng, lab, nyc }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser8 = new User { DomainLogon = domainPrefix + @"\GarrettJ", IsActive = true, UnderwriterCode = "AED", FilterCOBs = new List<COB> { AR, AG, CC, AT }, FilterOffices = new List<Office> { lon, mia, sng, lab, nyc }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser9 = new User { DomainLogon = domainPrefix + @"\StoopE", IsActive = true, UnderwriterCode = "AED", FilterCOBs = new List<COB> { AR, AG, CC, AT }, FilterOffices = new List<Office> { lon, mia, sng, lab, nyc }, PrimaryOffice = lon, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser10 = new User { DomainLogon = domainPrefix + @"\KeoganA", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, IsActive = true, PrimaryOffice = lon, UnderwriterCode = "AED", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser11 = new User { DomainLogon = domainPrefix + @"\ShawI", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, IsActive = true, PrimaryOffice = lon, UnderwriterCode = "AED", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser12 = new User { DomainLogon = domainPrefix + @"\IsmailR", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, IsActive = true, PrimaryOffice = lon, UnderwriterCode = "AED", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser13 = new User { DomainLogon = domainPrefix + @"\SibleyA", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, IsActive = true, PrimaryOffice = lon, UnderwriterCode = "AED", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser14 = new User { DomainLogon = domainPrefix + @"\DaviesK", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, IsActive = true, PrimaryOffice = lon, UnderwriterCode = "AED", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser15 = new User { DomainLogon = domainPrefix + @"\orsoc", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, IsActive = true, PrimaryOffice = lon, UnderwriterCode = "AED", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyUser16 = new User { DomainLogon = domainPrefix + @"\dempsef", AdditionalOffices = new List<Office> { lon, mia, sng, lab, nyc }, IsActive = true, PrimaryOffice = lon, UnderwriterCode = "AED", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now };//, FilterCOBs = energyCobs }; var energyTeamUsersList = new List<User> { energyUser1, energyUser2, energyUser3, energyUser4, energyUser5, energyUser6, energyUser7, energyUser8, energyUser9, energyUser10, energyUser11, energyUser12, energyUser13, energyUser14, energyUser15, energyUser16 }; // TeamList and Link List var linkList = CreateLinksList(); var teamList = CreateTeamList(submissionTypes); teamList[0].Links = new List<Link>(); foreach (var link in linkList.GetRange(0, 3)) { teamList[0].Links.Add(link); } teamList[1].Links = new List<Link>(); foreach (var link in linkList) { teamList[1].Links.Add(link); } var appAccelerators = CreateAppAcceleratorsList(); teamList[0].AppAccelerators = new List<AppAccelerator>(); foreach (var appAccelerator in appAccelerators) { teamList[0].AppAccelerators.Add(appAccelerator); } teamList[1].AppAccelerators = new List<AppAccelerator>(); foreach (var appAccelerator in appAccelerators) { teamList[1].AppAccelerators.Add(appAccelerator); } teamList[0].RelatedOffices = new List<Office> { lon }; teamList[1].RelatedOffices = new List<Office> { dubai }; teamList[0].TeamOfficeSettings = new List<TeamOfficeSetting> { new TeamOfficeSetting { Office = lon, MarketWordingSettings = new List<MarketWordingSetting>(), TermsNConditionWordingSettings = new List<TermsNConditionWordingSetting>(), SubjectToClauseWordingSettings = new List<SubjectToClauseWordingSetting>() } }; teamList[1].TeamOfficeSettings = new List<TeamOfficeSetting> { new TeamOfficeSetting { Office = dubai, MarketWordingSettings = new List<MarketWordingSetting>(), TermsNConditionWordingSettings = new List<TermsNConditionWordingSetting>(), SubjectToClauseWordingSettings = new List<SubjectToClauseWordingSetting>() } }; var marketWordings = CreateMarketWordingsList(); foreach (var marketWording in marketWordings.Take(10)) { teamList[0].TeamOfficeSettings.First().MarketWordingSettings.Add(new MarketWordingSetting { MarketWording = marketWording }); } foreach (var marketWording in marketWordings.Skip(10).Take(10)) { teamList[1].TeamOfficeSettings.First().MarketWordingSettings.Add(new MarketWordingSetting { MarketWording = marketWording }); } foreach (var marketWording in marketWordings.Skip(20)) { context.AddOrUpdate(marketWording); } var termsNConditionWordings = CreateTermsNConditionWordingsList(); foreach (var termsNConditionWording in termsNConditionWordings.Take(5)) { teamList[0].TeamOfficeSettings.First().TermsNConditionWordingSettings.Add(new TermsNConditionWordingSetting { TermsNConditionWording = termsNConditionWording }); } foreach (var termsNConditionWording in termsNConditionWordings.Take(5)) { teamList[1].TeamOfficeSettings.First().TermsNConditionWordingSettings.Add(new TermsNConditionWordingSetting { TermsNConditionWording = termsNConditionWording }); } foreach (var termsNConditionWording in termsNConditionWordings.Take(5)) { context.AddOrUpdate(termsNConditionWording); } var subjectToClauseWordings = CreateSubjectToClauseWordingsList(); foreach (var subjectToClauseWording in subjectToClauseWordings.Take(5)) { teamList[0].TeamOfficeSettings.First().SubjectToClauseWordingSettings.Add(new SubjectToClauseWordingSetting { SubjectToClauseWording = subjectToClauseWording }); } foreach (var subjectToClauseWording in subjectToClauseWordings.Take(5)) { teamList[1].TeamOfficeSettings.First().SubjectToClauseWordingSettings.Add(new SubjectToClauseWordingSetting { SubjectToClauseWording = subjectToClauseWording }); } foreach (var subjectToClauseWording in subjectToClauseWordings.Take(5)) { context.AddOrUpdate(subjectToClauseWording); } var energyTeamMemberships = energyTeamUsersList.Select(energyTeamUser => new TeamMembership { PrimaryTeamMembership = true, User = energyTeamUser, Team = teamList[1], IsCurrent = true, StartDate = DateTime.Now, EndDate = null, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }).ToList(); energyTeamMemberships.Add(new TeamMembership { PrimaryTeamMembership = false, Team = teamList[1], User = u5, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }); var teamMemberships = new List<TeamMembership> { new TeamMembership { User = u3, Team = teamList[0], IsCurrent = true, StartDate = DateTime.Now, EndDate = DateTime.Now.AddYears(4), CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, }; var memb1 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = u, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var memb3 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = u4, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var memb2 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = u2, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var memb5 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = u5, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var memb6 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = u6, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var memb4 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = globalTim, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; teamList[0].RelatedCOBs = new List<COB> { AR, AG, CC, AT }; teamList[1].RelatedCOBs = new List<COB> { AR, AG, CC, AT }; teamList[0].Memberships = new List<TeamMembership> { memb1, memb2, memb4, memb3, memb5, memb6 }; foreach (var teamM in teamMemberships) { teamList[0].Memberships.Add(teamM); } teamList[1].Memberships = new List<TeamMembership>(); foreach (var energyTeamMembership in energyTeamMemberships) { teamList[1].Memberships.Add(energyTeamMembership); } foreach (var team in teamList) { context.AddOrUpdate<Team>(team); } }
// ReSharper restore InconsistentNaming protected TeamSetup(IConsoleRepository consoleRepository) { _consoleRepository = consoleRepository; }
public MarineSetup(IConsoleRepository consoleRepository) : base(consoleRepository) { }
public ConsoleController() { _consoleRepository = new ConsoleRepository(new AssistantContext()); }
public Construction(IConsoleRepository consoleRepository) : base(consoleRepository) { }
public Contingency(IConsoleRepository consoleRepository) : base(consoleRepository) { }
public RiskCodeModuleManager(IConsoleRepository rep, ILogHandler logHandler) { _repository = rep; _logHandler = logHandler; }
public HullSetup(IConsoleRepository consoleRepository): base(consoleRepository) { }
public AccidentnHealth(IConsoleRepository consoleRepository) : base(consoleRepository) { }
public CargoSetup(IConsoleRepository consoleRepository) : base(consoleRepository) { }
public PoliticalRisk(IConsoleRepository consoleRepository) : base(consoleRepository) { }
public HomeController(IConsoleRepository consoleRepository) { _consoleRepository = consoleRepository; }
public BrokerData(IConsoleRepository repository, IBrokerService brokerService, ILogHandler logHandler) { this.LogHandler = logHandler; this.BrokerService = brokerService; this._repository = repository; }
public static RequiredDataUserDto GetRequiredDataEditUser(string userName, IConsoleRepository _consoleRepository) { var requiredDataDto = new RequiredDataUserDto(); using (_consoleRepository) { var user = _consoleRepository.Query<User>(u => u.FilterCOBs, u => u.FilterOffices, u => u.FilterMembers, u => u.AdditionalCOBs, u => u.AdditionalOffices, u => u.AdditionalUsers, u => u.OpenTabs, u => u.TeamMemberships.Select(t => t.Team), u => u.DefaultOrigOffice, u => u.DefaultUW, u => u.Underwriter, u => u.DefaultUW.Underwriter).FirstOrDefault(u => u.DomainLogon == userName); if (user == null) throw new Exception("User not Found"); // TODO: throw new NullReferenceException(user) var allTeams = _consoleRepository.Query<Team>().Select(t => t).ToList(); var currentUserTeamMemberships = _consoleRepository.Query<TeamMembership>() .Where(tm => tm.User.DomainLogon.Contains(userName) && tm.IsCurrent) .Select(t => t.Team) .ToList(); var allTeamMemberships = allTeams.Except(currentUserTeamMemberships).Select(t => { // Create a new empty team Membership return new TeamMembershipDto { Id = 0, Team = new TeamDto {Id = t.Id, Title = t.Title}, EndDate = null, StartDate = new DateTime() }; }).OrderBy(tm => tm.Team.Title).ToList(); // 2. Get AllFilterCOBs Except the ones that the user is already in var currentFilterCOBs = user.FilterCOBs.Select(fc => fc); var allFilterCOBs = _consoleRepository.Query<COB>().ToList().Except(currentFilterCOBs).Select(c => { return new COBDto { Id = c.Id, Narrative = c.Narrative }; }).OrderBy(cob => cob.Narrative).ToList(); // 3. AllFilterOffices var currentFilterOffices = user.FilterOffices.Select(fo => fo); var allFilterOffices = _consoleRepository.Query<Office>().ToList().Except(currentFilterOffices).Select(o => { return new OfficeDto { Id = o.Id, Title = o.Name }; }).OrderBy(o => o.Title).ToList(); // 4. AllFilterMembers var currentFilterMembers = user.FilterMembers.Select(fm => fm); var allFilterMembers = _consoleRepository.Query<User>().ToList().Except(currentFilterMembers).Select(u => { return new UserDto { Id = u.Id, DomainLogon = u.DomainLogon }; }).OrderBy(u => u.DomainLogon).ToList(); // 5. AllAdditionalCOBs var currentAdditionalCOBs = user.AdditionalCOBs.Select(ac => ac); var allAdditionalCOBs = _consoleRepository.Query<COB>().ToList().Except(currentAdditionalCOBs).Select(c => { return new COBDto { Id = c.Id, Narrative = c.Narrative }; }).OrderBy(cob => cob.Narrative).ToList(); // 6. AllAdditionalOffices var currentAdditionalOffices = user.AdditionalOffices.Select(ao => ao); var allAdditionalOffices = _consoleRepository.Query<Office>().ToList().Except(currentAdditionalOffices).Select(o => { return new OfficeDto { Id = o.Id, Title = o.Name }; }).OrderBy(o => o.Title).ToList(); // 7. AllAdditionalUsers var currentAdditionalUsers = user.AdditionalUsers.Select(au => au); var allAdditionalUsers = _consoleRepository.Query<User>().ToList().Except(currentAdditionalUsers).Select(u => { return new UserDto { Id = u.Id, DomainLogon = u.DomainLogon }; }).OrderBy(u => u.DomainLogon).ToList(); requiredDataDto.AllTeamMemberships = allTeamMemberships; requiredDataDto.AllFilterCOBs = allFilterCOBs; requiredDataDto.AllFilterOffices = allFilterOffices; requiredDataDto.AllFilterMembers = allFilterMembers; requiredDataDto.AllAdditionalCOBs = allAdditionalCOBs; requiredDataDto.AllAdditionalOffices = allAdditionalOffices; requiredDataDto.AllAdditionalUsers = allAdditionalUsers; } return requiredDataDto; }
private static void SaveTestSubmission(IConsoleRepository consoleRepository) { var submission = new globalVM::Validus.Models.SubmissionEN { CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now, InsuredName = "- N/A", BrokerCode = "1111", BrokerPseudonym = "AAA", BrokerSequenceId = 822, InsuredId = 182396, Brokerage = 1, BrokerContact = "ALLAN MURRAY", UnderwriterCode = "AED", UnderwriterContactCode = "JAC", QuotingOfficeId = "LON", Leader = "AG", Domicile = "AD", Title = "Unit Test Submission", Options = new List<Option> { new Option { Id = 1, Title = "Unit Test Submission", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now, OptionVersions = new List<OptionVersion> { new OptionVersion { OptionId = 0, VersionNumber = 0, Comments = "OptionVersion Comments", Title = "Unit Test Submission", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now, Quotes = new List<Quote> { new QuoteEN { COBId = "AD", MOA = "FA", InceptionDate = DateTime.Now, ExpiryDate = DateTime.Now.AddMonths(12), QuoteExpiryDate = DateTime.Now, AccountYear = 2013, Currency = "USD", LimitCCY = "USD", ExcessCCY = "USD", CorrelationToken = Guid.NewGuid(), IsSubscribeMaster = true, PolicyType = "NONMARINE", EntryStatus = "PARTIAL", SubmissionStatus = "SUBMITTED", TechnicalPricingBindStatus = "PRE", TechnicalPricingPremiumPctgAmt = "AMT", TechnicalPricingMethod = "UW", CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now, OriginatingOfficeId = "LON", } } } } } } }; var savedSubmission = consoleRepository.Add(submission); consoleRepository.SaveChanges(); _submissionId = savedSubmission.Id; }
public InterestModuleManager(IConsoleRepository rep, ILogHandler logHandler) { _repository = rep; _logHandler = logHandler; }
public BrokerModuleManager(IBrokerData brokerData, ILogHandler logHandler, IConsoleRepository ConsoleRepository) { _logHandler = logHandler; _brokerData = brokerData; _consoleRepository = ConsoleRepository; }
public WebSiteModuleManager(IConsoleRepository repository, ICurrentHttpContext currentHttpContext) { _repository = repository; _currentHttpContext = currentHttpContext; }
public CollectionService(IInventoryRepository inventory = null, IConsoleRepository console = null) { _inventory = inventory ?? new InventoryRepository(); _console = console ?? new ConsoleRepository(); }
public AdditionalCoverageCodeModuleManager(IConsoleRepository rep, ILogHandler logHandler) { _repository = rep; _logHandler = logHandler; }
private static void SetUserDto(UserDto userDto, User user, IConsoleRepository _consoleRepository) { userDto.Id = user.Id; userDto.DomainLogon = user.DomainLogon; userDto.IsActive = user.IsActive; // Currently Selected Values userDto.DefaultOrigOffice = (user.DefaultOrigOffice != null) ? new OfficeDto { Id = user.DefaultOrigOffice.Id, Title = user.DefaultOrigOffice.Name } : null; userDto.PrimaryOffice = (user.PrimaryOffice != null) ? new OfficeDto { Id = user.PrimaryOffice.Id, Title = user.PrimaryOffice.Name } : null; userDto.DefaultUW = (user.DefaultUW != null) ? new UserDto { Id = user.DefaultUW.Id, DomainLogon = user.DefaultUW.DomainLogon } : null; userDto.UnderwriterId = user.UnderwriterCode; userDto.NonLondonBroker = user.NonLondonBroker; OfficeDto officeDto = null; var officeList = _consoleRepository.Query<Office>().ToList(); if (user.DefaultOrigOffice != null) { var defaultOrigOfficeList = new List<OfficeDto>(); defaultOrigOfficeList.Add(userDto.DefaultOrigOffice); defaultOrigOfficeList.AddRange( officeList.Where(o => o.Id != userDto.DefaultOrigOffice.Id) .Select(o => new OfficeDto {Title = o.Name, Id = o.Id} )); userDto.DefaultOrigOfficeList = defaultOrigOfficeList.OrderBy(o=>o.Title).ToList(); } if (user.PrimaryOffice != null) { var primaryOfficeList = new List<OfficeDto>(); primaryOfficeList.Add(userDto.PrimaryOffice); primaryOfficeList.AddRange( officeList.Where(o => o.Id != userDto.PrimaryOffice.Id) .Select(o => new OfficeDto() { Id = o.Id, Title = o.Name })); userDto.PrimaryOfficeList = primaryOfficeList.OrderBy(o => o.Title).ToList(); } if (userDto.DefaultOrigOfficeList == null || userDto.PrimaryOfficeList == null) { var officeDtoList = officeList.ToList().Select(o => { return new OfficeDto { Id = o.Id, Title = o.Name }; }).OrderBy(o => o.Title).ToList(); if (userDto.DefaultOrigOfficeList == null) userDto.DefaultOrigOfficeList = officeDtoList; if (userDto.PrimaryOfficeList == null) userDto.PrimaryOfficeList = officeDtoList; } if (userDto.DefaultUW != null) { var defaultUWDtoList = new List<UserDto>(); defaultUWDtoList.Add(userDto.DefaultUW); UserDto defaultUW = null; defaultUWDtoList.AddRange(_consoleRepository.Query<User>().OrderBy(u=>u.DomainLogon).ToList().Select(u => { if (u.Id != userDto.DefaultUW.Id) defaultUW = new UserDto { Id = u.Id, DomainLogon = u.DomainLogon }; return defaultUW; }).ToList()); userDto.DefaultUWList = defaultUWDtoList; } if (userDto.DefaultUW == null) { var defaultUWDtoList = _consoleRepository.Query<User>().OrderBy(u => u.DomainLogon).ToList().Select(u => { return new UserDto { Id = u.Id, DomainLogon = u.DomainLogon }; }).ToList(); userDto.DefaultUWList = defaultUWDtoList; } userDto.TeamMemberships = (user.TeamMemberships != null && user.TeamMemberships.Any()) ? user.TeamMemberships.Where(m => m.IsCurrent).OrderBy(tm=>tm.Team.Title).ToList().ConvertAll(tm => new TeamMembershipDto { TeamId = tm.TeamId, EndDate = tm.EndDate, Id = tm.Id, PrimaryTeamMembership = tm.PrimaryTeamMembership, IsCurrent = tm.IsCurrent, StartDate = tm.StartDate, Team = new TeamDto { Id = tm.Team.Id, Title = tm.Team.Title, DefaultDomicile = tm.Team.DefaultDomicile, DefaultMOA = tm.Team.DefaultMOA, PricingActuary = tm.Team.PricingActuary, QuoteExpiryDaysDefault = tm.Team.QuoteExpiryDaysDefault, DefaultPolicyType = tm.Team.DefaultPolicyType } }) : null; userDto.AdditionalUsers = (user.AdditionalUsers != null && user.AdditionalUsers.Any()) ? user.AdditionalUsers.OrderBy(u=>u.DomainLogon).ToList() .ConvertAll(ad => new UserDto { Id = ad.Id, DomainLogon = ad.DomainLogon }) : null; userDto.AdditionalCOBs = (user.AdditionalCOBs != null && user.AdditionalCOBs.Any()) ? user.AdditionalCOBs.OrderBy(cob => cob.Narrative).ToList() .ConvertAll(cob => new COBDto { Id = cob.Id, Narrative = cob.Narrative }) : null; userDto.FilterCOBs = (user.FilterCOBs != null && user.FilterCOBs.Any()) ? user.FilterCOBs.OrderBy(cob => cob.Narrative).ToList() .ConvertAll(cob => new COBDto { Id = cob.Id, Narrative = cob.Narrative }) : null; userDto.AdditionalOffices = (user.AdditionalOffices != null && user.AdditionalOffices.Any()) ? user.AdditionalOffices.OrderBy(o => o.Name).ToList() .ConvertAll(o => new OfficeDto { Id = o.Id, Title = o.Name }) : null; userDto.FilterMembers = (user.FilterMembers != null && user.FilterMembers.Any()) ? user.FilterMembers.OrderBy(u => u.DomainLogon).ToList() .ConvertAll(fm => new UserDto { Id = fm.Id, DomainLogon = fm.DomainLogon }) : null; userDto.FilterOffices = (user.FilterOffices != null && user.FilterOffices.Any()) ? user.FilterOffices.OrderBy(o => o.Name).ToList() .ConvertAll(fo => new OfficeDto { Id = fo.Id, Title = fo.Name }) : null; var requiredData = GetRequiredDataEditUser(user.DomainLogon, _consoleRepository); userDto.AllAdditionalUsers = requiredData.AllAdditionalUsers; userDto.AllAdditionalCOBs = requiredData.AllAdditionalCOBs; userDto.AllAdditionalOffices = requiredData.AllAdditionalOffices; userDto.AllFilterCOBs = requiredData.AllFilterCOBs; userDto.AllFilterMembers = requiredData.AllFilterMembers; userDto.AllFilterOffices = requiredData.AllFilterOffices; userDto.AllTeamMemberships = requiredData.AllTeamMemberships; }
public AuditTrailModule(IConsoleRepository consoleRepository) { this.ConsoleRepository = consoleRepository; }
public PerilCodeModuleManager(IConsoleRepository rep, ILogHandler logHandler) { _repository = rep; _logHandler = logHandler; }
public static void SeedData(IConsoleRepository context) { var domainPrefix = global::Validus.Console.Properties.Settings.Default.DomainPrefix; var addUser1 = new User { DomainLogon = domainPrefix + @"\DaviesA", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; ////developers var globalTim = new User { DomainLogon = domainPrefix + @"\tim", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<User>(globalTim); var u2 = new User { DomainLogon = domainPrefix + @"\baillief", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<User>(u2); var u2b = new User { DomainLogon = @"globaldev\baillief", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<User>(u2b); var u6 = new User { DomainLogon = @"TALBOTDEV\svcUKDEVTFSBuild", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<User>(u6); var u5 = new User { DomainLogon = @"GLOBALDEV\anandarr", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<User>(u5); var u4 = new User { DomainLogon = domainPrefix + @"\SheppaA", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<User>(u4); var u3 = new User { DomainLogon = domainPrefix + @"\MurrayE", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var u = new User { DomainLogon = domainPrefix + @"\seigelj", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; context.AddOrUpdate<User>(u); // Energy var energyUser1 = new User { DomainLogon = domainPrefix + @"\McDonaldJ", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var energyUser2 = new User { DomainLogon = domainPrefix + @"\sarjeat", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser3 = new User { DomainLogon = domainPrefix + @"\MassieZ", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser4 = new User { DomainLogon = domainPrefix + @"\CantwellJ", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser5 = new User { DomainLogon = domainPrefix + @"\GreenM", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser6 = new User { DomainLogon = domainPrefix + @"\EwingtonJ", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser7 = new User { DomainLogon = domainPrefix + @"\ShilingS", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser8 = new User { DomainLogon = domainPrefix + @"\GarrettJ", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser9 = new User { DomainLogon = domainPrefix + @"\StoopE", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser10 = new User { DomainLogon = domainPrefix + @"\KeoganA", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser11 = new User { DomainLogon = domainPrefix + @"\ShawI", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser12 = new User { DomainLogon = domainPrefix + @"\IsmailR", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser13 = new User { DomainLogon = domainPrefix + @"\SibleyA", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser14 = new User { DomainLogon = domainPrefix + @"\DaviesK", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser15 = new User { DomainLogon = domainPrefix + @"\orsoc", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyUser16 = new User { DomainLogon = domainPrefix + @"\dempsef", IsActive = true, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; //, FilterCOBs = energyCobs }; var energyTeamUsersList = new List<User> { energyUser1, energyUser2, energyUser3, energyUser4, energyUser5, energyUser6, energyUser7, energyUser8, energyUser9, energyUser10, energyUser11, energyUser12, energyUser13, energyUser14, energyUser15, energyUser16 }; // TeamList and Link List var linkList = CreateLinksList(); var teamList = CreateTeamList(); teamList[0].Links = new List<Link>(); foreach (var link in linkList.GetRange(0, 3)) { teamList[0].Links.Add(link); } teamList[1].Links = new List<Link>(); foreach (var link in linkList) { teamList[1].Links.Add(link); } var energyTeamMemberships = energyTeamUsersList.Select( energyTeamUser => new TeamMembership { PrimaryTeamMembership = true, User = energyTeamUser, Team = teamList[1], IsCurrent = true, StartDate = DateTime.Now, EndDate = null, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }).ToList(); energyTeamMemberships.Add(new TeamMembership { PrimaryTeamMembership = false, Team = teamList[1], User = u5, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }); var teamMemberships = new List<TeamMembership> { new TeamMembership { User = u3, Team = teamList[0], IsCurrent = true, StartDate = DateTime.Now, EndDate = DateTime.Now.AddYears(4), CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }, }; var memb1 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = u, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var memb3 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = u4, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var memb2 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = u2, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var memb5 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = u5, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var memb6 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = u6, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; var memb4 = new TeamMembership { PrimaryTeamMembership = true, Team = teamList[0], User = globalTim, StartDate = DateTime.Now, CreatedBy = "InitialSetup", CreatedOn = DateTime.Now, ModifiedBy = "InitialSetup", ModifiedOn = DateTime.Now }; teamList[0].Memberships = new List<TeamMembership> {memb1, memb2, memb4, memb3, memb5, memb6}; foreach (var teamM in teamMemberships) { teamList[0].Memberships.Add(teamM); } teamList[1].Memberships = new List<TeamMembership>(); foreach (var energyTeamMembership in energyTeamMemberships) { teamList[1].Memberships.Add(energyTeamMembership); } foreach (var team in teamList) { context.AddOrUpdate<Team>(team); } var templates = CreateTemplates(); foreach (var template in templates) { context.Add<Template>(template); } var templatedPages = CreateTemplatedPages(); foreach (var siteSection in templatedPages) { context.Add<TemplatedPage>(siteSection); } var pageTemplates = CreatePageTemplates(teamList, templates, templatedPages); foreach (var pageTemplate in pageTemplates) { context.Add<PageTemplate>(pageTemplate); } }
public static void CreateDefaultPageTemplatesPerTeam(IConsoleRepository ConsoleRepository, TemplatedPage templatedPage, List<Team> teams, Template structureTemplate, Template holdingTemplate) { foreach (var team in teams) { SetPageTemplates(ConsoleRepository, templatedPage, structureTemplate, holdingTemplate, team); } }
public static void SetPageTemplates(IConsoleRepository ConsoleRepository, TemplatedPage templatedPage, Template structureTemplate, Template holdingTemplate, Team team) { var pageStructureTemplate = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = structureTemplate, PageSectionId = 0 }; ConsoleRepository.Add<PageTemplate>(pageStructureTemplate); var holdingTempl_1 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 1 }; ConsoleRepository.Add<PageTemplate>(holdingTempl_1); var holdingTempl_2 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 2 }; ConsoleRepository.Add<PageTemplate>(holdingTempl_2); var holdingTempl_3 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 3 }; ConsoleRepository.Add<PageTemplate>(holdingTempl_3); var holdingTempl_4 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 4 }; ConsoleRepository.Add<PageTemplate>(holdingTempl_4); var holdingTempl_5 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 5 }; ConsoleRepository.Add<PageTemplate>(holdingTempl_5); var holdingTempl_6 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 6 }; ConsoleRepository.Add<PageTemplate>(holdingTempl_6); var holdingTempl_7 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 7 }; ConsoleRepository.Add<PageTemplate>(holdingTempl_7); var holdingTempl_8 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 8 }; ConsoleRepository.Add<PageTemplate>(holdingTempl_8); }
public CrisisManagement(IConsoleRepository consoleRepository) : base(consoleRepository) { }
public ConsoleController(IConsoleRepository consoleRepository, ILogger <ConsoleController> logger, DataContext context) { _consoleRepository = consoleRepository; _logger = logger; }
public PolicyData(IConsoleRepository repository, ICurrentHttpContext currentHttpContext, ILogHandler logHandler) { this._currentHttpContext = currentHttpContext; this._repository = repository; this._logHandler = logHandler; }
public static void SetPageTemplates(IConsoleRepository ConsoleRepository, TemplatedPage templatedPage, Template structureTemplate, Template holdingTemplate, Team team) { var pageStructureTemplate = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = structureTemplate, PageSectionId = 0 }; ConsoleRepository.Add <PageTemplate>(pageStructureTemplate); var holdingTempl_1 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 1 }; ConsoleRepository.Add <PageTemplate>(holdingTempl_1); var holdingTempl_2 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 2 }; ConsoleRepository.Add <PageTemplate>(holdingTempl_2); var holdingTempl_3 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 3 }; ConsoleRepository.Add <PageTemplate>(holdingTempl_3); var holdingTempl_4 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 4 }; ConsoleRepository.Add <PageTemplate>(holdingTempl_4); var holdingTempl_5 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 5 }; ConsoleRepository.Add <PageTemplate>(holdingTempl_5); var holdingTempl_6 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 6 }; ConsoleRepository.Add <PageTemplate>(holdingTempl_6); var holdingTempl_7 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 7 }; ConsoleRepository.Add <PageTemplate>(holdingTempl_7); var holdingTempl_8 = new PageTemplate { IsVisible = true, Team = team, TemplatedPage = templatedPage, Template = holdingTemplate, PageSectionId = 8 }; ConsoleRepository.Add <PageTemplate>(holdingTempl_8); }
public HullSetup(IConsoleRepository consoleRepository) : base(consoleRepository) { }