Esempio n. 1
0
        public ActionResult MakeOffer(WorkViewModel workviewmodel)
        {
            var work = workRepository.GetByID(workviewmodel.Offer.WorkId);

            if (ModelState.IsValid)
            {
                workviewmodel.Offer.UserId = WebSecurity.CurrentUserId;
                workRepository.AddWorkOffer(workviewmodel.Offer);
                unitOfWork.Save();
                return(RedirectToAction("Details", new { id = workviewmodel.Offer.WorkId }));
            }
            workviewmodel.Work = work;
            return(View("~/Views/Works/Details.cshtml", workviewmodel));
        }