예제 #1
0
        public ActionResult DealerLeinholderReturn(int id)
        {
            var title = _db.Titles.Find(id);
            var vm    = new DealerLeinholderReturnViewModel()
            {
                Title = title,
                User  = User,
            };

            vm.Interaction = vm.CreateNewInteractionFromTitle(title, _userManager);
            return(View(vm));
        }
예제 #2
0
        public ActionResult DealerLeinholderReturn(DealerLeinholderReturnViewModel vm)
        {
            if (vm.Interaction.CustPhone == null)
            {
                vm.Interaction.CustPhone = "N/A";
            }
            _db.Interactions.Add(vm.Interaction);
            var tit = _db.Titles.Find(vm.Interaction.TitleId);

            tit.SentBackToLhDlrDt = DateTime.Now;
            _db.Entry(tit).State  = EntityState.Modified;
            _db.SaveChanges();
            return(RedirectToAction(
                       "SendTitleReturnLetterAsPdf",
                       "Interactions",
                       new { id = vm.Interaction.Id }));
        }