public ActionResult GetDetails(int?id)
        {
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      deprepo = new DepartmentRepository();

            var data = (from d in repo.GetVacancies()
                        join dep in deprepo.GetAll() on d.DepartmentId equals dep.DepartmentId
                        where d.VacancyId == id
                        select new
            {
                d.VacancyId,
                d.VacancyName,
                d.JobLevel,
                dep.DepartmentName,
                d.CityName,
                d.RequiredQualification
            }).Select(c => new VacancyVM()
            {
                VacancyId             = c.VacancyId,
                JobLevel              = (int)(c.JobLevel),
                VacancyName           = c.VacancyName,
                CityName              = c.CityName,
                DepartmentName        = c.DepartmentName,
                RequiredQualification = c.RequiredQualification
            }).FirstOrDefault();


            return(PartialView("JobDetailsPartial", data));
        }
        public ActionResult GetIdonConfirm(int?id)
        {
            IRepository obj = new ApplicantRepository();
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      deprepo = new DepartmentRepository();

            var result = (from d in obj.GetAll()
                          join s in repo.GetVacancies() on d.VacancyId equals s.VacancyId
                          join dep in deprepo.GetAll() on s.DepartmentId equals dep.DepartmentId
                          where d.ApplicationId == id
                          select new
            {
                d.ApplicationId,
                d.Email,
                d.Appliedfor,
                dep.DepartmentName,
                d.ApplicantName
            }).Select(c => new CandidateEmployeeVM()
            {
                ApplicationId  = (int)(c.ApplicationId),
                Email          = c.Email,
                Position       = c.Appliedfor,
                DepartmentName = c.DepartmentName,
                EmployeeName   = c.ApplicantName
            }).FirstOrDefault();


            return(PartialView("ConfirmPartial", result));
        }
        public ActionResult Apply(int?id)
        {
            IStructuredetailRepository obj = new StructuredetailRepository();
            var Data = obj.GetVacancies()
                       .Select(x => new ApplyVM {
                VacancyId = x.VacancyId, Appliedfor = x.VacancyName
            })
                       .Where(x => x.VacancyId == id).FirstOrDefault();


            return(View(Data));
        }
        public ActionResult GetSlCandidates(int?id)
        {
            IRepository obj = new ApplicantRepository();
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      deprepo = new DepartmentRepository();
            var Emp = (from d in obj.GetAll()
                       join s in repo.GetVacancies() on d.VacancyId equals s.VacancyId
                       join dep in deprepo.GetAll() on s.DepartmentId equals dep.DepartmentId
                       join pos in repo.Getpos() on s.PositionId equals pos.Id
                       where d.ApplicationId == id
                       select new
            {
                d.ApplicantName,
                d.Gender,
                s.DepartmentId,
                s.PositionId,
                d.Dob,
                d.Phone,
                d.Email,
                d.Address,
                d.ApplicationId,
                dep.DepartmentName,
                pos.Position,
                pos.BasicPay
            }).Select(c => new CandidateEmployeeVM()
            {
                ApplicationId  = (int)(c.ApplicationId),
                EmployeeName   = c.ApplicantName,
                Gender         = c.Gender,
                DepartmentId   = (int)(c.DepartmentId),
                DepartmentName = c.DepartmentName,
                PositionId     = (int)c.PositionId,
                DateofBirth    = (DateTime)c.Dob,
                Contact        = c.Phone,
                Email          = c.Email,
                Address        = c.Address,
                Position       = c.Position,
                Salary         = (decimal)c.BasicPay,
                PosSalary      = (decimal)c.BasicPay
            }).FirstOrDefault();


            return(PartialView("HireEmployee", Emp));
        }
        public ActionResult Getcreatedvaclist()
        {
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      objrepo = new DepartmentRepository();

            var Data = (from u in repo.GetVacancies()
                        join a in objrepo.GetAll() on u.DepartmentId equals a.DepartmentId
                        join b in repo.Getpos() on u.PositionId equals b.Id
                        select new
            {
                a.DepartmentName,
                b.Position,
                u.JobLevel,
                u.MarksCriteria,
                u.Testpaper,
            }).ToList();

            return(Json(new { data = Data }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetConfirmation(int?id)
        {
            IRepository obj = new ApplicantRepository();
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      deprepo = new DepartmentRepository();

            var Data = (from d in obj.GetAll()
                        join s in repo.GetVacancies() on d.VacancyId equals s.VacancyId
                        where d.ApplicationId == id
                        select new
            {
                d.ApplicantName,
                d.Gender,
                s.DepartmentId,
                s.PositionId,
                d.Dob,
                d.Phone,
                d.Email,
                d.Address,
                d.ApplicationId,
                d.JoiningDate,
                s.CityName,
                d.Salary
            }).Select(c => new CandidateEmployeeVM()
            {
                ApplicationId = (int)(c.ApplicationId),
                EmployeeName  = c.ApplicantName,
                Gender        = c.Gender,
                DepartmentId  = (int)(c.DepartmentId),
                PositionId    = (int)c.PositionId,
                DateofBirth   = (DateTime)c.Dob,
                Contact       = c.Phone,
                Email         = c.Email,
                Address       = c.Address,
                JoiningDate   = (Nullable <DateTime>)c.JoiningDate,
                CityName      = c.CityName,
                PosSalary     = c.Salary
            }).FirstOrDefault();

            return(PartialView("ConfirmEmployeePartial", Data));
        }