public IActionResult GetProject(int id)
        {
            var project = _context.Project.SingleOrDefault(p => p.Project_ID == id);

            _context.Entry(project)
            .Reference(b => b.Employer)
            .Load();
            return(Json(project));
        }
예제 #2
0
        public IActionResult ProjectDetails(int id)
        {
            var Employer_IDs = HttpContext.Session.GetInt32("Employer_ID");
            var Company_ID   = HttpContext.Session.GetInt32("Company_ID");
            var Freelance_ID = HttpContext.Session.GetInt32("Freelance_ID");
            var Admin_ID     = HttpContext.Session.GetInt32("Admin_ID");

            if (Employer_IDs != null)
            {
                ViewData["NavStatus"] = "Employer";
            }
            if (Company_ID != null)
            {
                ViewData["NavStatus"] = "Company";
            }
            if (Freelance_ID != null)
            {
                ViewData["NavStatus"] = "Freelance";
            }
            if (Admin_ID != null)
            {
                ViewData["NavStatus"] = "Admin_ID";
            }
            var Employer_ID = HttpContext.Session.GetInt32("Freelance_ID");

            if (Employer_ID != null)
            {
                return(RedirectToAction("ProjectDetails", "Freelnace", new { id = id }));
            }
            var ProjectDetails = _context.Project.SingleOrDefault(p => p.Project_ID == id);

            _context.Entry(ProjectDetails)
            .Collection(b => b.Auction)
            .Load();
            _context.Entry(ProjectDetails)
            .Reference(b => b.Employer)
            .Load();
            _context.Entry(ProjectDetails)
            .Reference(b => b.Company)
            .Load();
            _context.Entry(ProjectDetails)
            .Reference(b => b.TypeProject)
            .Load();
            var AuctionList = _context.Auction.Where(a => a.Project_ID == id)
                              .Include(x => x.Project)
                              .Include(x => x.Freelance).ToList();

            ViewData["ProjectDetails"] = ProjectDetails;
            ViewData["AuctionList"]    = AuctionList;
            return(View());
        }
        public IActionResult ProjectDetails(int id)
        {
            var ProjectDetails = _context.Project.SingleOrDefault(p => p.Project_ID == id);

            _context.Entry(ProjectDetails)
            .Reference(b => b.Company)
            .Load();
            _context.Entry(ProjectDetails)
            .Reference(b => b.TypeProject)
            .Load();
            HttpContext.Session.SetInt32("ProjectAcceptFreelanceId", id);
            ViewData["ProjectDetails"] = ProjectDetails;
            return(View());
        }
예제 #4
0
        public IActionResult ProjectDetails(int id)
        {
            var ProjectDetails = _context.Project.SingleOrDefault(p => p.Project_ID == id);

            // var Auction = _context.Auction.Where(a => a.Project_ID == id);
            _context.Entry(ProjectDetails)
            .Reference(b => b.Employer)
            .Load();
            _context.Entry(ProjectDetails)
            .Reference(b => b.Company)
            .Load();
            _context.Entry(ProjectDetails)
            .Reference(b => b.TypeProject)
            .Load();
            var AuctionList = _context.Auction.Where(a => a.Project_ID == id)
                              .Include(x => x.Project)
                              .Include(x => x.Freelance).ToList();

            ViewData["AuctionList"]    = AuctionList;
            ViewData["ProjectDetails"] = ProjectDetails;
            /// ViewData["Auction"] = Auction;
            return(View());
        }