/// <summary> /// Create one /// </summary> /// <param name="dt"></param> /// <returns></returns> // GET: Obligations/Create public async Task <IActionResult> Create(DateTime dt) { var vm = new ObligationModel(); vm.StartTime = dt.ToString("yyyy-MM-ddTHH:mm"); vm.EndTime = dt.ToString("yyyy-MM-ddTHH:mm"); vm.LocationValues = new SelectList(await _bll.Locations.AllForPerson(User.UserId()), nameof(Location.LocationValue), nameof(Location.LocationValue)); List <string> fullNames = (await _bll.Persons.AllFamilyPersons(User.UserId())) .Select(p => p.FirstName + " " + p.LastName).ToList(); vm.FullNames = fullNames.Select(x => new SelectListItem() { Text = x.ToString() }); return(View(vm)); }
public ObligationViewModel() { _obligationModel = new ObligationModel(); GetTaxes(); }