コード例 #1
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Fund entity = _fundService.GetById(id.Value);

            if (entity == null)
            {
                return(HttpNotFound());
            }
            var viewmodel = Mapper.Map <Fund, FundEditViewModel>(entity);

            viewmodel.PrimaryFunds = _fundService.GetPrimaryFunds(entity.Year, entity.DbSource)
                                     .Select(t => new SelectListItem()
            {
                Text  = t.DisplayName + " - " + t.FundNumber,
                Value = t.Id.ToString()
            });
            return(View(viewmodel));
        }
コード例 #2
0
 public Fund Get(int id)
 {
     return(_fundService.GetById(id));
 }