Пример #1
0
        public ActionResult SelectProject()
        {
            Session.RemoveAll();
            IEnumerable <Project>  projects = this.ProjectService.FindAll();
            IList <SelectListItem> prjItems = new List <SelectListItem>();

            Parallel.ForEach(projects, p => prjItems.Add(new SelectListItem {
                Text = p.ProjectName, Value = p.Id.ToString()
            }));
            ViewBag.Title = "Select Project";
            return(View(new ProjectInfo()
            {
                ProjectItems = prjItems, TProperty = Nameof <Project> .Property(p => p.ProjectName)
            }));
        }
Пример #2
0
        private ActionResult RenderIndexView(IEnumerable <GlobalSetting> globalSettings, int recordCount, int pageIndex)
        {
            GlobalSettingInfo gsi = new GlobalSettingInfo {
                GlobalSettings       = globalSettings, SelectedGlobalSetting = new GlobalSetting(),
                QueryConditionEntity = new QueryConditionEntity {
                    Name = Nameof <GlobalSetting> .Property(gs => gs.Name), Value = Nameof <GlobalSetting> .Property(gs => gs.Value)
                }
            };
            Func <int, UrlHelper, string> pageUrlAccessor = (currentPage, helper) => helper.RouteUrl("GlobalSettingPage", new { PageIndex = currentPage }).ToString();
            ViewResult result = View(gsi);

            ViewBag.RecordCount     = recordCount;
            ViewBag.PageIndex       = pageIndex;
            ViewBag.PageUrlAccessor = pageUrlAccessor;
            return(result);
        }
Пример #3
0
        private ActionResult RenderIndexView(IEnumerable <TestData> testDataMore, int recordCount, int pageIndex)
        {
            TestDataInfo tdi = new TestDataInfo
            {
                TestDataMore        = testDataMore,
                SelectedTestData    = new TestData(),
                FindConditionEntity = new FindConditionEntity
                {
                    TestCaseId = Nameof <TestData> .Property(td => td.TestCaseId),
                    Name       = Nameof <TestData> .Property(td => td.Name),
                    Value      = Nameof <GlobalSetting> .Property(gs => gs.Value)
                }
            };
            Func <int, UrlHelper, string> pageUrlAccessor = (currentPage, helper) => helper.RouteUrl("TestDataPage", new { PageIndex = currentPage }).ToString();
            ViewResult result = View(tdi);

            ViewBag.RecordCount     = recordCount;
            ViewBag.PageIndex       = pageIndex;
            ViewBag.PageUrlAccessor = pageUrlAccessor;
            return(result);
        }
Пример #4
0
        private ActionResult RenderIndexView(IEnumerable <Control> controls, IList <SelectListItem> propertyListWhenEdit, int recordCount, int pageIndex)
        {
            ControlInfo ci = new ControlInfo
            {
                Controls                = controls,
                PropertyListWhenEdit    = propertyListWhenEdit ?? null,
                SearchedConditionEntity = new SearchedConditionEntity
                {
                    ControlType     = Nameof <Control> .Property(c => c.ControlProperty.Type),
                    ControlProperty = Nameof <Control> .Property(c => c.ControlProperty.Property),
                    PropertyValue   = Nameof <Control> .Property(c => c.PropertyValue),
                    ControlName     = Nameof <Control> .Property(c => c.Name)
                }
            };
            Func <int, UrlHelper, string> pageUrlAccessor = (currentPage, helper) => helper.RouteUrl("ControlPage", new { PageIndex = currentPage }).ToString();
            ViewResult result = View(ci);

            ViewBag.RecordCount     = recordCount;
            ViewBag.PageIndex       = pageIndex;
            ViewBag.PageUrlAccessor = pageUrlAccessor;
            return(result);
        }
