public ActionResult CustomerCentral() //view where customer can view a list of their projects { ViewBag.Message = "View your projects."; string id = GetTheCurrentId(); var data = GigManager.LoadGig(id); List <Gig> myListOfGigs = new List <Gig>(); foreach (var row in data) { Gig g = new Gig { Id = row.Id, Title = row.Title, Type = row.Type, Footprint = row.Footprint, Description = row.Description, Zipcode = row.Zipcode, Price = row.Price, CreationDate = row.CreationDate }; g.Price = FindLowestBid(Convert.ToInt32(g.Id)); //updates the price to the lowest bid. g.PriceToString(); myListOfGigs.Add(g); } return(View(myListOfGigs)); }
[Authorize(Roles = "Company")] //this means the user must be signed in as a contractor public ActionResult CompanyCentral() //View where contractors can see what projects are available to have bids on { ViewBag.Message = "Bid on a project."; var data = GigManager.LoadGigs(); List <Gig> myListOfGigs = new List <Gig>(); foreach (var row in data) { Gig g = new Gig { Id = row.Id, Title = row.Title, Type = row.Type, Footprint = row.Footprint, Description = row.Description, Zipcode = row.Zipcode, Price = row.Price, CreationDate = row.CreationDate }; g.Price = FindLowestBid(Convert.ToInt32(g.Id)); g.PriceToString(); myListOfGigs.Add(g); } return(View(myListOfGigs)); }
public ActionResult PlaceBid(string id) //View where contractor can place a bid on a specific gig { Gig gig; var data = GigManager.LoadSpecificGig(id); gig = new Gig { Id = data.Id, Title = data.Title, Type = data.Type, Footprint = data.Footprint, Description = data.Description, Zipcode = data.Zipcode, Price = data.Price, CreationDate = data.CreationDate }; gig.PriceToString(); return(View(gig)); }