Ejemplo n.º 1
0
        public async Task <ActionResult> Create(BusProposal busProposal, int ExecSummaryId)
        {
            var userId      = this.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
            var currentUser = await _userManager.FindByIdAsync(userId);

            busProposal.User = currentUser;
            _db.BusProposals.Add(busProposal);
            if (ExecSummaryId != 0)
            {
                _db.ExecSummaryBusProposal.Add(new ExecSummaryBusProposal()
                {
                    ExecSummaryId = ExecSummaryId, BusProposalId = busProposal.BusProposalId
                });
            }
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Create(ExecSummary execSummary)
 {
     _db.ExecSummaries.Add(execSummary);
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }