public ActionResult Create(BhSpinOffViewModel viewModel)
        {
            var dto = _bhSpinOffDtoMap.MapToDto(viewModel);
            var dto2 = _bhService.CreateSpinOff(dto);

            return View(viewModel);
        }
 //public ActionResult list2()
 //{
 //    var dto = _bhService.GetSpinOffs();
 //    var viewModel = _bhSpinOffDtoMap.MapToViewModel(dto);
 //    return View(viewModel);
 //}
 public ActionResult Create()
 {
     var model = new BhSpinOffViewModel
     {
         SpinOffItems = new List<BhSpinOffItemViewModel>
         {
              new BhSpinOffItemViewModel()
         },
         SpinOffLinks = new List<BhSpinOffLinkViewModel>
         {
             new BhSpinOffLinkViewModel()
         }
     };
     return View(model);
 }
Exemplo n.º 3
0
        //BhSpinOff
        public BhSpinOffDto MapToDto(BhSpinOffViewModel model)
        {
            return new BhSpinOffDto
            {
                Id = model.Id,
                TransactionDate = model.TransactionDate,
                //Ratio = model.Ratio,
                Notes = model.Notes,
                TransactionApplied = model.TransactionApplied,
                SpinOffItems = MapToDto(model.SpinOffItems),
                SpinOffLinks = MapToDto(model.SpinOffLinks),

                SourceId = model.SourceId,
                CostBasisSplit = model.CostBasisSplit,
                //BhTransactionDate = model.BhTransactionDate,

                SecurityId = model.SecurityId,
                TickerSymbol = model.TickerSymbol.ToUpper(),
                Shares = model.Shares,
                SourceTransactionApplied = model.SourceTransactionApplied,
            };
        }
 public ActionResult Edit(BhSpinOffViewModel viewModel)
 {
     //var dto = _bhService.GetSpinOffSource(id);
     var dto = _bhSpinOffDtoMap.MapToDto(viewModel);
     var dto2 = _bhService.UpdateSpinOff(dto);
     return View(viewModel);
 }