// GET: Gig public ActionResult Create() { // CREATE VIEW MODEL TO SEND IT TO THE VIEW var viewModel = GigFormViewModel.CreateFormViewModel(null, unitOfWork.SpecificIndustryRepository.GetSpecificIndustries().ToList(), "Create New Gig", "Save"); return(View("GigForm", viewModel)); }
public ActionResult Edit(int gigID) { var userId = User.Identity.GetUserId(); // BRING GIG FROM DB WITH ALL ITS FOLLOWINGS var gig = unitOfWork.GigsRepository.GetGigForForm(gigID); //CHECK IF THE GIG EXIST if (gig == null) { return(HttpNotFound()); } if (gig.UserID != userId) { return(new HttpUnauthorizedResult()); } var viewModel = GigFormViewModel.CreateFormViewModel(gig, unitOfWork.SpecificIndustryRepository.GetSpecificIndustries().ToList(), "Update your Gig", "Update"); // GO TO CREATE VIEW return(View("GigForm", viewModel)); }