Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ApplicationUserId,IsNameVisible,IsPrivate,IsAssigned,IsReported,Isvisible,ReportedByUserId,Description,DaysRequired,FreelancerProjectId,DateofRecord,DateOfAssignment,DeliveredDate,BidAmount,ProposalStatus")] FreelancerProposal freelancerProposal)
        {
            if (id != freelancerProposal.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(freelancerProposal);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FreelancerProposalExists(freelancerProposal.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Details", "FreelancerProjects", new { id = freelancerProposal.FreelancerProjectId }));
            }
            ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", freelancerProposal.ApplicationUserId);
            ViewData["ReportedByUserId"]  = new SelectList(_context.ApplicationUsers, "Id", "Id", freelancerProposal.ReportedByUserId);
            return(View(freelancerProposal));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("Id,ApplicationUserId,IsNameVisible,IsPrivate,IsAssigned,IsReported,Isvisible,ReportedByUserId,Description,DaysRequired,FreelancerProjectId,DateofRecord,DateOfAssignment,DeliveredDate,BidAmount,ProposalStatus")] FreelancerProposal freelancerProposal)
        {
            if (ModelState.IsValid)
            {
                _context.Add(freelancerProposal);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", freelancerProposal.ApplicationUserId);
            ViewData["ReportedByUserId"]  = new SelectList(_context.ApplicationUsers, "Id", "Id", freelancerProposal.ReportedByUserId);
            return(View(freelancerProposal));
        }