コード例 #1
0
        //public ActionResult Details(int id = 0)
        //{
        //    if (id == 0)
        //    {
        //        return RedirectToAction("Index");
        //    }
        //    JobDetails details = new JobDetails();
        //    List<JobDetail> job = new List<JobDetail>();

        //    job = GetJobDetails(id);


        //    details.JobModel = job;
        //    return View(details);
        //}

        public List <JobDetail> GetJobDetails(int id)
        {
            List <JobDetail> job = new List <JobDetail>();
            var entities         = new JobDbEntities();

            var job_details = entities.Jobs.Where(p => p.Job_Id == id);

            foreach (var item in job_details)
            {
                job.Add(new JobDetail
                {
                    Id          = item.Job_Id,
                    Position    = item.Job_Position,
                    Description = item.Job_Description,
                    Country     = item.Country,
                    State       = item.State,
                    City        = item.City,
                    Minimum_Experience_Required = item.Min_Exp_Req,
                    Maximum_Experience_Required = item.Max_Exp_Req,
                    Start_Date = item.Start_Date,
                    End_Date   = item.End_Date,
                    Skills     = item.Skills,
                    Pay_Rate   = item.PayRate
                });
            }
            return(job);
        }
コード例 #2
0
        //
        // GET: /JobSearch/
        public ActionResult Index()
        {
            var entities = new JobDbEntities();

            return(View(entities.Jobs.ToList()));
        }