Пример #5
0
        public void CanRecordResearchValuesAndGetRatingForAsset()
        {
            var repo    = new EdisRepository();
            var adviser = repo.CreateAdviser("Test", "Adviser").Result;

            adviser.CreateNewClientGroup(new ClientGroupRegistration()
            {
                AdviserNumber = adviser.AdviserNumber,
                FirstName     = "client first name",
                LastName      = "client last name",
                Address       = "668 Bourke Street, Melbourne, 3000, Victoria",
                Dob           = DateTime.Now,
                Phone         = "03699999",
                Email         = "Email"
            }).Wait();

            var groups = adviser.GetAllClientGroups().Result;

            groups[0].AddAccount("group account", AccountType.GenenralPurpose).Wait();
            var account = groups[0].GetAccounts()[0];

            account.MakeTransaction(new EquityTransactionCreation()
            {
                EquityType      = EquityTypes.AustralianEquity,
                FeesRecords     = new List <TransactionFeeRecordCreation>(),
                Name            = "Test Stock",
                NumberOfUnits   = 1000,
                Price           = 29.64,
                Sector          = "Test Sector",
                Ticker          = "Test Ticker 01",
                TransactionDate = DateTime.Now,
            }).Wait();


            account.MakeTransaction(new EquityTransactionCreation()
            {
                EquityType      = EquityTypes.AustralianEquity,
                FeesRecords     = new List <TransactionFeeRecordCreation>(),
                Name            = "Test Stock",
                NumberOfUnits   = 1000,
                Price           = 29.64,
                Sector          = "Test Sector",
                Ticker          = "Test Ticker 02",
                TransactionDate = DateTime.Now,
            }).Wait();

            #region set up research values (this portion is optional, default values will be used if no research values available. Absent of research values will always generate 'Danger' rating)
            //record Australian equity f0 values
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.Beta), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.EarningsStability), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearInformation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.Frank), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.InterestCover), 0, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.OneYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.PayoutRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.ThreeYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.BetaFiveYears), 1.1036, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.Capitalisation), 57225467107, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.CurrentRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.DebtEquityRatio), 0, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.DividendYield), 0.0621, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.EpsGrowth), 0.0772, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearAlphaRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearSharpRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearSkewnessRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearStandardDeviation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearTrackingErrorRatio), 1.1036, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FundSize), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.GlobalCategory), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.CurrentRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.PriceEarningRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.QuickRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.ReturnOnAsset), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.ReturnOnEquity), 1, "Test Ticker 01", "Test Issuer").Wait();

            //record Australian Equity f1 research values
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.FinancialLeverage), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.Frank), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.InterestCover), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.IntrinsicValue), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearRevenueGrowth), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.PriceEarningRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.ReturnOnAsset), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.ReturnOnEquity), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.CreditRating), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.DebtEquityRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.DividendYield), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.EpsGrowth), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.FairValueVariation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.FiveYearTotalReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.MaxManagementExpenseRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.MorningStarAnalyst), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.MorningstarRecommendation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearAlpha), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearInformationRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearBeta), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearSharpRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearTrackingError), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.PerformanceFee), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.YearsSinceInception), 1, "Test Ticker 01", "Test Issuer").Wait();
            #endregion
            var assets = account.GetAssets();
            var equityWithResearchValues    = assets.OfType <Equity>().First(a => a.Ticker == "Test Ticker 01");
            var equityWithNoResearchValues  = assets.OfType <Equity>().First(a => a.Ticker == "Test Ticker 02");
            var rating_withResearchValues   = equityWithResearchValues.GetRating();
            var rating_withNoResearchValues = equityWithNoResearchValues.GetRating();
            Assert.IsTrue(rating_withNoResearchValues.SuitabilityRating == SuitabilityRating.Danger);
            Assert.IsTrue(rating_withResearchValues != null);
        }
    static void Main()
    {
        var propertyName = Nameof <SampleClass> .Property(e => e.Name);

        MessageBox.Show(propertyName);
    }
Пример #7
0
    static void Main()
    {
        var propName = Nameof <SampleClass> .Property(e => e.Name);

        Console.WriteLine(propName);
    }