示例#1
0
        public async Task <ActionResult> Index()
        {
            MutualFundService service = new MutualFundService();
            List <FundInfo>   funds   = await service.GetAllFunds();

            return(View(funds));
        }
        public async Task <ActionResult> OneTimeInvestment(FundPurchased fund)
        {
            MutualFundService service = new MutualFundService();
            await service.Add(fund);

            return(RedirectToAction("Index", "Home"));
        }
示例#3
0
        public Result <MutualFund> Get(int id)
        {
            var result = new Result <MutualFund>();
            MutualFundService mutualFundService = new MutualFundService();

            result.Value     = mutualFundService.Get(id);
            result.IsSuccess = true;
            return(result);
        }
示例#4
0
        public Result <IList <MutualFund> > GetAll(int plannerId)
        {
            var result = new Result <IList <MutualFund> >();
            MutualFundService mutualFundService = new MutualFundService();

            result.Value     = mutualFundService.GetAll(plannerId);
            result.IsSuccess = true;
            return(result);
        }
示例#5
0
        public Result Delete(MutualFund mf)
        {
            var result = new Result();

            try
            {
                MutualFundService mutualFundService = new MutualFundService();
                mutualFundService.Delete(mf);
                result.IsSuccess = true;
            }
            catch (Exception exception)
            {
                result.IsSuccess     = false;
                result.ExceptionInfo = exception;
            }
            return(result);
        }