Ejemplo n.º 1
0
 public Company CreateCompany(string name, FieldOfActivity activity, string address,
     Dictionary<string, string> projectDictionary)
 {
     var company = new Company(name, activity, address, projectDictionary);
     OnCompanyCreation(company);
     Logger.Logger.AddToLog("CompanyFactory|CreateCompany Company");
     return company;
 }
Ejemplo n.º 2
0
        public static externalDTO.Company MapFromDomain(internalDTO.Company company)
        {
            var res = company == null ? null : new externalDTO.Company()
            {
                Id             = company.Id,
                CompanyName    = company.CompanyName,
                CompanyAddress = company.CompanyAddress
            };

            return(res);
        }
        public ActionResult UpdateDatapoints(Company.ConstituentOfIndex? index)
        {
            // TODO This can be done in one select
            var companyRepository = new CompanyRepository();
            var companyList = new List<Company>();
            companyList.AddRange(companyRepository.FindByIndex(Company.ConstituentOfIndex.Ftse100));
            companyList.AddRange(companyRepository.FindByIndex(Company.ConstituentOfIndex.Ftse250));
            companyList.AddRange(companyRepository.FindByIndex(Company.ConstituentOfIndex.SmallCap));
            foreach (var company in companyList)
            {
                try
                {
                    dataManagementService.InsertNewQuotesToDb(company.Symbol);
                }
                catch (Exception)
                {
                    //TODO: Remove this once bug fixed
                }
            }

            this.TempData["message"] = "Datapoints Updated For Index " + index;
            return this.RedirectToAction("Index");
        }
Ejemplo n.º 4
0
 public void OnCompanyCreation(Company company)
 {
     _displayInfoAction.ShowCpmpanyInfo(company);
 }
Ejemplo n.º 5
0
        public async Task<ProducerBusiness> SetProducerBusiness(producerBusinessType producerBusiness)
        {
            object item = producerBusiness.Item;
            ProducerContact correspondentForNoticeContact = null;
            if (producerBusiness.correspondentForNotices.contactDetails != null)
            {
                correspondentForNoticeContact =
                    await GetProducerContact(producerBusiness.correspondentForNotices.contactDetails);
            }

            Company company = null;
            Partnership partnership = null;
            if (item is companyType)
            {
                companyType companyitem = (companyType)item;
                ProducerContact contact = await GetProducerContact(companyitem.registeredOffice.contactDetails);
                company = new Company(companyitem.companyName, companyitem.companyNumber, contact);
            }
            else if (item is partnershipType)
            {
                partnershipType partnershipItem = (partnershipType)item;
                string partnershipName = partnershipItem.partnershipName;

                List<string> partnersList = partnershipItem.partnershipList.ToList();
                List<Partner> partners = partnersList.Select(name => new Partner(name)).ToList();
                ProducerContact contact = await GetProducerContact(partnershipItem.principalPlaceOfBusiness.contactDetails);
                partnership = new Partnership(partnershipName, contact, partners);
            }

            return new ProducerBusiness(company, partnership, correspondentForNoticeContact);
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            var reader = new ObjectRandomizer();
            Domain.Address domObj = new Domain.Address();
            reader.generateObjectRandomData<Domain.Address>(domObj);

            Domain.Company compObj = new Domain.Company();
            reader.generateObjectRandomData<Domain.Company>(compObj);

            var property = Builder<Domain.Property>
                                    .CreateNew()
                                    .With(p => p.ConstructionStatus = Randomizer.Property.GenerateRandomPropertyBuildingStatus())
                                    .And(p => p.CountryCode = Randomizer.Address.GenerateRandomCountryCode())
                                    .And(p=> p.Addresses = (List<Domain.Address>)Builder<Domain.Address>
                                                            .CreateListOfSize(4)
                                                            .All().With(a => a.FullAddress = Randomizer.Address.GenerateRandomAddress())
                                                            .All().With(a => a.Country = Randomizer.Address.GenerateRandomCountry())
                                                            .Random(2).With(a=>a.Suite = Randomizer.Number.RandomIntMinMax(101,505).ToString())
                                                            .Random(2).With(a => a.Suite = null)
                                                            .Build())
                                    .Build();
            int maxElements;

            var mockData = Builder<Domain.Property>
                                    .CreateListOfSize(20)
                                    .All().With(p => p.PropertyID = Randomizer.Number.RandomIntMinMax(1, 9999999))
                                          .With(p => p.CountryCode = Randomizer.Address.GenerateRandomCountry())
                                          .With(p => p.Addresses = (List<Domain.Address>)Builder<Domain.Address>
                                                            .CreateListOfSize(Randomizer.Number.RandomIntMinMaxOut(2, 50, out maxElements))
                                                            .All()
                                                                .With(a => a.FullAddress = Randomizer.Address.GenerateRandomAddress())
                                                                .With(a => a.Country = Randomizer.Address.GenerateRandomCountry())
                                                                .Random(Randomizer.Number.RandomIntMinMax(1, maxElements/2)).With(a => a.Suite = Randomizer.Number.RandomIntMinMax(101, 505).ToString())
                                                                .Random(Randomizer.Number.RandomIntMinMax(1, maxElements / 2)).With(a => a.Suite = null)
                                                            .Build())
                                    .Random(2).With(p=>p.Addresses = new List<Domain.Address>())
                                    .TheFirst(5).With(p => p.ConstructionStatus = null)
                                    .TheNext(15).With(p => p.ConstructionStatus = Randomizer.Property.GenerateRandomPropertyBuildingStatus())
                                    .Build();

            var json = JsonConvert.SerializeObject(mockData);

            reader.generateObjectRandomData<Domain.Property>(property);

            Type t = typeof(Domain.Property);
            MethodInfo[] methods = t.GetMethods();
            MemberInfo[] members = t.GetMembers();
            FieldInfo[] fields = t.GetFields();
            PropertyInfo[] properties = t.GetProperties();

            //var properties = Builder<Domain.Property>
            //                        .CreateListOfSize(500)
            //                        .All()
            //                        .With(p => p.ConstructionStatus = Randomizer.Property.GenerateRandomPropertyBuildingStatus())
            //                        .And(p => p.CountryCode = Randomizer.Address.GenerateRandomCountryCode())
            //                        .Build();

            var contacts = Builder<Contact>
                            .CreateListOfSize(700)
                            .All()
                            .With(c => c.FirstName = Randomizer.Person.GenerateRandomFirstName())
                            .And(c => c.LastName = Randomizer.Person.GenerateRandomLastName())
                            .And(c => c.BirthDate = Randomizer.Date.GenerateRandomBirthdateMinAge(18))
                            .And(c => c.EmailAddress = Randomizer.Person.GenerateRandomEmailForName(c.FirstName))
                            .And(c => c.PhoneNumber = Randomizer.Person.GenerateRandomPhone())
                            .Build();
        }
 public TechnicalsViewModel(string ticker, Company company, decimal tradingPerformancePercentage)
 {
     this.Ticker = ticker;
     this.Company = company;
     this.TradingPerformancePercentage = tradingPerformancePercentage;
 }